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?
Asked
Active
Viewed 5,770 times
14

viam0Zah
- 25,949
- 8
- 77
- 100
1 Answers
18
Use %%
to escape %.

bialix
- 20,053
- 8
- 46
- 63
-
If I'm right, the same rules apply here as in `sprintf`-like string formatting. – viam0Zah Sep 17 '10 at 07:25
-
1This doesn't seem to be the case with python though http://stackoverflow.com/questions/41730770/translating-with-gettext-and-jinja2-and-pyramid – boatcoder Jan 19 '17 at 14:48