Language problems again [Solved]

Discussion in general that pertains to Sabayon Linux - Must Pertain to Sabayon Linux

Moderator: Moderators

msdobrescu
Old Dear Hen
Posts: 876
Joined: Sun Aug 21, 2011 8:48

Language problems again [Solved]

Post by msdobrescu » Sun Mar 29, 2020 8:27

Hello,

I have two systems. They seem to behave differently for the same language settings, or at least I can't figure out where is the difference in settings.
I prefer to have the system in English, but the right region set to where I live in order to get the formats and time accordingly.

System A: Everything looks fine, KDE in English (as the single language installed), shells in English, Rigo in English, GTK apps in English.
KDE American English language is set in the KDE settings, alone.
Only the region set to Romania.

Code: Select all

locale
LANG=ro_RO.UTF-8
LC_CTYPE="ro_RO.UTF-8"
LC_NUMERIC="ro_RO.UTF-8"
LC_TIME="ro_RO.UTF-8"
LC_COLLATE="ro_RO.UTF-8"
LC_MONETARY="ro_RO.UTF-8"
LC_MESSAGES="ro_RO.UTF-8"
LC_PAPER="ro_RO.UTF-8"
LC_NAME="ro_RO.UTF-8"
LC_ADDRESS="ro_RO.UTF-8"
LC_TELEPHONE="ro_RO.UTF-8"
LC_MEASUREMENT="ro_RO.UTF-8"
LC_IDENTIFICATION="ro_RO.UTF-8"
LC_ALL=
USC /home/admius # localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us,ro
     X11 Variant: ,
System B: The region is set also in Romanian.
KDE seems to be switched 99% to Romanian, few still in English or not yet translated in Romanian.
KDE American English language is set in the KDE settings, only.
Shells give also various results. So GTK.
Rigo definitely in Romanian.
I'd say the translations are set in Romanian, or remained so.

Code: Select all

locale
LANG=ro_RO.UTF-8
LC_CTYPE="ro_RO.UTF-8"
LC_NUMERIC="ro_RO.UTF-8"
LC_TIME="ro_RO.UTF-8"
LC_COLLATE="ro_RO.UTF-8"
LC_MONETARY="ro_RO.UTF-8"
LC_MESSAGES="ro_RO.UTF-8"
LC_PAPER="ro_RO.UTF-8"
LC_NAME="ro_RO.UTF-8"
LC_ADDRESS="ro_RO.UTF-8"
LC_TELEPHONE="ro_RO.UTF-8"
LC_MEASUREMENT="ro_RO.UTF-8"
LC_IDENTIFICATION="ro_RO.UTF-8"
LC_ALL=
USC /home/admius # localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: us
      X11 Layout: us
I've added Romanian in KDE, removed English, added back English, set English as default, removed Romanian again.
Nothing changes.

I've tried en_US.utf8 instead of en_US.UTF-8 too.
Nothing changes.

What can I do? Is there script/command to reset/recompile the translations?
Last edited by msdobrescu on Sat Jun 13, 2020 8:18, edited 1 time in total.

User avatar
sabayonino
Sagely Hen
Posts: 3540
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Language problems again

Post by sabayonino » Fri Apr 24, 2020 21:57

Manage language settings running localectl

Code: Select all

# localectl
System Locale: LANG=it_IT.UTF-8
       VC Keymap: it2
      X11 Layout: it
       X11 Model: pc105

Example

Code: Select all

# localectl list locales
C.utf8
en_US
en_US.iso88591
en_US.utf8
it_IT
it_IT.iso88591
[email protected]
it_IT.utf8
[email protected]
Set your locale [For me IT ]

Code: Select all

# localectl set-locale it_IT.utf8
Or

Code: Select all

# eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   C.utf8
  [3]   en_US
  [4]   en_US.iso88591
  [5]   en_US.utf8
  [6]   it_IT
  [7]   [email protected]
  [8]   it_IT.iso88591
  [9]   [email protected]
  [10]  it_IT.utf8
  [11]  POSIX
  [12]  it_IT.UTF-8 *
  [ ]   (free form)

Code: Select all

# eselect locale set 12
KDE : be sure you have installed : kde-frameworks/ki18n

Keymaps :

Code: Select all

# localectl list-keymaps

For Romanian :

Code: Select all

ro
ro_std
ro_win
Set the keymap

Code: Select all

# localectl set ro
For X11

Code: Select all

