1 |
(It would be nice to reply on-list so the list's archives will be |
2 |
helpful to others searching through it.) |
3 |
|
4 |
Daniel Pielmeier wrote: |
5 |
> 2009/5/15 Nikos Chantziaras <realnc@×××××.de>: |
6 |
>> Reading the Gentoo Development Guide doesn't offer much help on LINGUAS: |
7 |
>> |
8 |
>> http://devmanual.gentoo.org/general-concepts/linguas/index.html |
9 |
>> |
10 |
>> It says to look at games-rpg/nwn, but that ones seems to use LANGUAGES |
11 |
>> instead of LINGUAS. My ebuild is EAPI=2 and the application in question |
12 |
>> supports English and German. What is correct, LINGUAS="en de" or |
13 |
>> LANGUAGES="en de"? |
14 |
> |
15 |
> LINGUAS holds the languages you want to install from make.conf. |
16 |
> LANGUAES or LANGS or any other variable name you choose in your ebuild |
17 |
> should refer to the languages available in the application to be |
18 |
> installed. |
19 |
|
20 |
Then I guess LINGUAS is what I need, since a user not having "de" in |
21 |
make.conf wouldn't want a German translation of the application's GUI |
22 |
installed. |
23 |
|
24 |
|
25 |
> How you treat localisation in your ebuild depends on how the |
26 |
> application itself treats the installation of locales. Take a look at |
27 |
> net-irc/quassel for an example of an application that also uses cmake |
28 |
> as build system. Maybe there is a better way to achieve locales |
29 |
> installation but this one works. For cmake you need to know if the |
30 |
> application supports customized installation of locales by using |
31 |
> LINGUAS. Take a look in CMakelists.txt in the source for hints. |
32 |
|
33 |
The application uses qmake and it simply installs all languages (*.qm |
34 |
files) unconditionally during "make install" and loads the appropriate |
35 |
one according to the LANG env variable at runtime, falling back to |
36 |
English if one isn't available. At this time, German ("de") is the only |
37 |
one supported though (the app's built-in being English). |
38 |
|
39 |
The solution I arrived at in my ebuild is: |
40 |
|
41 |
IUSE="linguas_de" |
42 |
|
43 |
and then in src_install() I don't use the "install" make target which |
44 |
would install the *.qm files unconditionally, but rather use the other |
45 |
targets "install" depends upon, omitting "install_i18n": |
46 |
|
47 |
# Install everything except documentation and i18n. |
48 |
emake INSTALL_ROOT="${D}" install_target install_charmaps \ |
49 |
|| die "make install failed" |
50 |
# Install i18n files. |
51 |
if use linguas_de; then |
52 |
insinto "${GAMES_DATADIR}/${PN}/i18n" |
53 |
doins "${PN}_de.qm" || die "doins ${PN}_de.qm failed" |
54 |
fi |
55 |
|
56 |
It works. I assume putting linguas_de directly in IUSE is correct? |