Uh oh!
There was an error while loading. Please reload this page.
Localization - #14
Conversation
Uses the i18next framework. Resolves8values#5
Progress of adaptation: - [x] Questions - [x] Quiz - [ ] Index - [ ] Instructions - [ ] Results
Progress of adaptation: - [x] Questions - [x] Quiz - [x] Index - [x] Instructions - [ ] Results
Progress of adaptation: - [x] Questions - [x] Quiz - [x] Index - [x] Instructions - [x] Results
Jameskmonger
commented
Apr 27, 2017
There seems to be a lot of code duplication between the different pages. Would it be possible to get this put into its own script? |
In order to load the namespaces and do the string binding, just load the i18n.js file on the HTML and call the i18n_load_ns with the namespaces notation found [here](http://i18next.com/translate/namespace/). To fill the string data (e.g. "12 apples), the element must adhere to the following notation (see HTML data-* attributes): ```html <p data-i18n="apple_count" data-amount="18"></p> ``` ```json { "apple_count": "{{amount}} apples" } ``` To refresh the string, alter the data-* attribute accordingly and call `i18n_ready()`.
gervasiocaj
commented
Apr 28, 2017
According to 6200b85:
<pdata-i18n="apple_count" data-amount="18"></p>{ "apple_count": "{{amount}} apples" }
|
TristanBomb
commented
Apr 29, 2017
I'd like to thank you for all the work you've put into this! Unfortunately, I'm not really familiar with the framework you're using. Just a few things:
Thanks! |
12aa91b to
6200b85Compare…lation Corrections according to the ortographic agreement and changes on the master branch
gervasiocaj
commented
May 5, 2017
@TristanBomb how did you generate/drew the images? |
To localize images, add the file-[lng].svg to the value_images/ diretory and add an entry on the corresponding translation.json: "file.svg": "file-[lng].svg"
This reverts commit 144b16c.
elifoster
commented
May 6, 2017
@TristanBomb The best way to handle internationalized images is to render the text using CSS instead of actually putting in the image. I took a look at some of the svg files that are in this project and it should be pretty simple. |
dalssoft
commented
Jun 22, 2017
any update? this seems to be a very important upgrade which would be make 8values available to a much broader audience. btw, congrats @TristanBomb, @gervasiocaj et al for the hard work! |
gervasiocaj
commented
Jun 23, 2017
IMHO it is pretty stable, but the Portuguese translation is not finished yet. Waiting for @TristanBomb word on It. |
JoshuaKimsey
commented
Jun 23, 2017
I don't know! I absolutely agree that translations would be of a huge help to make 8Values even more wide spread! However, I too have had a pull request waiting for a while now too with no word from @TristanBomb. Hopefully, both @gervasiocaj and I will here soon. P.S: Congrats to @gervasiocaj for the outstanding work he did to get the translations working! 😄 |
dalssoft
commented
Jun 26, 2017
@gervasiocaj do you have a URL running for this PR on pt-br? this would be useful as is and wouldn't be necessary to wait for @TristanBomb decision |
gervasiocaj
commented
Jun 26, 2017
Here you go: https://gervasiocaj.github.io/8values.github.io/ |
dalssoft
commented
Jun 26, 2017
it's still in en-US :( |
gervasiocaj
commented
Jun 27, 2017
dalssoft
commented
Jun 27, 2017
@gervasiocaj what's the best way to translate the remaining text in en? |
laurenzfg
commented
Jul 27, 2017
Hi @gervasiocaj how is the progress of your l18n efforts? If the technical stuff is done and you finalized the syntax of the .json files, I'd be more than happy to start working on a German translation. |
gervasiocaj
commented
Jul 27, 2017
You can revise this German translation: https://github.com/gervasiocaj/8values.github.io/tree/localization/locales/de |
laurenzfg
commented
Jul 30, 2017
I will certainly look into it! Thank you for providing me with the relevant directory. |
Translation of the remaining questions
Spanish translation, thanks to @locoluis
sentfanwyaerda
commented
Oct 9, 2017
Hi, personally I dislike the javascript approach of making it i18n. I made a simple PHP PATCH: https://github.com/sentfanwyaerda/8waarden.nl (including the dutch 'nl' translation) |
@sentfanwyaerda While something like that might work better/ be more efficient than using just pure JavaScript, here's one issue I see. That would be the first introduction of PHP into this project, which would require making sure that PHP is setup properly on the hosting server. As it is right now, the user can run the html files locally on their computer and the program will function perfectly normal. Introducing PHP adds an extra amount of work needed to get an environment setup for users to use the code, either on a server or locally on their own computer. Maybe @TristanBomb and the other contributors are ok with this, I honestly don't know! In all honesty, using PHP would probably be easier code wise. The issues arise from the users end with having to deal with PHP. Ultimately, I do believe that sticking with pure JS is a better solution for the user, even if it means more work on our end. |
gervasiocaj
commented
Oct 18, 2017
At the moment we have complete translations to |
JoshuaKimsey
commented
Oct 18, 2017
Hey, that's great @gervasiocaj! What other languages are you aiming to have the test be in at this point? |
renanpvaz
commented
Oct 19, 2017
Shouldn't this PR be merged already so other languages can be added later? |
gervasiocaj
commented
Oct 25, 2017
I am about to merge the commit cd97fa1, which introduces some changes in the text. Looking for suggestions and solutions to track the progress of these translations, since they might be outdated for a while until the contributors have some free time. |
snorepion
commented
Oct 25, 2017
I've started working on an Esperanto translation. Are the only files that I need to change the JSON files in localization branch/locales/eo (copied from locales/en)? |
Genora51
commented
Sep 22, 2020
I'm closing this PR and moving the conversation over to #123 to include the newest updates to 8values; it would be great to revive the thread over on that PR and get it merged soon! |
This feature allows localization to any language, with incomplete translation to
pt. It uses the i18next framework, and modifies thequestions.jsandideologies.jsto extract the necessary strings and move them to the respective JSON files in thelocalesfolder. The binding is still a bit ugly, for example:{ "results": "Résultats", "results_desc": "Lorem ipsum dolor sit amet." }Resolves#5