vue3-gettext icon indicating copy to clipboard operation
vue3-gettext copied to clipboard

Translations keys are normalized but msgid only trimmed

Open mussinbenarbia opened this issue 6 months ago • 6 comments

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, here

This will get rid of \n and s+ 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 the translations 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?

mussinbenarbia avatar Aug 20 '24 14:08 mussinbenarbia