msginit email address argument de ligne de commande?
-
06-07-2019 - |
Question
msginit demande une adresse électronique. Existe-t-il un moyen d'indiquer à msginit quelle adresse électronique utiliser sans y être invité, par exemple un argument de ligne de commande?
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
La solution
Votre problème est dû au fait que msginit
a utilisé / usr / lib64 / gettext / user-email
pour demander votre courrier électronique. Si vous exécutez plutôt msginit
avec l'option - no-translator
, il devrait être supposé qu'il est exécuté de manière non interactive et ne pas vous demander:
msginit --no-translator -l es_MX -o spanish.po -i hellogt.pot
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow