Closed mossroy closed 1 year ago
Maybe contact http://babelzilla.org/ ?
As the links above might be outdated, I found https://phraseapp.com/blog/posts/step-step-guide-javascript-localization/ that compares a few libraries (including jQuery.I18n, maintained by wikimedia)
Thanks @mossroy . Very interesting. On a quick reading, I think jQuery.l18n
would make a lot of sense for us, since it's maintained by Wikimedia, so we can be sure it'll be around as long as Wikipedia is around ;-) ... More importantly, it doesn't look overly complicated.
I particularly like this syntax:
<li data-i18n="message-key">Fallback text</li>
So we could keep a readable HTML file (with the fallback text containing the current English-language strings), and provide variable names for the translation strings, which will be read from a fr.json
, es.json
, de.json
file depending on the language.
So, rather than offering different apps, we could give the user the chance to choose the app language at the outset (or in the options). Alternatively, different languages can be set as the default according to the part of the world being targeted. I imagine that initially we're talking about two or three languages other than English. But this seems perfectly scalable (of course, given the number of languages Wikipedia has).
Just a cross-reference to #306 (RTL Support), as we should take the opportunity to ensure that any refactoring takes RTL into account.
Kiwix translators works on translatewiki.net. What I propose is that the software is setup to deal with localisation files. Then we could have a look together how to synchronize this with translatewiki.
I just had a quick look at the current offerings, and it seems jQuery.l18n has fallen into disrepair, replaced by https://github.com/wikimedia/banana-i18n . This is in line with the general move away from dependency on jQuery, now that babel does the job of providing needed polyfills. Banana-i18n has active and recent updates, and is a more modern version of jQuery.i18n.
We are in general not really good with UI localization at Kiwix. This is bad. If the UI is translated with banana I could organize sync with Translatewiki. I would suggest to rethink the priority of this ticket.
As a linguist, I completely agree with you! I've changed the milestone.
Probably based on l10n.js library : https://github.com/fabi1cazenave/webL10n I should also read https://hacks.mozilla.org/2013/08/localizing-firefox-os-apps/