Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 9988 - setting LANG variable
Summary: setting LANG variable
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Gentoo Linux x86 Installation Guide (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
: 1815 2121 6758 7569 12065 12923 14096 22669 32217 56586 (view as bug list)
Depends on: 57973
Blocks: 48449 52013
  Show dependency tree
Reported: 2002-10-30 17:47 UTC by Seemant Kulleen (RETIRED)
Modified: 2006-02-05 03:55 UTC (History)
36 users (show)

See Also:
Package list:
Runtime testing required: ---

patch for (,151.34 KB, patch)
2003-07-15 20:56 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for (,661 bytes, patch)
2003-07-15 20:59 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for (,1.21 KB, patch)
2003-07-15 20:59 UTC, Masatomo Nakano (RETIRED)
Details | Diff
patch for (,1.32 KB, patch)
2003-07-16 22:00 UTC, Masatomo Nakano (RETIRED)
Details | Diff
Alternate patch for (,4.51 KB, patch)
2003-07-27 22:50 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Alternate for patch for (,4.52 KB, patch)
2003-07-27 22:54 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Revised Alternate (,4.53 KB, patch)
2003-07-28 10:22 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Alternate patch for (,4.97 KB, patch)
2003-07-28 12:09 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Revised alternate for (,4.63 KB, patch)
2003-07-28 12:29 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Revised alternate patch for (,4.65 KB, patch)
2003-07-28 21:38 UTC, Jason A. Mobarak (RETIRED)
Details | Diff
Test case for the alternate patch. (patched_ebuild_run_output.txt,13.94 KB, text/plain)
2003-07-28 21:39 UTC, Jason A. Mobarak (RETIRED)
ebuild-linguas.patch (ebuild-linguas.patch,1.03 KB, patch)
2004-10-23 00:51 UTC, Harald van Dijk (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Seemant Kulleen (RETIRED) gentoo-dev 2002-10-30 17:47:39 UTC
Should we make mention of setting a LANG variable in /etc/rc.conf or
/etc/make.conf or so in the install guide?  this might close a lot of issues.

Also, while we're talking about it -- is there a way to have a list of possible
LANGs?  So that if I want en_GB and nl_NL (UK English and Dutch) then that can
happen?  Az?
Comment 1 SpanKY gentoo-dev 2002-10-31 00:43:29 UTC
`ls /usr/share/locale/` ? 
Comment 2 John Davis (zhen) (RETIRED) gentoo-dev 2002-10-31 19:40:05 UTC
What doc should this be added to?

Comment 3 Seemant Kulleen (RETIRED) gentoo-dev 2002-10-31 19:49:32 UTC
none yet, hang on. I'm sending a message to -core about this.
Comment 4 John Davis (zhen) (RETIRED) gentoo-dev 2002-10-31 20:19:03 UTC
Ok, I can do that ;-)

Comment 5 John Davis (zhen) (RETIRED) gentoo-dev 2002-11-04 16:25:18 UTC
Colin, is it possible to make an automatically generated list of LANGS like we 
did for USE from use.desc?

Comment 6 Martin Schlemmer (RETIRED) gentoo-dev 2002-11-05 12:13:46 UTC
What about adding some feature to portage, that it will run localpurge after
'install to ${D}' and remove everything not belonging to EN (??) and selected
locales in LANG ??

Not sure about binary packages though ...
Comment 7 John Davis (zhen) (RETIRED) gentoo-dev 2002-11-05 19:45:11 UTC
Hmm, okay. Is this still a doc issue then?

Comment 8 Seemant Kulleen (RETIRED) gentoo-dev 2002-11-06 13:01:27 UTC
Az that kind of feature would completely rock. Things like the sylpheed-claws
documentation translations (which get installed by default in 3 languages), and
gtk2 stuff which installs every single language known to man, known to woman,
and unknown to humans entirely, etc etc.
Comment 9 Seemant Kulleen (RETIRED) gentoo-dev 2002-11-06 20:08:20 UTC
just to show that is needed

*** This bug has been marked as a duplicate of 9901 ***
Comment 10 John Davis (zhen) (RETIRED) gentoo-dev 2002-12-02 23:46:30 UTC
what is happening with this bug? seemant?

Comment 11 Roman Majer 2002-12-09 09:08:58 UTC
there are three problems: 
1) how to say in ebuild, that you want "your" nls option 
 f.e. if I have USE="nls" the ebuild will download and install 
 all language definitions known for this package 
 (very frustrating for glibc) 
 so how to say: I want "default (english) and cs (Czech)" locales 
2) how to say to ebuild to prepare messages (glibc) in specific 
3) apps 
before some years apps have used 7bit coding (like ascii), for english 
it is enough, but not for european languages 
now in common they use 8bit coding (ISO-8859-X) 
future is Xbit coding (UTF like)  
Each of this problem must be solved in gentoo in near 
1) can specify what locale I want 
2) can specify codepage for locales 
3) apps to be able use my codepage (mostly UTF problems) 
Comment 12 Roman Majer 2002-12-09 10:18:18 UTC
some Research on this problem 
how to setup locales for apps: 
with format language[_COUNTRY[.codepage]] 
environment variables: man 7 locale 
definition of language: ISO 639 
definition of country: ISO 3166 
definition of codepage: some hint in /usr/src/linux/fs/nls/ 
some howtos: 
in french 
in english 
nice howto from gentoo people: 
how to compile just one locale in glibc?,0,1,0,0.html 
Comment 13 John Davis (zhen) (RETIRED) gentoo-dev 2002-12-27 00:33:00 UTC
Hmm, okay - any progess on this?

Comment 14 Dan Armak (RETIRED) gentoo-dev 2003-01-16 07:03:41 UTC
KDE take on this: 
The main kde + koffice have separate i18n packages in app-i18n (ebuild per language) which 
the user must emerge manually atm. If you give me somehing to use in PDEPEND, we can 
automatically pull in the right language pack(s) based on the locale after emerging kde/koffice. 
These packages are specified by language code (i.e. en_GB, he, fr, de). 
Many of the smaller kde apps have several translations packs distributed with them (for 
anything between 1 and 5 languages most of the time, nothing like the 50+ for kde proper). 
usually all of them are installed (I think), if you give me a list of languages in 
src_compile/_install I can control that. 
And, of course, unicode support is always present in qt/kde 3. We're only talking about 
tranlations of docs/help/interface/messages here. 
Comment 15 Seemant Kulleen (RETIRED) gentoo-dev 2003-01-16 07:41:21 UTC
*** Bug 6758 has been marked as a duplicate of this bug. ***
Comment 16 Spider (RETIRED) gentoo-dev 2003-01-16 09:47:00 UTC
Gnome solves it by always installing nls, and falling back to always using the
same codepath for texts, wether you specify a lang or not.

I think we should leave instructions for setting LANG, but I can also comment on
some packages that dont work well with LANG exported... typical is xmms, which
wont play songs in directories that contain 
Comment 17 Spider (RETIRED) gentoo-dev 2003-01-16 09:47:00 UTC
Gnome solves it by always installing nls, and falling back to always using the
same codepath for texts, wether you specify a lang or not.

I think we should leave instructions for setting LANG, but I can also comment on
some packages that dont work well with LANG exported... typical is xmms, which
wont play songs in directories that contain üäöøæ when you have exported
LANG=en_GB .

so we have a dilemma.
Comment 18 Nick Hadaway 2003-01-16 13:52:39 UTC
openmotif has problems compiling in some locales with specific LANG
settings... I have bug #10915 open which may give another perspective of
a program with language/locale problems.

We need to accept the fact that programs may not compile in a non "C"
locale.  I don't think we as Gentoo developers should be held responsible for making sure a package is fully internationalized, but if there are willing and able people who can help upstream maintainers fix that, that's cool. :)

I think it would definitely be nice in rc.conf (or make.conf, whichever makes most sense) to give the user the option to set LANG settings there but with a big PHAT warning... even BIGGER and PHATTER than warnings about over-aggressive CFLAGS...
Comment 19 Roman Majer 2003-01-17 02:21:09 UTC
That's WHY I suggest to NOT declare locale variables for root account.
The root account should be "default" "C" locale and the problems with
emerging (compilling) of packages will be solved.
Locale variables should be declared ONLY for user accounts!

BUT the locale settings in make.conf can be used for default skeleton for
creating user directories.
Comment 20 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-17 05:50:55 UTC
Dont use LANG, but rather ELANG ?  Portage then use this to filter 
Comment 21 John Davis (zhen) (RETIRED) gentoo-dev 2003-01-26 21:11:46 UTC
What is the progress on this? I am not sure that I am the one to handle this,
following the comments...

Comment 22 John Davis (zhen) (RETIRED) gentoo-dev 2003-01-29 23:34:04 UTC
i will put this in my pile of stuff to keep an eye on..
Comment 23 Adrian Almenar 2003-03-22 16:08:31 UTC
so, what happened finally with this bug ? 
Comment 24 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-11 12:06:48 UTC
*** Bug 12923 has been marked as a duplicate of this bug. ***
Comment 25 Seemant Kulleen (RETIRED) gentoo-dev 2003-04-20 17:09:02 UTC
basically my idea is to have an ACCEPTED_LANGS and MAIN_LANG variables in make.conf or rc.conf (perhaps rc.conf?).
Comment 26 Alastair Tse (RETIRED) gentoo-dev 2003-05-14 12:04:03 UTC
i'm not sure where this bug is focusing on whether to setup a default (reasonable) LANG variable or to now allow the setting of multiple languages.

if it is still focusing on setting a global system-wide LANG variable, then it is related to bug #7596 and also there is a docs bug #20954 to clarify the situation with LANG. i've just spent a good chunk of time tracking down an evolution bug which ended up to be caused by the lack of env var LANG. this is not the first app to be bitten by this problem, as i know xfree has problems with deadkeys and some other apps had problems (iirc, the now defunct rhythmbox.) therefore i support setting LANG as a system wide variable, or at least a sensible default for new installations, and making it clear in the install docs that the users SHOULD set their own LANG environment (in rc.conf?)

Comment 27 Peter Ruskin 2003-05-14 13:35:58 UTC
rc.conf is probably as good a place as any, because the KEYMAP, CONSOLEFONT and 
CONSOLETRANSALTION variables are set there and they are related.  However, it's 
not a trivial thing to organise and it's hell for users.  
Mandrake has a /etc/sysconfig/i18n file: mine was set for United Kingdom but it 
made file sorting crazy until I altered it so: 
LC_COLLATE=POSIX     <------ to correct crazy sorting 
Comment 28 Kalin KOZHUHAROV 2003-06-29 05:32:12 UTC
Just to add a cross-reference, a posting of mine, some time ago:

Everybody here talks about LANG and LANGS and so on, but nobody mentiones LINGUAS, the "standart" GNU gettext way of specifying things.

Comment 29 Seemant Kulleen (RETIRED) gentoo-dev 2003-06-29 05:37:14 UTC
kalin, do you have a link to GNU's explanation of it?
Comment 30 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-15 20:54:01 UTC
Hi all

I implemented two features to resolve this bug.
By defining USE_LANG settings, we can configure ebuild.

First feature, addition lang/primary_lang function to ebuild.

1. export USE_LANG='ja ko' (or in make.conf)
2. in ebuild
lang ja && epatch ${FILES}/japanese.patch
lang ko && epatch ${FILES}/korean.patch

If Japanese patch and Korean patch are conflict, we can use primary_lang 
function. This function evaluates only the first of USE_LANG.

In this case, only Japanese patch is applied.
primary_lang ja && epatch ${FILES}/japanese.patch
primary_lang ko && epatch ${FILES}/korean.patch

