Open jliebrand opened 4 years ago
Also, on a similar note - I'm using the fallback for english and not actually using en.json. The reason is that it would otherwise duplicate the amount of data the client needs to pull down.
The options I see are:
What is the recommended route here?
I think the original issue could be accomplished with a codemod that extracts all JSXText
nodes inside of Text
components out to a json file. That would be handy to have as a separate tool.
As for the issues of best practices with fallback text, I have found that after supporting more than 1 language I avoid using fallback text entirely because it makes it easier to end up with untranslated strings in the JSON language files, as well as the reasons you mentioned.
Perhaps this is already possible? But I'd like to have an en.json to give to translators so they can generate translations. Right now, that means copying the fallback text in to en.json but I dont like the fact the Fallback and en.json could get out of sync.
Is there anyway to generate the en.json from the fallback text? Perhaps by using the eslint plugin somehow?