Ok, two requests in one (but related!) - so here they are. 1. According to the "Gentoo Linux Localization Guide", in 3rd chapter there is the mentioning of the /etc/env.d/02locale file. However, there is no *exact* example of how this file should look like. The closest that comes to my mind is the description here "Code Listing 3.1: setting the German locale". This could be improved IMHO. Later on the instruction states that the user should execute "env-update && source /etc/profile" in order to apply the changes. Without explicitly stating that the example mentioned in "Code Listing 3.1" could be written to /etc/env.d/02locale *OR* ~/.bashrc for example, the user (like me on first reading) may feel confused. Additionaly, the order of the text could be changed as well, to represent more logical line of thought. 2. According to the recent discussion on the gentoo-dev ML: http://thread.gmane.org/gmane.linux.gentoo.devel/38378 it is possible to make sure that emerges always are run in the sane environment, by setting the locale that portage uses in /etc/portage/bashrc file. The localization guide could remind users about it, so in the event of reporting a bug all the error messages would be in plain English (and not in a random, system-default locale). SOLUTION ======== Consider changing text of the guide like this (note that I propose moving the "Note:" from under the table to a later part): ------ Most typically users only set the LANG variable and perhaps LC_CTYPE variable on user level by adding definitions to shell's startup files (for example to their ~/.bashrc), defining the respective environment variables: Code Listing 3.1: setting the per user locale in ~/.bashrc export LANG="de_DE@euro" Note: Append @euro to your locale if you want to use the Euro currency symbol (
Ok, two requests in one (but related!) - so here they are. 1. According to the "Gentoo Linux Localization Guide", in 3rd chapter there is the mentioning of the /etc/env.d/02locale file. However, there is no *exact* example of how this file should look like. The closest that comes to my mind is the description here "Code Listing 3.1: setting the German locale". This could be improved IMHO. Later on the instruction states that the user should execute "env-update && source /etc/profile" in order to apply the changes. Without explicitly stating that the example mentioned in "Code Listing 3.1" could be written to /etc/env.d/02locale *OR* ~/.bashrc for example, the user (like me on first reading) may feel confused. Additionaly, the order of the text could be changed as well, to represent more logical line of thought. 2. According to the recent discussion on the gentoo-dev ML: http://thread.gmane.org/gmane.linux.gentoo.devel/38378 it is possible to make sure that emerges always are run in the sane environment, by setting the locale that portage uses in /etc/portage/bashrc file. The localization guide could remind users about it, so in the event of reporting a bug all the error messages would be in plain English (and not in a random, system-default locale). SOLUTION ======== Consider changing text of the guide like this (note that I propose moving the "Note:" from under the table to a later part): ------ Most typically users only set the LANG variable and perhaps LC_CTYPE variable on user level by adding definitions to shell's startup files (for example to their ~/.bashrc), defining the respective environment variables: Code Listing 3.1: setting the per user locale in ~/.bashrc export LANG="de_DE@euro" Note: Append @euro to your locale if you want to use the Euro currency symbol () It is also possible to set a system-wide locale for all users and programs, though it may create some potential problems with system services and bug reporting: Code Listing 3.2: setting the default system locale in /etc/env.d/02locale export LC_ALL="de_DE@euro" export LANG="de_DE@euro" Note: Even though most programs work with LC_ALL only, some of them misbehave if LC_ALL is set but LANG isn't. If you want to play safe, set them both. A common practice is to use only per user locale settings and leave the default system locale unset. In this case locale settings defaults to a special value "C", which for historical reasons maps to the English locale. There is one downside to setting a default system locale to something else that "C" or "POSIX" - all messages produced while emerging the packages will be displayed in the selected language. This makes it harder for Gentoo developers to track the bugs with unreadable error messages, which should be in plain English instead. So if you change the default system locale in /etc/env.d/02locale, you are strongly encouraged to revert that change for portage (and portage only) by creating the /etc/portage/bashrc file and providing a sane environment for all emerges: Code Listing 3.3: setting the default portage locale in /etc/portage/bashrc export LC_ALL="C" export LANG="C" Once you have set the right locale, be sure to update your environment variables to make your system aware of the change: Code Listing 3.4: Update the system environment for system-wide default locale # env-update && source /etc/profile for user-specific locale $ source ~/.bashrc ------ This change if introduced, would be beneficial for both Gentoo users and developers. The former will gain an additional insight of what is going on in their system, while the latter would feel some relief by noticing a smaller amount of bug reports with unreadable error messages. By the way, this would be a good candidate to be described in another Gentoo Weekly News - to make sure that all interested users update (or create) their /etc/portage/bashrc files... :-) Cheers,
(In reply to comment #0) > Code Listing 3.2: setting the default system locale in /etc/env.d/02locale > > export LC_ALL="de_DE@euro" > export LANG="de_DE@euro" No need to export stuff in /etc/env.d
(In reply to comment #1) > > No need to export stuff in /etc/env.d > You are right of course. It should be: ----- Code Listing 3.2: setting the default system locale in /etc/env.d/02locale LC_ALL="de_DE@euro" LANG="de_DE@euro" ----- Sorry! :oops:
(In reply to comment #0) SirYes, can you please restate your request(s) concisely, ideally with a patch attached as per our documentation tips'n'tricks[1]? Thanks. [1] http://www.gentoo.org/doc/en/dri-howto.xml
(In reply to comment #3) > can you please restate your request(s) concisely Ok, without much background: 1) Current localization instructions are a bit unclear IMO 2) Existence of /etc/env.d/02locale file should be more emphasized 3) Developers recently discussed Portage extension to provide a consistent environment for all emerges (with "C" locale) 4) This is unneeded, because Portage already has means for doing 3) 5) Existence of /etc/portage/bashrc file should be described > ideally with a patch attached I'm workig on it right now. > as per our documentation tips'n'tricks? This one? http://www.gentoo.org/proj/en/gdp/doc/doc-tipsntricks.xml :)
Created attachment 87366 [details, diff] system-and-portage-locale.diff Patch with proposed changes. (please review the wording, I'm not a native English speaker)
(In reply to comment #4) > (In reply to comment #3) > > can you please restate your request(s) concisely > > Ok, without much background: > > 1) Current localization instructions are a bit unclear IMO Feel free to suggest improvements, but please try to be more specific than "they are unclear". > 5) Existence of /etc/portage/bashrc file should be described Certainly not in the Localisation Guide. > > as per our documentation tips'n'tricks? > > This one? > http://www.gentoo.org/proj/en/gdp/doc/doc-tipsntricks.xml http://www.gentoo.org/proj/en/gdp/doc/doc-tipsntricks.xml
(In reply to comment #6) > > Feel free to suggest improvements, but please try to be more specific than > "they are unclear". I wrote it at the very beginning (!). Then nightmorph asked me to be more concise, so I tried to comply. Then you come and ask to be more specific. ;-) So, I'll quote the motivation once again: ==== According to the "Gentoo Linux Localization Guide", in 3rd chapter there is the mentioning of the /etc/env.d/02locale file. However, there is no *exact* example of how this file should look like. The closest that comes to my mind is the description here "Code Listing 3.1: setting the German locale". This could be improved IMHO. Later on the instruction states that the user should execute "env-update && source /etc/profile" in order to apply the changes. Without explicitly stating that the example mentioned in "Code Listing 3.1" could be written to /etc/env.d/02locale *OR* ~/.bashrc for example, the user (like me on first reading) may feel confused. ==== > > 5) Existence of /etc/portage/bashrc file should be described > > Certainly not in the Localisation Guide. Fair enough. I'll remove the portage specific part from my proposal and attach a modifed patch. Please reconsider it then. I still see an opportunity to improve the guide. Reading the Handbook one can find many *exact* examples of where to put configuration settings. This one particular problem I'm trying to address. As the experiment, try to ask a less knowledgable person where to put user specific locale settings and where to set system defaults. With current guide not everyone will pass that test. With proposed changes the number of incorrect answers should (hopefully) be smaller. Does this clarify my intentions now?
Created attachment 87482 [details, diff] setting-locale-clarification.diff This modified proposal emphasizes locations of files which can contain locale settings. Consequently the instructions how to apply the changes are also updated.
In CVS. Thanks.