Second, to remove unnecessary language files(man/locale files).

All man/locale files are installed at the moment.
However I need only Japanese and English files :)

1. export USE_LANG='ja' (or in make.conf)
2. Then I have only Japanese and defualt(English) man/locale files after emerge.

Any idea?

P.S. 'USE_LANG' name is not good idea?
Comment 31 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-15 20:56:57 UTC
Created attachment 14532 [details, diff]
patch for
Comment 32 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-15 20:59:00 UTC
Created attachment 14533 [details, diff]
patch for

Sorry, I attached not patch. This is the patch.
Comment 33 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-15 20:59:45 UTC
Created attachment 14534 [details, diff]
patch for
Comment 34 Alastair Tse (RETIRED) gentoo-dev 2003-07-16 01:57:11 UTC
Looks good, except one thing.

In remove_unnecessary_lang() , you go through ${D}/usr/share/locale and match the languages that are not in USE_LANG. But according to your example, if you have:

USE_LANG="ja ko"

then it will still remove those that a name ja_JP ja_JP.SJIS ... 

Maybe it is better if you keep the directory if the substring matches the beginning of the language code, so "ja" would keep ja, ja_JP, ja_JP.SJIS ?
Comment 35 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-16 21:59:05 UTC
Thanks, liquidx. I've fixed it.

And I added FEATURES='noallman noalllocale'.
If you set these flags, emerge removes man/locale files except your lang.

Please test it.
Comment 36 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-16 22:00:03 UTC
Created attachment 14579 [details, diff]
patch for
Comment 37 Ken Deeter 2003-07-16 22:55:43 UTC
Nakano-san konnichiwa (^^; 
I think the PRIMARY_LANG idea might be a bit limited. 
Say for example there are 2 patches, one for ko and one for cn that conflict. 
Say I set USE_LANG="ja ko cn" 
in this case, it would seem to me that as long as ko didn't conflict with ja, one would still 
want ko to be applied. 
The question is how one would query the preference order. I was thinking something like 
lang_prefer ko cn && epatch ko.patch 
lang_prefer cn ko && epatch cn.patch 
where lang_prefer means: true if the first argument is preferred over all other arguments 
In the case where only two patches conflict with one another this makes sense. However 
if you get in to say 3 or more you might end up with 
lang_prefer ko cn ja en uk && epatch ko.patch 
lang_prefer cn ko ja en uk && epatch ... 
lang_prefer ja ... && ... 
lang_prefer en ... && ... 
lang_prefer uk ... && ... 
Seems like you just want to be able to say "these patches conflict, please the largest 
subset without causing conflict according to my preferences" (and not specific to i18n 
patches either) 
just my 2 cents 
Comment 38 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-21 21:06:46 UTC
*** Bug 22669 has been marked as a duplicate of this bug. ***
Comment 39 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-27 22:50:02 UTC
Created attachment 15111 [details, diff]
Alternate patch for

This has not been fully tested yet, posted purely for consideration of the
design, I will post again once I have tested it more.
Comment 40 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-27 22:54:55 UTC
Created attachment 15112 [details, diff]
Alternate for patch for

Already noticed a typo, all apologies.
Comment 41 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-27 22:58:02 UTC
Note the alternate patch for also retabifies to all tabs !! --instead of some places where it's 4 spaces for a tab--
Comment 42 liuspider 2003-07-28 08:58:08 UTC
I have tested this patch against man-1.5l-r6.ebuild, but it just can not identify any man 
pages which should be removed. 
I find out that the variable ${MANDIR} in function remove_man_files is empty :( 
Comment 43 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 10:22:42 UTC
Created attachment 15136 [details, diff]
Revised Alternate
Comment 44 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-28 12:08:47 UTC

I saw your patch. Thank you for adding comments etc.
But I think some people need all man files/locales even if he/she set USE_LANG.
SO I've proposed adding new a variable on #25296 
Please see it.
Comment 45 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 12:09:27 UTC
Created attachment 15143 [details, diff]
Alternate patch for

Ok, tested this a bit more, seems to be in working order now.
Comment 46 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 12:24:11 UTC
Ok, so a FILTER variable, or as in the orignal patch FEATURES could include noallman, and/or noalllocale, the alternate patch was added at the request of Seemant Kulleen in which he specified how removing of the man/locale files should behave. It's seems a bit less customizable but perhaps a simpler way to remove all unnecessary stuff.
Comment 47 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 12:29:13 UTC
Created attachment 15148 [details, diff]
Revised alternate for
Comment 48 liuspider 2003-07-28 20:49:04 UTC
This patch works fine with man & net-tools 
hopes this can be merged into next version 
Comment 49 liuspider 2003-07-28 20:55:23 UTC
But I do not know whether this patch can deal with locale correctly. 
No package comes into my mind other than glibc which has locales and can be used to test 
this patch. 
But glibc is too large to compile ;), so I do not know whether it can remove unneccesary 
Comment 50 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 21:17:10 UTC
I believe the man ebuild does have locale files, as I thought I saw some being removed when I installed it, adding a "v" to the rm command options in the remove_* commands is helpful, as it'll show what's being removed, currently I'm using this patch to build a chroot enviroment, so if anything arises I'll be sure to post it.
Comment 51 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 21:38:12 UTC
Created attachment 15168 [details, diff]
Revised alternate patch for
Comment 52 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 21:39:37 UTC
Created attachment 15169 [details]
Test case for the alternate patch.
Comment 53 Jason A. Mobarak (RETIRED) gentoo-dev 2003-07-28 21:41:08 UTC
Comment on attachment 15169 [details]
Test case for the alternate patch.

This test has rm -vrf in the to illustrate what's being removed, the
latest patch does not.
Comment 54 liuspider 2003-07-28 22:24:41 UTC
Oh, yes, the man packages does have locale files, thanks. 
And I think currently the new ebuild will keep all zh* if I set my USE_LANG="zh", but what 
I really need is only zh_CN.GBK, zh_CN.GB18030 and zh_CN.UTF-8, not including zh_TW.* 
and other zh_CN.*. 
So maybe it's better to use exactly match in the function remove_man_files and 
remove_locale_files, not just compare the first 2 characters? 
Comment 55 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-28 22:56:53 UTC
first 2 charactor is language code then country/region code.
USE_LANG is set language code so it compare the first 2 charactor at the moment.

If we want to specify a country/region code, we need to make new variable USE_LOCALE instead of USE_LANG.


just idea.
Comment 56 liuspider 2003-07-29 19:10:26 UTC
Is that need a special variable? 
In my opinion using wildcards in USE_LANG is sufficient to archieve this goal. Just: 
USE_LANG="zh_CN.GBK zh_CN.UTF-8"  
Comment 57 Seemant Kulleen (RETIRED) gentoo-dev 2003-07-29 19:26:38 UTC
I am inclined to agree with liu on this
Comment 58 Masatomo Nakano (RETIRED) gentoo-dev 2003-07-30 10:49:33 UTC
I just want to rename USE_LANG to USE_LOCALE.
Comment 59 Kalin KOZHUHAROV 2003-08-03 06:46:56 UTC
Well, Comment #28 asked for reference to GNU gettext, here is one:

For the moment, I still have this in my /etc/make.conf

# packages that don't work with LINGUAS:
# break: sharutils atk gtk+-2.2.1
# ignore: wget man net-tools cups
LINGUAS="en ja ru bg de" 

and comment the LINGUAS line when building "break" packages"
Comment 60 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-12 08:04:27 UTC
*** Bug 1815 has been marked as a duplicate of this bug. ***
Comment 61 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-12 09:17:27 UTC
*** Bug 2121 has been marked as a duplicate of this bug. ***
Comment 62 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-12 09:59:06 UTC
*** Bug 7569 has been marked as a duplicate of this bug. ***
Comment 63 Heinrich Wendel (RETIRED) gentoo-dev 2003-10-12 10:10:35 UTC
*** Bug 12065 has been marked as a duplicate of this bug. ***
Comment 64 Martin Holzer (RETIRED) gentoo-dev 2003-10-12 15:28:47 UTC
*** Bug 14096 has been marked as a duplicate of this bug. ***
Comment 65 SpanKY gentoo-dev 2003-10-28 13:28:24 UTC
*** Bug 32217 has been marked as a duplicate of this bug. ***
Comment 66 Craig Bradney 2003-11-12 14:01:03 UTC
This issue has recently come up with Gentoo users of Scribus. From what I have been told, Qt calls with regards to languages are used to set the language of a Scribus document. When LANG is not set, there are issues with certain characters in the documents. As soon as you export LANG (Ive done it in .bashrc), the Scribus issue goes away.

So, any progress on this one?
Comment 67 Craig Bradney 2003-11-13 16:20:20 UTC
This might be of use re Qt:

It shows how the translate calls are made for different languages etc.
Comment 68 Heinrich Wendel (RETIRED) gentoo-dev 2004-03-27 09:00:25 UTC
i think this is done, isn't it?
Comment 69 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-03-27 10:00:44 UTC
Oh, really? If so, it's good to know that. We all are waiting for
this feature to be implemented. I cannot find any USE_LOCALE nor
USE_LANG under /usr/lib/portage though (portage-2.0.50-r1).
I would like to add Japanese version of openoffice-bin once
this issue has been solved.
Comment 70 Spider (RETIRED) gentoo-dev 2004-03-29 08:57:15 UTC
is this also documented and default then?  is a skeleton file installed somewhere?  (+nls flag in baselayout strikes me as a good place) and also setting LANG="en_US" if nothing else?  please note that "POSIX" or "C" are considered bad to set as defaults.
Comment 71 Heinrich Wendel (RETIRED) gentoo-dev 2004-03-29 10:51:31 UTC
kde-i18n, koffice-i18n and k3b already use the linguas use variable
Comment 72 Mamoru KOMACHI (RETIRED) gentoo-dev 2004-03-29 11:16:43 UTC
Yup, but where do these linguas_?? IUSE flags come from? Also, do portage developers agree to use LINGUAS variable to define system language environment? (LANG is for user language env) 
Comment 73 Craig Bradney 2004-03-29 13:14:54 UTC
And Qt's language functions only get from LANG... no idea why but it is so. I guess for cross platform portability.
Comment 74 foser (RETIRED) gentoo-dev 2004-03-29 22:59:32 UTC
I'm not at all in favour of official support, that means if it breaks some builds (and i know it does) we get to fix it and I'm certainly not ready for that. Users can do this fine on their local systems if they want to, but Gentoo wide support.. nah... I'm still waiting for ranged deps, that's way more important than this superficial feature.
Comment 75 Prieto 2004-04-02 17:18:37 UTC

Comment 76 Prieto 2004-04-02 17:18:37 UTC
¿Superficial feature? Maybe for you, who are native english speaker. Sure ranged dependencies are good, but i think this and the binary ebuilds are the very first lacks of Gentoo.
Comment 77 Tero Grundström 2004-04-29 09:17:27 UTC
This is one of the things that are currently soooo wrong in Gentoo. For example compiling all the locales is *one of the most time consuming periods* during the bootstrap - and for what? To waste my disk space and nothing more!!
Comment 78 Flammie Pirinen (RETIRED) gentoo-dev 2004-06-29 13:42:05 UTC
At comment 54 someone said about checking 2 characters for language codes only? I know this might be a bit pedantic, but I think that for some rare languages there are only 3 letter language codes available, which might make a problem.
Comment 79 Seemant Kulleen (RETIRED) gentoo-dev 2004-07-12 19:25:52 UTC
*** Bug 56586 has been marked as a duplicate of this bug. ***
Comment 80 Harald van Dijk (RETIRED) gentoo-dev 2004-10-23 00:51:58 UTC
Created attachment 42448 [details, diff]

