-
Notifications
You must be signed in to change notification settings - Fork 25
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
Translations keys are normalized but msgid only trimmed #60
Comments
@mussinbenarbia We recently created a new 4.0 pre-release version that made some changes to that, but it hasn't been thoroughly tested:
I believe there are some issues with the |
Thank you for the quick feedback! |
Does this mean that the same will be applied to msgid? For example: gettext(`This is a string.
When extracted it will contain newline characters.`) When normalized with the new step, if I understand correctly, this will be But the msgid, at runtime will still be Will this not cause the lookup for the translated string to fail? |
The idea is that all |
No issue as I haven't tried v4 (Our project still uses the component and v-translate directives so we'll need to remove those before updating) I looked at the code in the v4 branch and I understand the changes now. The code will now call Kind of an unrelated question but I noticed that
Why is there a need to even remove these characters? I'm only asking because the Vue 2 version did not have this normalization step and I'm curious why it was introduced. Also is it intended that it only replaces the first occurrence? |
I definitely don't want to trim msgids anymore. I'll have another look at this. |
Hello, thank you for your hard work on this project.
We recently ran into an issue caused by the string to be translated containing characters like
\n
. When translations are loaded in the createGettext function, there seems to be a step that normalizes each key, hereThis will get rid of
\n
ands+
and will trim the keys. The problem is when we try to actually get the translated string,msgid
is only trimmed, here meaning that the msgid and the corresponding key in thetranslations
object will not match due to one being normalized and the other not.We are planning to apply a patch but would also love to contribute to the project if helpful. Would you recommend applying the normalization to the msgid as well or remove the normalization of the keys?
The text was updated successfully, but these errors were encountered: