Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
02locales question
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
SAngeli
l33t
l33t


Joined: 16 Apr 2004
Posts: 904
Location: Italy

PostPosted: Fri Jun 03, 2005 4:58 pm    Post subject: 02locales question Reply with quote

Hi,

I know that localization could become an issue because might not be so clear. Therefore, I decided to learn it for as much as I can but still have some doubts. So, I wish to ask for help with the goal to finalize all my questions. And, at the end I will write a summary (few lines) of how to properly do it.


Here is my scenario
:
Gentoo PC with:
- Italian keyboard;
- English_US interface;
- Italian custom localizations, like: (NUMERIC, TIME, MONETARY, PAPER, ADDRESS, TELEPHONE and MEASUREMENT)
- I am implementing UTF-8

In order to succesfully apply localization you have to work on these files: /etc/locales.build, /etc/env.d/02locale, /etc/package.use, /etc/X11/xorg.config, /etc/make.conf and kernel settings.

1. /etc/locales.build
This is where you put all your preferred locales among those offered by your system.

2. /etc/env.d/02locale
This is where you make global locales declarations, with specific settings.

3. /etc/portage/package.use
This allows gibc to lean and compile those locales

4. /etc/X11/xorg.config
This allows for keyboard, video card settings for locales related entries

5. /etc/make.conf
This has two main entries: USE flags and LINGUAS

6. Kernel
Code:
File Systems -->
  Native Language Support -->
    (utf8) Default NLS Option
    <*> NLS UTF8

Keep in mind that glibc must be compiled after all these settings are applied. This is usually done when at fresh install. Then you can just run "locale" to verify if you are happy with the settings. Once all the above is done, you can run emerge kde-i18n

Now, here are my questions:

1) Is all the above correct?
2) If I am at any stage where I make changes to /etc/locales.build, obviously I have to re-compile glibc. Correct? Is it only this file or also emerge -e system and then emerge -euD world?
3) I am unable to get a mixing environment exactely like the one below:
Code wrote:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Either I get all en_EN or all it_IT. Is it possible (through 02local) to make it so?

4) Am I safe going all the say UTF-8? If not, is it possible to set my system to both UTF-8 and ISO-8859-1 with default UTF-8?

5) Are these settings below correct?

Here is how my PC is currently set:

Code:
/etc/env.d/02locale
LANG="en_US.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_ALL="en_US.UTF-8"


Code:
/etc/locales.build
en_US/ISO-8859-1
en_US.UTF-8/UTF-8
it_IT/ISO-8859-1
it_IT.UTF-8/UTF-8
it_IT@euro/ISO-8859-15


Code:
/etc/package.use
sys-libs/glibc userlocales


Code:
/etc/make.conf
LINGUAS="en it"


Code:
root # locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8


I thank you for all your effort because I wish to end this task, learn it well and move on.

Thank you,
Spiro
Back to top
View user's profile Send private message
Leo Lausren
Apprentice
Apprentice


Joined: 24 Feb 2004
Posts: 198
Location: Denmark

PostPosted: Fri Jun 03, 2005 5:56 pm    Post subject: Reply with quote

LC_ALL overrules all LC_* so you need to unset it.
Code:
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="it_IT.UTF-8"
LC_TIME="it_IT.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="it_IT.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="it_IT.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="it_IT.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=""

Edit quotes is needed for empty variable LC_ALL=""
_________________
Blog: common sense – nonsense


Last edited by Leo Lausren on Fri Jun 03, 2005 7:15 pm; edited 1 time in total
Back to top
View user's profile Send private message
asimon
l33t
l33t


Joined: 27 Jun 2002
Posts: 979
Location: Germany, Old Europe

PostPosted: Fri Jun 03, 2005 6:47 pm    Post subject: Reply with quote

The complete precedence is:
1. LC_ALL
2. The categories, i.e. LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME
3. LANG

The first variable which is set gets used.
Back to top
View user's profile Send private message
SAngeli
l33t
l33t


Joined: 16 Apr 2004
Posts: 904
Location: Italy

PostPosted: Sat Jun 04, 2005 9:04 pm    Post subject: Reply with quote

Hi and and thanks for your reply.

How about these few questions, I did not get any answer:

2) If I am at any stage where I make changes to /etc/locales.build, obviously I have to re-compile glibc. Correct? Is it only this file or also emerge -e system and then emerge -euD world?

4) Am I safe going all the say UTF-8? If not, is it possible to set my system to both UTF-8 and ISO-8859-1 with default UTF-8?

5) Besides 02local are my settings correct?

Thank you,
Spiro


