LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Localization in linux (https://www.linuxquestions.org/questions/linux-newbie-8/localization-in-linux-693249/)

pramod101 12-27-2008 08:26 AM

Localization in linux
 
Hello


I want to know how localization is done in linux ie if one changes the locale to some other one say german and tries to view labels or captions will it be observed in german also does the localization apply to user defined texts



thanks
Pramod

Su-Shee 12-27-2008 01:15 PM

No.

If you write your own stuff, you'll have to put it into the localization loading mechanism recognized by the programming language/library you use or check the appropriate environment variables for yourself. If you just like to add some messages to an existing application, there's usally a file to put your new stuff into, because the loading mechanism is already done by someone.

The Linux libc has some -predefined mechanisms to act upon the LANG & LC_MESSAGES settings (LC_CYTPE, LC_ALL, LC_MONEY, LC_YOUNAMEIT...), but in other programming languages you might to it by yourself.

Here's a detailed example how to do it in Gtk:

http://bo.majewski.name/bluear/gnu/GTK/i18n/

But it really depends on wether your application is pure C with localization via Linux' libc or a Gtk app or some KDE stuff or written in Java...

And not every application running under Linux is necessarily localized.

pramod101 12-28-2008 12:45 AM

Hi Thanks


Actually My app is a java app where i need to translate strings at runtime depending upon the locale given . I wanted to know if there is some OS level API's which can translate the messages with built in localization support . Or do i need to use some other 3rd party API'c to do this .

My basic doubt is can i use the Built in linux Localization support to get my work done

I cannot use the resource bundle mechanism of java as the strings are supplied at runtime by the user



Thanks
Pramod


All times are GMT -5. The time now is 11:30 PM.