-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIB-47: I18n of error messages #27
base: master
Are you sure you want to change the base?
Conversation
The discid example needs a setlocale (to inherit the locale from the environment) and our code needs to call libintl.h and dgettext(PACKAGE, String) basically.
This doesn't add much to the source repository, but a whole lot to the distribution.
libdiscid.pot is created automatically with make de.po was created with msginit -i po/libdiscid.pot (with german locale set)
mo compilation and installation works fine in Cmake, except that I have to give the languages manually. Implementing ENABLE_NLS also wasn't so bad. Didn't test much though.
We can't actually disable NLS with a parameter yet, but we check for libintl.h and enable NLS if found. Finding gettext and libintl are different things. libintl is for the actual translation messages support, gettext is to create the .mo, which is included in the distribution anyways.
This should also check for libintl that isn't included in libc on other platforms, but this is tested on MinGW/Windows XP. automake possibly does work fine, but takes ages..
They are re-created with autopoint, not sure what went wrong that I had to add them to the repository before.
0.18.2 is current, but like half of the systems I tested still had the older version.
On FreeBSD libintl is external so it has to be linked seperately.
lib and include are in /usr/local/lib in my installation. I don't remember why and when then ended up there and if I built that myself.
We now have support for disabling NLS. This is important, since otherwise the libintl and iconv dlls need to be available! Also NLS possibly stands for Native Language Support. It doesn't say so in the overly long ABOUT-NLS..
In general this compiles on every platform now. I only had a real problem on Solaris. Autotools works, but cmake doesn't compile for me without disabling NLS manually NLS can be disabled in autotools and Cmake. Libdiscid compiles just like before then. I am also not sure how it works with the locale directory. The directory is set at compile time, so this can't work with binary distributions (unless they are installed in the same location?). Possibly this can be fixed for/with Picard? Still only autotools includes a target to update the pot/po files. |
Currently "gettext" is not installed on the build server so "autopoint" is not found there. |
autopoint installed on jenkins jenkins: retest this please. EDIT: |
retest this please |
http://tickets.musicbrainz.org/browse/LIB-47
This is work in progress. A bit of testing code was included so a string is printed on discid_new() invocation. That string is translated using gettext. (needs more work).
Building itself works fine on Linux with cmake and autotools.
Autotools already includes near full gettext support. implementing --disable-nls and a fallback when libintl.h is not found is still missing. .pot/.po are updated with "make update-po" in po/ or with make dist.
CMake builds don't have any support for .mo generation/installation, but the binary is able to use these (when installed through other means). Shouldn't be too difficult to create targets manually though.
Not testing on other platforms was done yet.