Skip to content

Commit

Permalink
1.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
mwjames committed Jun 2, 2015
1 parent 4217f0c commit ca3b034
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 17 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ create and manage interlanguage links.

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

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

- PHP 5.3.2 or later
- MediaWiki 1.23 or later
- [Semantic MediaWiki][smw] 2.1+
- [Semantic MediaWiki][smw] 2.1 or later

## Installation

Expand All @@ -31,22 +31,22 @@ with an entry in MediaWiki's `composer.json`.
```json
{
"require": {
"mediawiki/semantic-interlanguage-links": "~1.0"
"mediawiki/semantic-interlanguage-links": "~1.1"
}
}
```
1. From your MediaWiki installation directory, execute
`composer require mediawiki/semantic-interlanguage-links:~1.0`
`composer require mediawiki/semantic-interlanguage-links:~1.1`
2. Navigate to _Special:Version_ on your wiki and verify that the package
have been successfully installed.

## Usage

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.
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.

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

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:
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:
- `target-link` being the target link
- `lang-code` the language code
- `lang-name` representing the localized language name for the language code
Expand All @@ -66,7 +66,7 @@ Page: Foo
Lorem ipsum dolor sit amet, sale lucilius id mei, pri id prima legendos, at
vix tantas habemus tincidunt.
{{INTERLANGUAGELINK:la|Lorem ipsum}}
{{interlanguagelink:la|Lorem ipsum}}
```
```text
Page:Bar
Expand All @@ -79,7 +79,7 @@ Page:Bar

#### List languages

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

```text
Template:InterlanguageLinksTemplate
Expand All @@ -90,7 +90,7 @@ Template:InterlanguageLinksTemplate
```text
Page:FooBar
{{INTERLANGUAGELIST:Lorem ipsum|InterlanguageLinksTemplate}}
{{interlanguagelist:Lorem ipsum|InterlanguageLinksTemplate}}
```

Expand All @@ -104,9 +104,8 @@ Page:FooBar

### Configuration

`$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.

In case `$GLOBALS['wgHideInterlanguageLinks']` is enabled (set to `true`), no sitelinks or annotations are created.
- `$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.
- `$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)

## Contribution and support

Expand Down
9 changes: 7 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
### 1.0.0
### 1.1.0 (2015-06-02)

Released on 2015-02-14
* Only match results in `Special:Search` for the selected language that contains an annotation
* Fixed behaviour in `ByLanguageCategoryPage` for when languages are switched
* #32 Fixed exception in `Special:Search` for no results
* Localisation updates from https://translatewiki.net

### 1.0.0 (2015-02-14)

* Initial release
* Added the `onoi/cache:~1.0` dependency
Expand Down
2 changes: 1 addition & 1 deletion SemanticInterlanguageLinks.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
return 1;
}

define( 'SIL_VERSION', '1.0' );
define( 'SIL_VERSION', '1.1.0' );

/**
* @codeCoverageIgnore
Expand Down
2 changes: 1 addition & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"sil-interlanguagelist-missing-linkreference": "The parser function is missing a valid reference.",
"sil-interlanguagelist-missing-template": "The parser function is missing an output template.",
"sil-interlanguageparser-linkreference-error": "The parser function had a problem to create a title object from \"$1\".",
"sil-search-profile":"by Language",
"sil-search-profile":"By Language",
"sil-search-profile-tooltip":"Filter articles by language annotation",
"sil-search-languagefilter-label":"Filter by Language",
"sil-search-nolanguagefilter":"No language filter",
Expand Down
2 changes: 1 addition & 1 deletion src/Search/LanguageResultMatchFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function matchResultsToLanguage( SearchResultSet $matches, $languageCode

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

if ( $pageLanguage === $languageCode ) {
if ( $pageLanguage === $languageCode && $this->interlanguageLinksLookup->hasSilAnnotationFor( $title ) ) {
$mappedMatches[] = $searchresult;
}
}
Expand Down
5 changes: 5 additions & 0 deletions tests/phpunit/Unit/Search/LanguageResultMatchFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ public function testMatchResultsToLanguageForValidSearchResultSet() {
->disableOriginalConstructor()
->getMock();

$interlanguageLinksLookup->expects( $this->atLeastOnce() )
->method( 'hasSilAnnotationFor' )
->with( $this->equalTo( $title ) )
->will( $this->returnValue( true ) );

$interlanguageLinksLookup->expects( $this->atLeastOnce() )
->method( 'findPageLanguageForTarget' )
->with( $this->equalTo( $title ) )
Expand Down

0 comments on commit ca3b034

Please sign in to comment.