msginit电子邮件地址命令行参数?
-
06-07-2019 - |
题
msginit提示输入电子邮件地址。有没有办法告诉msginit使用哪个电子邮件地址而不提示它,例如命令行参数?
cat >hellogt.cxx <<EOF
// hellogt.cxx
#include <libintl.h>
#include <locale.h>
#include <iostream>
int main (){
setlocale(LC_ALL, "");
bindtextdomain("hellogt", "./");
textdomain( "hellogt" );
std::cout << gettext("hello, world!") << std::endl;
}
EOF
g++ -ohellogt hellogt.cxx
xgettext -d hellogt -o hellogt.pot hellogt.cxx
msginit -l es_MX -o spanish.po -i hellogt.pot
解决方案
您的问题是由于使用 / usr / lib64 / gettext / user-email
msginit
来提示您的电子邮件。如果您使用 - no-translator
选项运行 msginit
,它应该假设它是以非交互方式运行而不是提示您:
msginit --no-translator -l es_MX -o spanish.po -i hellogt.pot
不隶属于 StackOverflow