-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
i18n proposal #1153
i18n proposal #1153
Conversation
It makes use of https://github.com/fabi1cazenave/webL10n, which loads translations dynamically from inside the browser and applies them to the current html. The route for If there are no translations available, all strings will still be in English (English strings are written directly into the template). L10s are located in |
Poor timeslider.html got left out? :) |
|
No option to change language in settings, that afaik is a requirement |
src/static/js/l10n.js not l18n.js? I know this is right but briefly what's the dif between l10n and l18n? |
This adds ability to change language using settingspad.settings.language needs to be in the language file de.ini Add to line 74 on pad_editor.js
Add to line 210 on pad.html
Because English is the first option people should realize it's a language selector and feel comfortable clicking it to change their window's language option. |
Btw I should of said this is awesome :) 👍 |
OK, so... re: timeslider re: ENOENT, stat 'src/locales/en.ini' -- right. going to rule that out Secondly: Why would you want an extra setting for the UI languagage? C: The filename issue: There's only Lastly: Thanks! :) |
It's probably worth noting, that I tweaked webL10n a bit to suit our needs (e.g. it wouldn't allow for key nesting like |
@marcelklehr RE: B: Because I'm in an Internet cafe in Italy and the browser's language is set to .it but I want .en. We should also save this setting as a cookie so when the user returns they are presented with the correct language. Do you want me to do the timeslider.html? |
Looks good for me. But out of curiosity, can I do translations like "you have {amount} new mails"? Cause this is the point where translation gets really tricky. See here http://www.youtube.com/watch?feature=player_embedded&v=MqqdzJ98q7s . As far as I see we don't have this specific case so far, but it will probably come with extended functionality |
Also I don't see any modifications to the client js. How does it work when I set another text with jquery of if I create a new dom element on the fly? |
@Pita interesting talk! webL10n has some pretty advanced features: https://github.com/fabi1cazenave/webL10n#javascript-api Nonetheless, if you want to dynamically display a certain text / text inside a DOM node with javascript, it probably makes more sense to simply make a template out of it and make it translatable (btw, that's what she speaks of in the talk, too: i18n helps you separate storage and presentation (and selection and transformation, of course)). Are there strings in client.js that need to be translated? @johnyma22 Greetings to you over in Italy. Can't you change your browsers settings? Oh, sorry, if you don't understand Italian that's hard, ok so, I agree, that it might make more sense to allow the user to override the autodetection. So, it'd go like this: |
@johnyma22 if you want to / are able to you can translate timeslider.html, too |
Nearly ready, now. just need to make the word timeslider translatable in timeslider.html |
FYI the only feedback I got from the i18n team at WMF was to use this: |
This is one possible solution for adding support for translations.