You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just starting to use this library and wondering for like the default language or similar ones do you need to provide the translation if one is not needed?
For example, say your translation is l("my message") then you would normally have to do something like this:
{
"en-US": {
"my message": "my message",
"color": "color"
},
"en-GB": {
"my message": "my message",
"color": "colour"
},
}
Whereas, if not already an acceptable way to do it, something like this would save a lot of repeated data and code bloat:
{
"en-US": {
},
"en-GB": {
"color": "colour"
},
}
So basically if it didn't find the translation then the text would remain the same; in this instance we would be using en-US as our default (writing) language and hence no translations are needed and en-GB is very similar so the file should only need to contain the translations that actually need to be translated.
Is this an acceptable way of doing it or does all translations have to be put in the files whether they need translating or not?
The text was updated successfully, but these errors were encountered:
Put equivalent translations under the same root language tag. You would make an entry for "en", and en-us/gb will automatically get translations from "en"
Can you give an example? Are you saying you can't make en-US.json and en-GB.json files and have to make a en.json file with all the locales in it?
However, I'm still unsure if this means you can leave out data that doesn't need translating as it's either the default language or is the same in en-GB as it is in the default language.
Just starting to use this library and wondering for like the default language or similar ones do you need to provide the translation if one is not needed?
For example, say your translation is
l("my message")
then you would normally have to do something like this:Whereas, if not already an acceptable way to do it, something like this would save a lot of repeated data and code bloat:
So basically if it didn't find the translation then the text would remain the same; in this instance we would be using
en-US
as our default (writing) language and hence no translations are needed anden-GB
is very similar so the file should only need to contain the translations that actually need to be translated.Is this an acceptable way of doing it or does all translations have to be put in the files whether they need translating or not?
The text was updated successfully, but these errors were encountered: