Change language

6 posts / 0 new
Last post
#1 Sun, 2017-12-10 15:11
remy_dev
  • remy_dev's picture
  • Offline
  • Last seen: 2 months 3 days ago
  • Joined: 2017-12-10

Hello,

I'm looking for information on the possibility of changing the language.
I would like to change the office language with xfce.
There is no /etc/local file as on debian, so I don't even know if the language change is planned in Alpine my searches under "language" doesn't return anything.

Thanks

Mon, 2017-12-11 01:32
ReproducibleBui...
  • ReproducibleBuildsAreAGoodStandard's picture
  • Offline
  • Last seen: 1 month 3 weeks ago
  • Joined: 2017-05-05

Alpine Linux uses musl instead of the more commonplace glibc, and musl doesn't generally support locales yet: some answers have come up before here and here , for instance, and indeed there isn't a dedicated Alpine wiki page yet.

Some workarounds seem to have been mentioned in this Alpine IRC page (search for 'locale'), which could be useful if you are using XFCE. To know how to write 'export' lines for localizations, you could see read this, but keep in mind that Gentoo doesn't use Musl.

Could the following steps help you, for example, for French menus in an XFCE environment?
1. Add the following lines to /etc/xdg/xfce4/xinitrc (sudo rnano -w /etc/xdg/xfce4/xinitrc):
export LANG="fr_FR.utf8"
export LC_COLLATE="C"

2. Make a new local .xinitrc file:
sudo cp -fv /etc/xdg/xfce4/xinitrc ~/.xinitrc
chown myusername:myusername ~/.xinitrc

3. You may also want to search for - and then install - some language packages:
apk search -- -lang

4. Reboot

An alternative for, say, French in XFCE may be to replace step 1, and perhaps avoid step 2 above, with the following. Setxkbmap is in the edge repository, so the next instruction should run if you are using the edge version:
sudo apk add setxkbmap
Otherwise, you have to ensure from the wiki that that repository is pinned as, say, @edge and then do sudo apk add setxkbmap@edge or see the wiki on how to install packages from a set repository.
setxkbmap fr
Then add the last instruction into /etc/xdg/xfce4/xinitrc

How did this go?

Best wishes!

Mon, 2017-12-11 09:06
remy_dev
  • remy_dev's picture
  • Offline
  • Last seen: 2 months 3 days ago
  • Joined: 2017-12-10

Thanks for this message

Mon, 2017-12-11 10:49
remy_dev
  • remy_dev's picture
  • Offline
  • Last seen: 2 months 3 days ago
  • Joined: 2017-12-10

I tryed your manipulation, and great French is what is wish!

the commande setxkbmap fr return
 Cannot open display "default display"

but i add

 export LANG="fr_FR.utf8"
 export LC_COLLATE="C"

to the .xinitrc user file, for now it's the same result.
But i didn't do the step 3
apk search -- -lang

I don't understand what i have to install, is it a global lang pakage or multiple, like one by application ?

Thanks

Tue, 2017-12-12 00:38 (Reply to #4)
ReproducibleBui...
  • ReproducibleBuildsAreAGoodStandard's picture
  • Offline
  • Last seen: 1 month 3 weeks ago
  • Joined: 2017-05-05

Hi Remy,
1. A major useful step could be:-
apk search -- -lang | sort
This is the same instruction as above, but with the results sorted alphabetically. This could help one find and decide which language packs in a clearer way that would be relevant to one's installation. NB: Even for people who aren't using the XFCE desktop environment, but rather a minimalist desktop environment, the xfdesktop-lang package could be helpful (my chromium browser running in a jwm window manager displayed French menus with this package when also using the 'export' instructions above; I don't know if the 'export' variable would have been sufficient, however).

Other useful desktop environment and display manager language packages could be:-

gnome-desktop-lang
lightdm-lang
lxdm-lang
lxsession-lang
mate-desktop-lang
openbox-lang

So for XFCE desktops, or for minimalist environments, perhaps the following could help:
sudo apk add xfdesktop-lang

You can also decide on additional packages to install from the apk search above. For example:
sudo apk add libreoffice-lang-fr mousepad-lang

2. I don't know how to solve setxkbmap fr returning "Cannot open display "default display". I get no error message. However:-
a) Did you install setxkbmap first, as indicated? Maybe you need to reboot, or exit that shell (i.e.'terminal') first.
b) Maybe this might help, but perhaps change .bashrc instances to .ashrc:
c) Perhaps remove (and reinstall?) xdrp, if it is installed?

3. You report no change when adding export variables to .xinitrc. Are you using a display manager (lxdm, lightdm, etc.)? If not, like me, then maybe the .xinitrc file is irrelevant (I don't have an .xinitrc file). Try adding those two export lines to ~/.profile instead. I'm no expert, but if ~/.profile does not exist, you might want to do:-
sudo cp /etc/profile ~/.profile
sudo chown myusername:myusername ~/.profile

Note: If anyone needs to revert to the standard US keyboard, try:
setxkbmap us

Tue, 2017-12-12 12:09
remy_dev
  • remy_dev's picture
  • Offline
  • Last seen: 2 months 3 days ago
  • Joined: 2017-12-10

I don't understand why setxkbmap fr give me an error,

But your other settings works for me.
A add :

apk add xfdesktop-lang

and in the ~/.profile file, i add

export LANG="fr_FR.utf8"
 export LC_COLLATE="C"

It's goot
Thanks

Log in or register to post comments