# localectl  list-x11-keymap-layouts
[...]
ro
[...]
Set X11 keymap

Code: Select all

# set-x11-keymap ro
No need to restart or reboot


Packages with external language modules [Romanian]

Code: Select all

equo s l10n-ro -qv
app-office/libreoffice-l10n-ro-6.3.4.2
www-client/firefox-l10n-ro-66.0.5
www-client/firefox-l10n-ro-67.0
www-client/firefox-l10n-ro-67.0.4
www-client/firefox-l10n-ro-68.0
www-client/firefox-l10n-ro-68.0.1
www-client/firefox-l10n-ro-68.0.2
www-client/firefox-l10n-ro-69.0
www-client/firefox-l10n-ro-69.0.1
www-client/firefox-l10n-ro-70.0
www-client/firefox-l10n-ro-70.0.1
www-client/firefox-l10n-ro-71.0
www-client/firefox-l10n-ro-72.0.1
www-client/firefox-l10n-ro-72.0.2
www-client/firefox-l10n-ro-73.0
www-client/firefox-l10n-ro-73.0.1
www-client/firefox-l10n-ro-74.0-r1
KDE and other stuffs have their own builtin modules. check if they were compiled with your language support in
/etc/portage/make.conf
L10N
and
LINGUAS
variables

msdobrescu
Old Dear Hen
Posts: 876
Joined: Sun Aug 21, 2011 8:48

Re: Language problems again

Post by msdobrescu » Sat Apr 25, 2020 4:14

Thanks, done, nothing changes.

Actually, I did those, before, except the /etc/portage/make.conf.

The system that has the problem has no make.conf at all. Actually, the following are missing:

Dirs:

Code: Select all

env
package.env
FIles:

Code: Select all

make.conf
make.conf.amd64
make.conf.x86
NOTES
package.env.amd64
package.env.x86
package.license

User avatar
sabayonino
Sagely Hen
Posts: 3540
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Language problems again

Post by sabayonino » Sat Apr 25, 2020 11:30

All romanian localized applications are located in
/usr/share/locale/ro/LC_MESSAGES

Please make sure you've setup your "ro" localization as I explained on my previous posts

and try to change

Code: Select all

LANG=ro_RO.UTF-8
in your /etc/env.d/02locale

then run

Code: Select all

# env-update

msdobrescu
Old Dear Hen
Posts: 876
Joined: Sun Aug 21, 2011 8:48

Re: Language problems again

Post by msdobrescu » Sat Apr 25, 2020 12:50

Thanks, but... it is actually ... al contrario.
I have set Romanian as region, and English for UI. But I've got something mixed in the UI and I need English in the UI, not Romanian, or other language I might have installed for spelling, for example.

This is the strange thing, it seems I have set the desired locales, but the UI was not properly updated for some reason.
env-update did not change it either.

User avatar
sabayonino
Sagely Hen
Posts: 3540
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Language problems again

Post by sabayonino » Sat Apr 25, 2020 15:54

Applications check for $LANG environment variable

you can try this :

in your ~/.bashrc add

Code: Select all

# export LANG="en_US.UTF-8"
(or us_US.UTF-8)

to set and forced your environment lang to us_US.UTF-8

Do the same thing for the /root/.bashrc for the root applications if needed.

Hope it help

Sorry but I understand you've have a problem with mixed language results . I didn't think it was your need

This is a fast workaround . I don't know if there are other setup to do this.

Alternatives is to run the UI application(s) running :

Code: Select all

$ LANG="us_US.UTF-8" <application>
or

Code: Select all

$ LANG="us_US" <application>
or simply

Code: Select all

 LANG="us" <application>
(or other language you need if the program is compiled with that support)


Example , running Firefox with us_US UI

Code: Select all

$ LANG="us_US" firefox
If LANG variable doesn't work , try LANGUAGE instead

Hope it can help you


Edit :
[edit]
I see that you LANGUAGE environment variable is not set
try to export

Code: Select all

export LANGUAGE="us"
in your ~.bashrc

or try to set this in
/etc/env.d/02locale

02locale

Code: Select all

LANG="...."
LANGUAGE="us"
...

Code: Select all

# env-update

PPS : for me :

Code: Select all

LANG="us"  falkon 
Doesn't take effect .. falkon is localized as Italian

but

Code: Select all

LANGUAGE="en" falkon
Now falkon is localized as English


I think that not all applications check for LANG variable only
Examples RIGO is localized as English if I run

Code: Select all

