-
Notifications
You must be signed in to change notification settings - Fork 278
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cound you export this function or when translation has error get the original value #289
Comments
If you set the Does that solve your problem? |
Sorry, I don't want to implement the |
What are you going to do with the "foo {{ bar }} " template once you have it? |
frontend render the template like this: so I want to use the same set of configurations. |
I think that if can't parse functions should be returned the original result more reasonable. of course, the error message is also returned, in this way, I can handle the translated strings according to my own ideas. |
I have a similar problem and I've submitted a PR #316 which makes it possible to just disable template processing completely. I think it would make the library much more flexible in many real-world scenarios. |
With 2.4.0 there is now a way to disable template parsing. Check out the release notes for more info. |
code:
go-i18n/v2/i18n/localizer.go
Line 181 in 639caa7
repeat issue:
#275 (comment)
language.yaml:
when I want to translate
base.foo
, it will be get error tips: function "bar" not defined.I wish the key
base.foo
is exists, I'll get the string valuefoo {{ bar }}
for translate result,and the err tip. if the key is not exists, I'll get the err and empty result.The text was updated successfully, but these errors were encountered: