Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ExtraneousLanguage JSON format, refs #1691, #1561 #1848

Merged
merged 1 commit into from Sep 25, 2016
Merged

Conversation

mwjames
Copy link
Contributor

@mwjames mwjames commented Sep 14, 2016

This PR is made in reference to: #1691, #1561

This PR addresses or contains:

  • Moves SMW specific language elements from PHP to JSON
  • Support for partial fallback
  • If a json file (e.g. zh-hant.json) contains isLanguageRedirect then only a fallbackLanguage is required
  • The CanonicalFallbackLanguage is en
  • Adds LanguageFallbackFinder, LanguageFileContentsReader

This PR includes:

  • Tests (unit/integration)
  • CI build passed

@mwjames mwjames added new feature A new, or altered behaviour of an existing functionality that fundamentally impacts behaviour enhancement Alters an existing functionality or behaviour labels Sep 14, 2016
@mwjames mwjames added this to the SMW 2.5 milestone Sep 14, 2016
@mwjames
Copy link
Contributor Author

mwjames commented Sep 14, 2016

I have been re-basing this PR for months and I hope that we can have it merged rather soon. It mostly brings fallback and partial fallback support.

This PR needs extra care therefore I'd like @kghbln (I know its a pain) to test this more thoroughly to ensure that we do not introduce any regression.

  • Namespace settings remain with the content language (switching content language does work as before)
  • Property labels and names display does match the user language or content language
  • DataTypes are recognized in the content language

PS: A script has transformed content that resided in PHP files and copied them into a JSON file to match the specification but I kept the "old" PHP files for now to make it possible to compare entries with that of the JSON format. Once merged changes should only happen to the new files.

@kghbln
Copy link
Member

kghbln commented Sep 15, 2016

The issue is that it is impossible to install development branches of SMW with master of other software on sandbox via composer. I am getting the usual "Your requirements could not be resolved to an installable set of packages". I currently need sandbox including the other semantic software to prepare my second presentation and probably the two tutorials for SMWCon. I currently have not other testsite at hand.

@kghbln
Copy link
Member

kghbln commented Sep 15, 2016

Sorry for being extremely grumpy this morning. Early this week I had a server upgrade and you wouldn't believe how unstable PHP opcaching can be - pretty disappointing. Well I still suffering from time comsuming aftermaths.

@mwjames
Copy link
Contributor Author

mwjames commented Sep 21, 2016

Sorry for being extremely grumpy this morning.

Don't worry about it. I wanted to draw attention to a PR that has the potential for a regression and I'd like at least a second pair of eyes (some integration tests complained in an earlier iteration) to look at this from a "I worked with it and it doesn't seem to be broken".

Anyway, if I find time (in my weekly support window) then I will just merge it later today and we can observe the results on the sandbox.

@kghbln
Copy link
Member

kghbln commented Sep 21, 2016

Anyway, if I find time (in my weekly support window) then I will just merge it later today and we can observe the results on the sandbox.

I am sorry that I had to let you down on this. :(

- Moves SMW specific language elements from PHP to JSON
- Support for partial fallback
- If a json file (e.g. `zh-hant.json`) contains `isLanguageRedirect` then
only a `fallbackLanguage` is required
- The `CanonicalFallbackLanguage` is `en`
- Adds `LanguageContents`, `LanguageFallbackFinder`, and `LanguageFileContentsReader`
@mwjames
Copy link
Contributor Author

mwjames commented Sep 25, 2016

@kghbln This requires a follow-up on removing all the PHP lang. related scripts from the languages directory. Also, currently those json files are placed under languages/i18n (defined in [0]).

Somehow I want to remove the languages directory from the root, so suggestions on how to move forward would be much appreciated.

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/DefaultSettings.php#L26

@kghbln
Copy link
Member

kghbln commented Oct 5, 2016

@mwjames I have not tested thoroughly yet but sandbox did not change to bellies up mode so far and a fast look though did not show anomalies. Will have a second peep at it soon.

I am not sure if MediaWiki core requires the language information for namespaces, magic words etc. to be in the languages directory. If it does not which I think is the case it may only be a matter of changing
$GLOBALS['smwgExtraneousLanguageFileDir'] = __DIR__ . '/languages/i18n'; to $GLOBALS['smwgExtraneousLanguageFileDir'] = __DIR__ . '/i18n/i18n'; or perhaps $GLOBALS['smwgExtraneousLanguageFileDir'] = __DIR__ . '/i18n/extra'; etc.

twn cannot handle this workflow anyway so ...

@mwjames
Copy link
Contributor Author

mwjames commented Oct 5, 2016

I am not sure if MediaWiki core requires the language information for namespaces, magic words etc. to be in the languages directory.

I think it is a matter of customization:

If it does not which I think is the case it may only be a matter of changing

I would appreciate if you could take the lead on this.

@kghbln
Copy link
Member

kghbln commented Oct 6, 2016

I think it is matter of customization:

Which is good.

I would appreciate if you could take the lead on this.

It looks like not a lot of brain is needed to do this so this Saturday ...

@kghbln
Copy link
Member

kghbln commented Mar 26, 2017

@mwjames It will be nice if you could note something about services

@mwjames
Copy link
Contributor Author

mwjames commented Mar 26, 2017

It will be nice if you could note something about services

You mean [0] or something else?

[0] https://www.semantic-mediawiki.org/wiki/Extraneous_language

@kghbln
Copy link
Member

kghbln commented Mar 26, 2017

You mean [0] or something else?

I meant in connection with $smwgServicesFileDir so this "services" page would be an overview pointing to services like extraerroneous language and other services if currently? present.

@mwjames
Copy link
Contributor Author

mwjames commented Mar 26, 2017

I meant in connection with $smwgServicesFileDir so this "services"

I did a super quick write up in c158446, hope this helps.

@kghbln
Copy link
Member

kghbln commented Mar 26, 2017

I did a super quick write up in c158446, hope this helps.

Cool - all on wiki now!

@mwjames mwjames mentioned this pull request Mar 1, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Alters an existing functionality or behaviour new feature A new, or altered behaviour of an existing functionality that fundamentally impacts behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants