-
Notifications
You must be signed in to change notification settings - Fork 282
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
Localisation for v1.00 #549
Comments
Is there any valid use-case for changing localisation during runtime? |
Jens Georg <[email protected]> writes:
Is there any valid use-case for changing localisation during runtime?
Certainly, you wouldn't want having to recompile exiv2 only because you
changed the language of digikam/GNOME/KDE.
|
There is no need to recompile the application, under a normal desktop, LANGUAGE or the corresponding LC_* are set by the DE, you just need to restart the application to change to the "new" language. i.e.
is usually all you need, together with a helper header that contains the definitions for |
Jens Georg <[email protected]> writes:
There is no need to recompile the application, under a normal desktop, LANGUAGE or the corresponding LC_* are set by the DE, you just need to restart the application to change to the "new" language.
Ah, didn't know that.
But I think you've answered the question yourself: if you want to change
the language and **not** having to restart the application. (Not really
relevant for the exiv2 CLI, but could be useful for a desktop App that
uses libexiv2).
|
Yes. I've got this on the list for test issues for v1.00 #1550. |
I've been having some fun localising my Python interface to libexiv2 (v0.26 to 0.27.5) and it seems here is as good a place as any to report my findings. In most cases I use copies of the .mo files, installed in the Python packages directory. The trick to getting this to work was to call The next problem was when using the system installed .mo files (in Could I suggest that libexiv2's initialisation tries the system default path (on those systems that have one) as well as the one computed from the executable path and chooses whichever actually has the .mo files. |
In #527 and #537 we discussed a lot about localisation stuff just before the 0.27 release.
The only missing point (that was not critical for 0.27) was to provide some API function to change the language at run-time. While this is trivial in other translation systems like the one provided by Qt, it seems a bit more challenging with gettext and libintl. The recommended way according to the gettext documentation is to set the environment variable LANGUAGE to the desired value in the application code.
This piece of code seems to work:
The idea would be to have something like
Exiv2::loadLocalisation()
maybe with a string argument to indicate the language and being able to switch languages at run time.The text was updated successfully, but these errors were encountered: