kiwix / kiwix-js

Fully portable & lightweight ZIM reader in Javascript
https://www.kiwix.org/
GNU General Public License v3.0
310 stars 136 forks source link

Implement translations of the UI #13

Closed mossroy closed 1 year ago

mossroy commented 11 years ago

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/

mossroy commented 10 years ago

Maybe contact http://babelzilla.org/ ?

mossroy commented 10 years ago

I should start with https://developer.mozilla.org/en-US/Apps/Build/Localization/App_Localization_with_Transifex

mossroy commented 6 years ago

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)

Jaifroid commented 6 years ago

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

Jaifroid commented 6 years ago

Just a cross-reference to #306 (RTL Support), as we should take the opportunity to ensure that any refactoring takes RTL into account.

kelson42 commented 6 years ago

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.

Jaifroid commented 4 years ago

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.

kelson42 commented 1 year ago

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.

Jaifroid commented 1 year ago

As a linguist, I completely agree with you! I've changed the milestone.