i18-n | Internationalization elements build with polymer
kandi X-RAY | i18-n Summary
kandi X-RAY | i18-n Summary
This magic duo helps with translating strings. It's my try to enhance Eric Bidelman's awesome i18n-msg element.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of i18-n
i18-n Key Features
i18-n Examples and Code Snippets
Community Discussions
Trending Discussions on i18-n
QUESTION
I'm using i18-next
library to switch languages in my app. So it's done without reloading a page. The language switch is done via:
ANSWER
Answered 2017-Nov-04 at 13:28well, I came to this solution. Maybe it will be helpful for some people. If there are more better ways to achieve it, please post your answer.
But one problem left. Once I'm in www.website.com/xx/someURL
and press language switch the xx
part of the URL should be swapped with new param but someURL
should remain. Anybody knows how to make it?
index.js:
QUESTION
Yes, this is the exact opposite question than: Why do people use plain english as translation placeholders?
I used the standard gettext way for translation all the time but now that I'm doing frontend I realized that not only most libraries are using keys/placeholders but this is sometimes recommended (see i18next) over using plain English.
I haven't work much with placeholders but I find it difficult because:
- you have to invent unique placeholder names all the time, you need conventions
- maybe you want to reuse the same placeholder name so you have to find an existing one that matches what you are translating
- is it better to have all translations scoped per module or to have shared translations? I'm not sure
According to the doc of i18-next, it is recommended to use placeholders because:
While this works and might reduce files to load it makes the management of translations a lot harder as you will need to update changes to fallback values in code and json files.
- I wouldn't use plain English to reduce the number of files to be loaded. This seems obviously wrong.
- JSON? What's wrong with PO/POT? There are so many tools for translators already.
- If a wording needs to be changed, all translations should be reviewed, so I guess it's kinda "good" that it would break the old translations, right?
- It seems easier to me that devs can focus on getting the English text right and translators getting the other languages right.
- I really don't see how it's a lot harder to use plain English. A real life example would be great.
My guess is that there are pros and cons to both methods but I don't see the pros with placeholders so I would like to understand.
...ANSWER
Answered 2018-Nov-10 at 06:59I think it only comes down to the previous assumption that a fixed placeholder id means you can later finesse the English translation string without breaking the placeholder's connection to completed foreign translations.
However, I am of the same opinion to you - plain English is better, and if the English changes then certainly the foreign translations also need to be checked whether they too need updating.
Conventions can be wrong.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install i18-n
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page