A bit shorter, and uses the LINGUAS variable. It takes a slightly different
approach that makes it work with xx as well as xx_XX linguas.

In reply to comment 76: This should also work with xxx or longer linguas. The
directories in my /usr/share/locale this applies to are only chef, fudd,
piglatin and valley, though; nothing to be taken seriously.
Comment 81 Heinrich Wendel (RETIRED) gentoo-dev 2004-10-25 13:52:56 UTC
OK, to get things done, i'll try to summarize everything:

This bug proposes some features related to non-English languages. The base of all those features is a variable called LINGUAS. This variable should contain all languages you want to install on your system, the ones with higher priority first, e.g. LINGUAS="de_DE.UTF8 cz en_GB@Euro" and will be defined in /etc/rc.conf. The LINGUAS variable will follow ISO 639 and ISO 3166.

Those are the features that will be introduced with the LINGUAS variable:

1.) For working with LINGUAS in ebuilds, portage will get two new functions:
  1.1) lang (e.g. `lang en` will return true)
  1.2) primary_lang (e.g. `primary_lang de` will return true)

2.) a function to remove unused man pages, activated by FEATURES="notallmanpages"

3.) a function to remove unused locales, activated by FEATURS="notalllocales"

4.) based on the first entry in LINGUAS, a system locale should be set in /etc/bash/bashrc.

The most important point in my opinion is 1. It's easy to implement (see attached patches for ebuild, they only need to be changed a bit) and will break nothing. For 2 and 3 we still have to decide howto match the locales, see comments #78, #54. 4 is a bit complicated because portage will break on some packages, as long as it does not export LANG=C and some ppl are not happy with doing that, see bug #57973.
Comment 82 Marius Mauch (RETIRED) gentoo-dev 2004-10-25 14:12:00 UTC
I don't like 2) and 3) as FEATURES, but they can probably be implemented in a different way.
Comment 83 SpanKY gentoo-dev 2004-10-25 16:12:34 UTC
(2) and (3) are already handled by app-admin/localepurge imho ... no point in bloating portage further with more FEATURES
Comment 84 Heinrich Wendel (RETIRED) gentoo-dev 2004-10-26 10:23:48 UTC
1 could also implemented using an eclass, i don't know which way is better
Comment 85 SpanKY gentoo-dev 2004-10-26 10:52:23 UTC
i already implemented a 'strip-linguas' function in eutils.eclass a while ago because i kept finding packages that would fail to build when LINUGAS contained entries that the package didnt support ...

so that could possibly be used as a start for an eclass

might i suggest the following for portage though ... sometimes packages can have SRC_URI/DEPEND/etc based upon LINGUAS/LANG ... can we have implied USE flags based upon the value of LANG ?  or perhaps something like what we have right now with IUSE_VIDEO_CARDS ...
for example:
LANG="en de"
then ebuild's could use lang_en? ( ) lang_de? ( )
Comment 86 Heinrich Wendel (RETIRED) gentoo-dev 2004-10-26 11:16:40 UTC
that's already in portage, you can use "use linguas_xx"
Comment 87 SpanKY gentoo-dev 2004-10-26 11:39:40 UTC
well then, i'm an idiot

ok, in response to (4) then, why cant we just make users set it themselves ? why does portage have to get involved ?
Comment 88 Harald van Dijk (RETIRED) gentoo-dev 2004-11-17 17:03:24 UTC
> (2) and (3) are already handled by app-admin/localepurge imho ... no point in bloating portage further with more FEATURES

That makes qpkg -c / equery check practically unusable.
Comment 89 Marius Mauch (RETIRED) gentoo-dev 2005-12-04 09:19:35 UTC
So, anything left here?
Comment 90 Brian Harring (RETIRED) gentoo-dev 2006-02-05 03:55:07 UTC
Looks to be a nonissue now...