Replies: 2 comments
-
could be done using a postProcessor -> eg. https://github.com/i18next/i18next-intervalPlural-postProcessor/blob/master/src/index.js#L62 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sounds promising... So I can implement my own post processor... will give it a try... thank you |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I won't bore with the details, but I need to be able to control the logic for "missing keys" in i18next react. All of the keys in my application currently end with .pv (there is a good explanation for this, but ultimately doesn't add to the conversation!), e.g. 'mypage.mybutton.pv', 'mypage.mytitle.pv'
With a migration that it happening, this .pv is being removed from 80 percent of the keys, but still remains for the other 20 percent - slowly being removed in the remaining 20 percent as well! Rather than iterating through the thousands of i18n keys and figuring out which ones have had he .pv removed and which haven't I want to globally remove ALL the .pv suffixes from our UI and then implement some error handling which basically says...
When looking up the translation for a key if the key isn't found, fall back to looking up the key with a .pv suffix...
Basically if my code looks up a translation for key 'myScreen.title' and doesn't find the key, I want it to fallback and lookup 'myScreen.title.pv'. Obviously this is temporary logic, and we will eventually remove all .pv suffixes from our i18n key file and then the logic can be removed.
Any suggestions?
Current React init code:
Current react i18n translation code:
Beta Was this translation helpful? Give feedback.
All reactions