Skip to content

Commit ca3b034

Browse files
committed
1.1 release
1 parent 4217f0c commit ca3b034

File tree

6 files changed

+26
-17
lines changed

6 files changed

+26
-17
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ create and manage interlanguage links.
1212

1313
This extension creates interlanguage links and provides queryable annotations that can connect
1414
pages with similar content for different languages to be accessible via the [sitelink navigation][sitelink]
15-
by using the `INTERLANGUAGELINK` parser function.
15+
by using the `interlanguagelink` parser function.
1616

1717
The following [video](https://vimeo.com/115871518) demonstrates "How SIL works"
1818
without much user interaction or complex editing procedures.
@@ -21,7 +21,7 @@ without much user interaction or complex editing procedures.
2121

2222
- PHP 5.3.2 or later
2323
- MediaWiki 1.23 or later
24-
- [Semantic MediaWiki][smw] 2.1+
24+
- [Semantic MediaWiki][smw] 2.1 or later
2525

2626
## Installation
2727

@@ -31,22 +31,22 @@ with an entry in MediaWiki's `composer.json`.
3131
```json
3232
{
3333
"require": {
34-
"mediawiki/semantic-interlanguage-links": "~1.0"
34+
"mediawiki/semantic-interlanguage-links": "~1.1"
3535
}
3636
}
3737
```
3838
1. From your MediaWiki installation directory, execute
39-
`composer require mediawiki/semantic-interlanguage-links:~1.0`
39+
`composer require mediawiki/semantic-interlanguage-links:~1.1`
4040
2. Navigate to _Special:Version_ on your wiki and verify that the package
4141
have been successfully installed.
4242

4343
## Usage
4444

45-
The parser function `{{INTERLANGUAGELINK: language code | interlanguage reference }}` (or `{{interlanguagelink: ...}}`) provides in-text annotation support with the first argument being a language code (e.g `es`, `ja`) while the second argument contains an arbitrary reference (`interlanguage reference`) that describes similar content for different languages.
45+
The parser function `{{interlanguagelink: language code | interlanguage reference }}` provides in-text annotation support with the first argument being a language code (e.g `es`, `ja`) while the second argument contains an arbitrary reference (`interlanguage reference`) that describes similar content for different languages.
4646

4747
![sil](https://cloud.githubusercontent.com/assets/1245473/7594045/0d88d938-f919-11e4-9c79-8e8d166c507a.png)
4848

49-
The parser function `{{INTERLANGUAGELIST: interlanguage reference | template }}` can generate a customizable language target link list for the selected `interlanguage reference` to be available as wikitext inclusion using a template with the following parameters:
49+
The parser function `{{interlanguagelist: interlanguage reference | template }}` can generate a customizable language target link list for the selected `interlanguage reference` to be available as wikitext inclusion using a template with the following parameters:
5050
- `target-link` being the target link
5151
- `lang-code` the language code
5252
- `lang-name` representing the localized language name for the language code
@@ -66,7 +66,7 @@ Page: Foo
6666
Lorem ipsum dolor sit amet, sale lucilius id mei, pri id prima legendos, at
6767
vix tantas habemus tincidunt.
6868
69-
{{INTERLANGUAGELINK:la|Lorem ipsum}}
69+
{{interlanguagelink:la|Lorem ipsum}}
7070
```
7171
```text
7272
Page:Bar
@@ -79,7 +79,7 @@ Page:Bar
7979

8080
#### List languages
8181

82-
Using `Template:InterlanguageLinksTemplate` in `INTERLANGUAGELIST` will output all available links to the `Lorem ipsum` reference on top of the page `FooBar`.
82+
Using `Template:InterlanguageLinksTemplate` in `interlanguagelist` will output all available links to the `Lorem ipsum` reference on top of the page `FooBar`.
8383

8484
```text
8585
Template:InterlanguageLinksTemplate
@@ -90,7 +90,7 @@ Template:InterlanguageLinksTemplate
9090
```text
9191
Page:FooBar
9292
93-
{{INTERLANGUAGELIST:Lorem ipsum|InterlanguageLinksTemplate}}
93+
{{interlanguagelist:Lorem ipsum|InterlanguageLinksTemplate}}
9494
9595
```
9696

@@ -104,9 +104,8 @@ Page:FooBar
104104

105105
### Configuration
106106

107-
`$GLOBALS['egSILCacheType'] = CACHE_ANYTHING;` is being set to be the default value to improve query lookups during each page view with cache invalidation being carried out during any delete, change or move action.
108-
109-
In case `$GLOBALS['wgHideInterlanguageLinks']` is enabled (set to `true`), no sitelinks or annotations are created.
107+
- `$GLOBALS['egSILCacheType'] = CACHE_ANYTHING;` is being set to be the default value to improve query lookups during each page view with cache invalidation being carried out during any delete, change or move action.
108+
- `$GLOBALS['wgHideInterlanguageLinks']` is enabled (set to `true`), no sitelinks or annotations are created (in order to correspond to the MW default behaviour for interwiki links)
110109

111110
## Contribution and support
112111

RELEASE-NOTES.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
### 1.0.0
1+
### 1.1.0 (2015-06-02)
22

3-
Released on 2015-02-14
3+
* Only match results in `Special:Search` for the selected language that contains an annotation
4+
* Fixed behaviour in `ByLanguageCategoryPage` for when languages are switched
5+
* #32 Fixed exception in `Special:Search` for no results
6+
* Localisation updates from https://translatewiki.net
7+
8+
### 1.0.0 (2015-02-14)
49

510
* Initial release
611
* Added the `onoi/cache:~1.0` dependency

SemanticInterlanguageLinks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
return 1;
2323
}
2424

25-
define( 'SIL_VERSION', '1.0' );
25+
define( 'SIL_VERSION', '1.1.0' );
2626

2727
/**
2828
* @codeCoverageIgnore

i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"sil-interlanguagelist-missing-linkreference": "The parser function is missing a valid reference.",
1919
"sil-interlanguagelist-missing-template": "The parser function is missing an output template.",
2020
"sil-interlanguageparser-linkreference-error": "The parser function had a problem to create a title object from \"$1\".",
21-
"sil-search-profile":"by Language",
21+
"sil-search-profile":"By Language",
2222
"sil-search-profile-tooltip":"Filter articles by language annotation",
2323
"sil-search-languagefilter-label":"Filter by Language",
2424
"sil-search-nolanguagefilter":"No language filter",

src/Search/LanguageResultMatchFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function matchResultsToLanguage( SearchResultSet $matches, $languageCode
4747

4848
$pageLanguage = $this->interlanguageLinksLookup->findPageLanguageForTarget( $title );
4949

50-
if ( $pageLanguage === $languageCode ) {
50+
if ( $pageLanguage === $languageCode && $this->interlanguageLinksLookup->hasSilAnnotationFor( $title ) ) {
5151
$mappedMatches[] = $searchresult;
5252
}
5353
}

tests/phpunit/Unit/Search/LanguageResultMatchFinderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public function testMatchResultsToLanguageForValidSearchResultSet() {
8484
->disableOriginalConstructor()
8585
->getMock();
8686

87+
$interlanguageLinksLookup->expects( $this->atLeastOnce() )
88+
->method( 'hasSilAnnotationFor' )
89+
->with( $this->equalTo( $title ) )
90+
->will( $this->returnValue( true ) );
91+
8792
$interlanguageLinksLookup->expects( $this->atLeastOnce() )
8893
->method( 'findPageLanguageForTarget' )
8994
->with( $this->equalTo( $title ) )

0 commit comments

Comments
 (0)