Closed gervasiocaj closed 4 years ago
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?
According to 6200b85:
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. To fill the string data (e.g. "12 apples"), the element must adhere to the following notation (see HTML data-* attributes):
<p data-i18n="apple_count" data-amount="18"></p>
{ "apple_count": "{{amount}} apples" }
To refresh the string, alter the data-* attribute accordingly and call
i18n_ready()
.
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!
@TristanBomb how did you generate/drew the images?
@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.
Thanks to @Saphareas, this is now possible :smile:
Great work @gervasiocaj
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!
IMHO it is pretty stable, but the Portuguese translation is not finished yet. Waiting for @TristanBomb word on It.
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! 😄
@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
Here you go: https://gervasiocaj.github.io/8values.github.io/
it's still in en-US :(
@gervasiocaj what's the best way to translate the remaining text in en?
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.
You can revise this German translation: https://github.com/gervasiocaj/8values.github.io/tree/localization/locales/de
I will certainly look into it! Thank you for providing me with the relevant directory.
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.
At the moment we have complete translations to pt
, es
and de
. Thanks everyone!
Hey, that's great @gervasiocaj! What other languages are you aiming to have the test be in at this point?
Shouldn't this PR be merged already so other languages can be added later?
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.
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)? Once I finish Esperanto, I'll start working on Swedish too.
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.js
andideologies.js
to extract the necessary strings and move them to the respective JSON files in thelocales
folder. The binding is still a bit ugly, for example:Resolves #5