vue3-gettext
vue3-gettext copied to clipboard
Translation seems fails with & symbol
In a vue3 project, this code fails translating :
<translate>Use 8 or more characters with a mix of letters, numbers & symbols.</translate>
Best !
Does the same message string work using {{ $gettext("myMessage") }}
? <translate>
is deprecated and will be removed soon.
Hi @lzurbriggen,
It fails too with $gettext(), exact message is :
msgid "Use 8 or more characters with a mix of letters, numbers & symbols."
( two spaces after & = &spacespace )
( working well with = &space )
<translate>Use 8 or more characters with a mix of letters, numbers & symbols.</translate>
{{ $gettext("Use 8 or more characters with a mix of letters, numbers & symbols.") }}
Hi,
I am experiencing the same issue with newlines (\n) in keys. The culprit seems to be the fact that translation files have their keys normalised, while the msgid is not normalised when trying to get the translation.
I'm unsure if this is intended or not, but it is definitely creating an issue for us too
@TripleM-AoC thanks for the additional info.
we're planning to finally do the bigger update we wanted to do a long time ago (https://github.com/jshmrtn/vue3-gettext/pull/41) in the coming weeks and will try to fix this as well.
I implemented a new extraction parser and tested it with {{ $gettext("Use 8 or more characters with a mix of letters, numbers & symbols.") }}
, it seems to parse correctly. I wrote a test that extracts a unicode sample so it seems to have no issues with most characters.
Make sure to check the breaking changes, e.g. <translate>
has finally been removed: v4.0.0-alpha.4 and v4.0.0-alpha.2
I am experiencing the same issue with newlines (\n) in keys. The culprit seems to be the fact that translation files have their keys normalised, while the msgid is not normalised when trying to get the translation.
I'm not exactly sure what caused OPs issue, but I believe I fixed this particular issue in v4.0.0-alpha.4.
I'm not exactly sure what caused OPs issue, but I believe I fixed this particular issue in v4.0.0-alpha.4.
Thanks! I will give the alpha version a test drive when I get a chance :)