Last edited by SAngeli on Sun Jun 05, 2005 11:13 am; edited 2 times in total
Back to top
View user's profile Send private message
Leo Lausren
Apprentice
Apprentice


Joined: 24 Feb 2004
Posts: 198
Location: Denmark

PostPosted: Sat Jun 04, 2005 10:29 pm    Post subject: Reply with quote

SAngeli wrote:
2) If I am at any stage where I make changes to /etc/locales.build, obviously I have to re-compile glibc. Correct? Is it only this file or also emerge -e system and then emerge -euD world?
Well, you probably dont need to re-compile glibc. Chances are that you already have the locales that you need. Userlocales just skip most of them to save compile time.
If all you change is some skipped locales, there is no need to rebuild anything.
SAngeli wrote:
4) Am I safe going all the say UTF-8? If not, is it possible to set my system to both UTF-8 and ISO-8859-1 with default UTF-8?
Not sure what you mean here. You do have the ISO-8859-1 locale. I say go for UTF-8.
SAngeli wrote:
5) Besides 02local are my settings correct?
Looks good to me.
_________________
Blog: common sense – nonsense
Back to top
View user's profile Send private message
asimon
l33t
l33t


Joined: 27 Jun 2002
Posts: 979
Location: Germany, Old Europe

PostPosted: Sat Jun 04, 2005 10:50 pm    Post subject: Reply with quote

SAngeli wrote:
2) If I am at any stage where I make changes to /etc/locales.build, obviously I have to re-compile glibc. Correct? Is it only this file or also emerge -e system and then emerge -euD world?

/etc/locales.build only affects the what locales glibc generates and installs. Thus re-emerging glibc is enough. But if you only want to install new locales, then you don't have to reemerge the whole glibc. New locales can be generated with the localedef command.

SAngeli wrote:

4) Am I safe going all the say UTF-8? If not, is it possible to set my system to both UTF-8 and ISO-8859-1 with default UTF-8?

I think there are still some applications which could be problematic with UTF-8, but overall it should be okay. I use UTF-8 without problems.

You can install utf-8 and iso locales alltogether (the default for glibc if you don't use USE=userlocales is to install all locales) and setup your system to use UTF-8. If some app misbehaves you could try to start it with "LC_ALL=it_IT.ISO-8859-1 <application>" (then you should have 'it_IT.ISO-8859-1/ISO-8859-1' in your locales.build) to have it use your ISO locale. My /etc/locales.build for example looks like
Code:
en_US/ISO-8859-1
en_US.UTF-8/UTF-8
de_DE.UTF-8/UTF-8
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15

Although I have some ISO locales installed I haven't used them in a long time.

Quote:

5) Besides 02local are my settings correct?

If you use some UTF-8 encoding it is not wrong to have utf8 in your USE variable, i.e. /etc/make.conf, otherwise some apps may be missing utf-8 support. ('emerge --newuse world' can reemerge all packages for which the use flags have changed.)


EDIT: I would put 'unicode' too in your USE flag.
Back to top
View user's profile Send private message
SAngeli
l33t
l33t


Joined: 16 Apr 2004
Posts: 904
Location: Italy

PostPosted: Sun Jun 05, 2005 8:18 am    Post subject: Reply with quote

Lastly, as I forgot:

6. Kernel
Code:
File Systems -->
  Native Language Support -->
    (utf8) Default NLS Option
    <*> NLS UTF8


I replaced ISO-8859-1 as default NLS Option to UTF8 as adviced. Do you confirm me this in Kernel File Systems? Also, is there any correlation between the locales I can select in File Systems and one of the configuration files (/etc/locales.build, /etc/env.d/02locale, /etc/package.use, /etc/X11/xorg.config, /etc/make.conf) or the kernel File Systems selection apply only to file sysmtes as a concept and therefore has no relation with the above files?

How do I base my decision for proper keyboard layout when looking at /usr/share/keymaps/i386/include/ ?
I know I have an Italian keyboard which should be KEYMAP="it" but, can I make it better or more appropriate or just waste of time?

As for console fonts, how do I understand what I need, considering the Euro symbol?

Double check: If I make changes to /etc/locales.build it only affects what locales glibc generates and installs. Is it safe to say: then it is good idea to re-compile glibc. But if there are applications that were compiled with glibc before changes, it would also make sense to recompile system to be safe. Is this correct or a paranoic thinking? After all, once I re-compiled everything I am more safe. Obviously, this all thinking applies during first install of Gentoo if for any reason I change locales on the way. Please let me know.

I Thank you because you gave me a lot of good info for better understanding localization.
Spiro
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum