When I translate some stuff, sometimes there are strings that are put in comments and stay after everything else. What are those comments for?
For example:
#~ msgid ""
#~ "You tried to register but your email is already known.\n"
#~ "To try again to login, click on the following link:\n"
#~ "{}{}"
#~ msgstr ""
#~ "Vous avez essayé de vous enregistrer, mais votre email est déjà connu."
#~ "Pour vous connecter, cliquez sur le lien suivant :\n"
#~ "{}{}"
What is the ~
for?
Sometime there's a pipe like this:
#~| msgid "Show your activity"
#~ msgid "your activities"
#~ msgstr "Montrer mon activité"
What is the |
for?
#~
comments are obsolete strings. When a string has translation but does not appear in the current template (.pot
), the msgmerge
tool will comment it out with #~
, but leave it in.
If the string appears again in future, it will uncomment the translation again, so you won't have to retranslate it. It will also use thus commented entries as source for suggestions via fuzzy matching.
The #~|
is a result of commenting out a #|
comment. A #|
comment is the original text when creating a suggestion via fuzzy matching. For example if the catalogue has
msgid "Open"
msgstr "Otevři"
and the template has
msgid "Open!"
msgstr ""
then msgmerge
will create:
#,fuzzy
#| msgid "Open"
msgid "Open!"
msgstr "Otevři"
The po editors like poedit, pootle or weblate should remove the #|
comment when the string is fixed and fuzzy flag removed. But if somebody edits the .po
in a text editor, they may erroneously leave it in.