Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

msginit email address command line argument?

msginit prompts for an email address. Is there a way to tell msginit what email address to use without being prompted 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
like image 477
CW Holeman II Avatar asked Jun 20 '09 16:06

CW Holeman II


1 Answers

Your problem is due to msginit using /usr/lib64/gettext/user-email to prompt for your email. If you instead run msginit with the --no-translator option it should assume it's being run non-interactively and not prompt you:

msginit --no-translator -l es_MX -o spanish.po -i hellogt.pot
like image 116
DaveR Avatar answered Sep 19 '22 06:09

DaveR