0

Currently my worflow when I change things in the original file is this:

  • make gettext to update *.pot files
  • sphinx-intl update -p build/gettext -l fr to create *.po files out of it

However, this always results in the following behavior: Some longer messages in the *.po files are not correctly updated or to be more correct they are updated although they didn't change. sphinx-intl update will insert quotes "" in front of every paragraph that spans over multiple lines. Here's how that looks:

Before: (in some french *.po file):

msgid "Some longer paragraph text that spans multiple lines. This text was just"
"lying here and matched a sequence within the file before gettext inserted"
"unnecessary quotes on top."
msgstr "Un texte de paragraphe plus long qui s'étend sur plusieurs lignes. Ce texte se trouvait juste ici et correspondait à une séquence dans le fichier avant que gettext n'insère des guillemets inutiles par-dessus."

After:

msgid ""
"Some longer paragraph text that spans multiple lines. This text was just"
"lying here and matched a sequence within the file before gettext inserted"
"unnecessary quotes on top."
msgstr ""
"Un texte de paragraphe plus long qui s'étend sur plusieurs lignes "
"Ce texte se trouvait juste ici et correspondait à une séquence dans le "
"fichier avant que gettext n'insère des guillemets inutiles par-dessus."

This is extremely annoying as it will not match anymore with the text it is supposed to! Only when I remove the leading "" the texts will match again. I wondered if this happens because I tend write my translated msgstr as one line without intermitted quotes (what are they good for anyway?). After sphinx-intl update they are enclosed in quotes...

What is going on and how can I prevent this?

mzjn
  • 48,958
  • 13
  • 128
  • 248
glades
  • 3,778
  • 1
  • 12
  • 34

1 Answers1

0

As explained in the accepted answer to a similar question here, this is normal gettext behaviour. The empty string at the beginning marks a multiline entry. So in theory this should not mess up alignment. If your workflow allows it, maybe it could be a solution to use this standard format also when building the *.po-files in the first place, so that the update won't reformat unchanged lines.

xxm
  • 3
  • 2