escaping - 用 gettext 打印 "

标签 escaping gettext

我想输出这个字符串的翻译
By clicking on "Post"
使用 gettext,如何转义引号?我应该试试\ " ?

msgid "By clicking on"
msgstr ""

最佳答案

是的,您需要使用反斜杠 (\") 转义双引号。

gettext manual说如下:

The two strings, untranslated and translated, are quoted in various ways in the PO file, using " delimiters and \ escapes

...

Each of untranslated-string and translated-string respects the C syntax for a character string, including the surrounding quotes and embedded backslashed escape sequences.

关于escaping - 用 gettext 打印 ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10218631/

相关文章:

c# - String.StartsWith 在下一个字符是素数符号时不起作用 (char)697

c# - 如何正确地将字符串传递给ffmpeg?

PHP:如何在 Poedit 中使用换行符

php - Gettext 和 POedit - 验证文件时出错 '%'

python - 国际化django模板中的多个复数变量

Android EditText 值未显示,getText 返回一个值

Java 运行时 exec() 无法正确转义字符

html - 应该 &'s be escaped in onclick="...”?

python - 将 JSON 转换为 XML 时避免字符转义

java - Selenium java如何从第二个引号中的元素获取文本 ""