About using \" on string parameters translations

Asked by Henrique P. Machado on 2008-11-09

Some time ago we, members of Ubuntu Brazilian Portuguese Translators, were told to change single quotes to \" (backslash+double quote) on string parameters that come on Launchpad.

Original: invalid ports on profile '%s'
Translated: Portas inválidas no perfil \"%s\"

This procedure was taught to synchronize the translated strings with GNOME, KDE and XFCE translating teams, which adopt this form and have no problems with the output of messages surrounded by \", that's what happened with Launchpad.

I, myself adopted this rule and when the GNOME's language package was compiled I received a message like this on NetworkManager Applet, when I change network interfaces:

Você está agora conectado a \"Eth1\".

Where the correct should be:

Você está agora conectado a "Eth1".

Considering the exposed above, which method should we use? Should we left the parameter like the original ('%s') or surround it with \" (\"%s\")?


l10n, i18n

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Данило Шеган
Last query:
Last reply:

You should not use escaped quotes in Launchpad unless that's exactly what you want. The instructions you got were probably from someone using a less capable PO editor, or maybe even a plain-text editor for editing PO files.

In Launchpad, you never needed to escape double quotes (unless there was a bug with that, but I don't remember it in the last >2 years I've been around).

Henrique P. Machado (zehrique) said : #2

Thanks for you answer, Данило Шеган.

But do you know how to proceed when doing upstreams from the original translated packages from GNOME, for example?

Should we mantain the escaped quotes or change them to single quotes before importing the .po files?


When you are uploading PO files, they should have quotes escaped, simply because that's what PO format requires them to be. In other words, just leave them as they are.

The reason they have to remain escaped in PO files is because messages are delimited with double quotes in them, and PO file parsers need a way to tell the difference. Escaping double quotes is a way to do it.

Henrique P. Machado (zehrique) said : #4

OK, Данило Шеган.

Thanks a lot for the explanations!