Hi all,

I'm working on an application where we need to add internationalization.
The app is written in C++ and the first translation we're doing is for
Spanish.

In the main() function of my app I've got:

    printf ("setlocale : %s\n", setlocale (LC_ALL, "")) ;
    printf ("bindtextdomain (%s, %s) : %s\n", PACKAGE, PACKAGE_LOCALE_DIR,
             bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR)) ;
    printf ("textdomain (%s) : %s\n", PACKAGE, textdomain (PACKAGE)) ;

The printfs are mainly for debugging so that I can check that
configuration variables like PACKAGE and PACKAGE_LOCALE_DIR are
correct.

To test my app, I'm doing:

    export LC_ALL=es_ES
    /usr/bin/package

but all I get is the original English text, not the Spanish translation.

The Spanish translation file gets compiled and installed as

    /usr/share/locale/es_ES/LC_MESSAGES/package.mo

For PACKAGE_LOCALE_DIR I've tried "/usr/share" and "/usr/share/locale"
and neither seems to work.

I've tried stracing the app (which is linked to libcups) and I can
see the app loading the Spanish cups translation in the strace output
but for my app its looking for

    /usr/share/locale/en_AU/LC_MESSAGES/package.mo

(which doesn't exist) when its supposed to be looking for:

    /usr/share/locale/es_ES/LC_MESSAGES/package.mo

which does exist.

I've also tried copying my Spanish translation to where its looking
for the en_AU one and my app happily reads and uses the Spanish
in the en_AU directory. That shows that the underlying gettext
mechanism kinda works, but just doesn't like Spanish.

Anyone have any ideas whats happening here? Its an Ubuntu Dapper
system if that makes any difference.

Thanks in advance,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
-- Eric S. Raymond
_______________________________________________
coders mailing list
coders@slug.org.au
http://lists.slug.org.au/listinfo/coders

Reply via email to