views:

27

answers:

2

I use gettext to translate my user interface. I'd like to write symbol % as part of a UI caption in a string, but since it has a special meaning, does not works as expected. How can I escape percent symbols?

A: 

According to the manual a backslash is the escape code, so you should be able to write \% for a literal percent sign.

Rudu
I get `django.po:3645:9: invalid control sequence` error then.
Török Gábor
+1  A: 

Use %% to escape %.

bialix
If I'm right, the same rules apply here as in `sprintf`-like string formatting.
Török Gábor