代码之家  ›  专栏  ›  技术社区  ›  CW Holeman II

msginit email-address命令行参数?

  •  4
  • CW Holeman II  · 技术社区  · 16 年前

    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
    
    1 回复  |  直到 15 年前
        1
  •  8
  •   DaveR    16 年前

    你的问题是由于 msginit 使用 /usr/lib64/gettext/user-email 提示输入您的电子邮件。如果你改为跑步 斯金尼 --no-translator 选项它应该假定它是以非交互方式运行的,并且不会提示您:

    msginit --no-translator -l es_MX -o spanish.po -i hellogt.pot