Pregunta

msginit solicita una dirección de correo electrónico. ¿Hay alguna manera de decirle a msginit qué dirección de correo electrónico usar sin que se le solicite, como un argumento de línea de comando?

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
¿Fue útil?

Solución

Su problema se debe a msginit usando / usr / lib64 / gettext / user-email para solicitar su correo electrónico. Si en su lugar ejecuta msginit con la opción --no-traductor , debería asumir que se está ejecutando de forma no interactiva y no le preguntará:

msginit --no-translator -l es_MX -o spanish.po -i hellogt.pot
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top