打印“与gettext [英] Printing " with gettext
问题描述
我想输出这个字符串的翻译
I want to output the translation of this string
点击发布
使用gettext,如何避免引号?我应该尝试 \
?
Using gettext, how do I escape the quotation mark? Should I try \ "
?
msgid "By clicking on"
msgstr ""
推荐答案
gettext手册只表示以下内容,这并不真正描述允许的转义序列。
The gettext manual only says the following, which does not really describe the allowed escape sequences.
两个字符串,未翻译和翻译,以各种方式引用PO文件,使用分隔符和\转义,但翻译者并不需要注意精确的引用格式,因为PO模式完全负责引用她的引用。
The two strings, untranslated and translated, are quoted in various ways in the PO file, using " delimiters and \ escapes, but the translator does not really have to pay attention to the precise quoting format, as PO mode fully takes care of quoting for her.
如有疑问,请查看 gettexts自己的po解析器的源代码,反斜杠之后识别的转义序列似乎为:
When in doubt, just look at the source code for gettexts own po parser, the recognized escape sequences following a backslash seem to be:
- n,t,b,r,f,v,a
- 和\
- 八进制数
- 以'x'开头的十六进制数字
- n, t, b, r, f, v, a
- " and \
- Octal numbers
- Hexadecimal numbers starting with 'x'
这篇关于打印“与gettext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!