LANG="en" rigo

msdobrescu
Old Dear Hen
Posts: 876
Joined: Sun Aug 21, 2011 8:48

Re: Language problems again

Post by msdobrescu » Sat Apr 25, 2020 16:46

I think you are on the track.

The working system:

Code: Select all

set |grep LANG
LANG=ro_RO.UTF-8
LANGUAGE=en_US
The not working system:

Code: Select all

set |grep LANG
LANG=ro_RO.UTF-8
LANGUAGE=
But, on the working system, LANGUAGE is not set in /etc/env.d/02locale. I wonder where is that?
Where else could that be?

I could find a lot of articles over the Internet for the LANG variale, but not for LANGUAGE.

User avatar
sabayonino
Sagely Hen
Posts: 3540
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Language problems again

Post by sabayonino » Sat Apr 25, 2020 17:13

Try to setup LANGUAGE environment variable in /etc/env.d/02locale

I think it depend on calamares installer and its setup

Code: Select all

[...]
    # run locale-gen if detected; this *will* cause an exception
    # if the live system has locale.gen, but the target does not:
    # in that case, fix your installation filesystem.
    if os.path.exists('/etc/locale.gen'):
        rewrite_locale_gen(target_locale_gen, target_locale_gen, locale_conf)
        libcalamares.utils.target_env_call(['locale-gen'])
        libcalamares.utils.debug('{!s} done'.format(target_locale_gen))
        [...]

msdobrescu
Old Dear Hen
Posts: 876
Joined: Sun Aug 21, 2011 8:48

Re: Language problems again

Post by msdobrescu » Sat Apr 25, 2020 17:18

I see a definition in /~/.config/plasma-locale-settings.sh.
It might be not run, but how could I check that?

User avatar
sabayonino
Sagely Hen
Posts: 3540
Joined: Sun Sep 21, 2008 1:12
Location: Italy
Contact:

Re: Language problems again

Post by sabayonino » Sat Apr 25, 2020 17:26

Again ... fix you LANGUAGE environment var

Code: Select all

# localectl set-locale LANGUAGE="us"
You'll get something like this

Code: Select all

cat /etc/env.d/02locale
LANG=it_IT.UTF-8
LANGUAGE=us

Code: Select all

cat ~/.config/plasma-locale-settings.sh
# Generated script, do not edit
# Exports language-format specific env vars from startkde.
# This script has been generated from kcmshell5 formats.
# It will automatically be overwritten from there.
export LANG=it_IT.UTF-8
export LC_NUMERIC=it_IT.UTF-8
export LC_TIME=it_IT.UTF-8
export LC_MONETARY=it_IT.UTF-8
export LC_MEASUREMENT=it_IT.UTF-8
export LANGUAGE=it

Code: Select all

LANG="us" kcmshell5 --help | grep lang
  --lang <language>          Specify a particular language
And again

Code: Select all

 LANG="us" kcmshell5 --lang us about-distro
--lang is deprecated. Please set the LANGUAGE environment variable instead



And see possible different results running :

Code: Select all

LANG="us" kcmshell5  about-distro

< TITLE GUI IS LOCALIZATED IN ITALIAN  >

Operating System: Gentoo Linux 
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Kernel Version: 5.4.0-sabayon
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15,1 GiB of RAM

< SOME GUI BUTTONS ARE LOCALIZATED IN ITA  , OTHER IN ENGLISH>

Code: Select all

LANGUAGE="us" kcmshell5  about-distro

< WINDOW TITLE IS LOCALIZATED IN ENGLISH >

Sistema operativo: Gentoo Linux 
Versione di KDE Plasma: 5.18.3
Versione di KDE Frameworks: 5.67.0
Versione di Qt: 5.14.1
Versione del Kernel: 5.4.0-sabayon
Tipo sist.operativo: 64-bit
Processori: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memoria: 15,1 GiB di RAM

< SOME GUI BUTTONS ARE LOCALIZATED IN ENGLISH , OTHER IN ITA >

Code: Select all

LANG="us" LANGUAGE="us" kcmshell5  about-distro

< ALL GUI PARTS ARE LOCALIZATED IN ENGLISH >

Operating System: Gentoo Linux 
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Kernel Version: 5.4.0-sabayon
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz
Memory: 15,1 GiB of RAM


< ALL GUI BUTTONS ARE LOCALIZATED IN  ENGLISH >

Multiple parts of the system are split to different localziation modules

Post Reply