Msginit email address command line argument?

msginit is asking for an email address. Is there a way to tell msginit which email address to use without asking for it, such as a command line argument?

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
+3
source share
1 answer

Your problem is with msginithelp /usr/lib64/gettext/user-emailto request your letter. If instead you use msginitwith an option --no-translator, it should assume that it is running non-interactively and not prompting you:

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

Source: https://habr.com/ru/post/1710918/


All Articles