Linux msginit电子邮件地址命令行参数?
msginit提示输入电子邮件地址。有没有一种方法可以告诉msginit使用哪个电子邮件地址而不被提示,比如命令行参数Linux msginit电子邮件地址命令行参数?,linux,internationalization,gettext,Linux,Internationalization,Gettext,msginit提示输入电子邮件地址。有没有一种方法可以告诉msginit使用哪个电子邮件地址而不被提示,比如命令行参数 cat >hellogt.cxx <<EOF // hellogt.cxx #include <libintl.h> #include <locale.h> #include <iostream> int main (){ setlocale(LC_ALL, ""); bindtextdomain("hell
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
cat>hellogt.cxx您的问题是由于msginit
使用/usr/lib64/gettext/user-email
提示您发送电子邮件造成的。如果您改为使用--no translator
选项运行msginit
,则应假定它是以非交互方式运行的,并且不会提示您:
msginit --no-translator -l es_MX -o spanish.po -i hellogt.pot
引用JS的话:“选民:请提供评论。”Jon Skeet 5月8日9:25“我把/usr/lib64/gettext/user email
改写为echo
。这也是一个(更激烈的)解决方案。您还可以创建包含从中设置的行的文件~/.muttrc
=you@example.com
。但是如果您想使用:1)you@example.com
,或2)you@localhostname
。