jshmrtn / vue3-gettext

Translate Vue 3 applications with gettext.
https://jshmrtn.github.io/vue3-gettext/
MIT License
66 stars 23 forks source link

Translation seems fails with & symbol #44

Open Wewill opened 1 year ago

Wewill commented 1 year ago

In a vue3 project, this code fails translating :

<translate>Use 8 or more characters with a mix of letters, numbers & symbols.</translate>

Best !

lzurbriggen commented 1 year ago

Does the same message string work using {{ $gettext("myMessage") }}? <translate> is deprecated and will be removed soon.

Wewill commented 1 year ago

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.") }}
TripleM-AoC commented 5 months ago

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

lzurbriggen commented 5 months ago

@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.