-
-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for nsSeparator and defaultNS #739
Conversation
Hello @aralroca, could I get a review on this one 馃檹 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see everything fine @testerez. Thanks for your contribution 馃槉
I just have one question: is the nsSeparator
required as false
? If the Trans
component has ns
or useTranslation(ns)
then it doesn't look at the separator, then when does the nsSeparator=false
make sense? Thanks.
If
Does that make sense? Did I get your question right? |
I'm still in doubt... Ideally, the key won't ever be parsed to find a namespace in it when:
That is to say, if the parameter I understand that this is the current behavior. So I have trouble understanding what Thanks 馃憦 |
As you can see here, I use in priority the namespace set in the key itself. Which IMO is to be expected. Since the closer to the key is the most specific. I believe this is also how i18next behaves. |
Okay, now I understand. Thanks for the clarification, now I see it perfectly. Thank you! |
@all-contributors please add @testerez for code |
I've put up a pull request to add @testerez! 馃帀 |
@testerez I prereleased this in 1.3.0-canary.4! |
1 similar comment
@testerez I prereleased this in 1.3.0-canary.4! |
Thanks @aralroca! 馃憦 |
nsSeparator
option was required so that I can use natural text as i18n keys.defaultNS
was a bonus 馃檪nsSeparator
false
if you want to use natural text as keys.string
|false
':'
defaultNS
useTranslation
or in the translation key.string
undefined
Also added
ns
prop inTans
component because I needed a way to set the namespace whennsSeparator=false
Note that those options are available in i18next: