【发布时间】:2014-10-04 09:32:48
【问题描述】:
POedit/xgettext:创建特定于上下文的 .po 文件/字符串导入
使用 POedit 我想处理 2 个单独的语言文件,因此翻译人员只需编辑一个特定于客户的语言文件,而系统特定的语言文件保持不变。
这是我的 xgettext 调用:
xgettext --force-po -o %o %C %F -k --keyword=_e:1,2c
但是,这个How to get (translatable) strings from specific domain with POEdit 获取所有可翻译的字符串。
现在,我想创建一个 .po 文件,其中仅包含与特定上下文匹配的字符串。这是我的 PHP:
# CLIENT-specific: should BE imported into .po file
__('Photo challenge', 'imlang_ext');
# SYSTEM-specific: should NOT be imported into .po file
__('An error has occured.', 'imlang_msg');
如何仅导入与 imlang_ext 上下文匹配的值?
【问题讨论】: