为什么gettext用_()其中的值是变量,变量赋值了字符串,使用pygettext生成.pot文件的时候字符串没写进去,报错:*** mark_string.py:14: Seen unexpected token "i"?
from gettext import gettext as _
def main():
i = "hello"
print(type(_(i)))
if __name__ == "__main__":
main()
报错:*** mark_string.py:14: Seen unexpected token "i"
以下代码可以把需要翻译的文本正常写入到.pot文件,上面的代码不行
from gettext import gettext as _
def main():
print(type(_("hello")))
if __name__ == "__main__":
main()