Setting up locale

Arch based Porteus community project
Post Reply
M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Setting up locale

Post#1 by M. Eerie » 04 Feb 2018, 15:27

I've tried to

Code: Select all

setup-locale
with no success. A module is built, but the language still is english.

How do I ???

:%)

(Also how can I save Numlock state?)

Thanks

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1513
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

Setting up locale

Post#2 by ncmprhnsbl » 04 Feb 2018, 23:27

yeah, this function is not currently implemented ie:

Code: Select all

$pserver/$arch/current/export/locales
does not exist..
i have the exported locales(stripped from base modules).
i'll ask brokenman about uploading them to the server...
M. Eerie wrote:
04 Feb 2018, 15:27
how can I save Numlock state?
do:

Code: Select all

root #rc-update add numlock default
root #/etc/init.d/numlock start
then save /etc/runlevels/default/numlock (which is a symlink) to a module..
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Setting up locale

Post#3 by M. Eerie » 09 Feb 2018, 21:13

Thank you!
:)

M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Setting up locale

Post#4 by M. Eerie » 09 Mar 2018, 17:17

Further investigating, I've found that /etc/profile.d/locale.sh contains several variables:
LC_ALL=C
LC_CTYPE
LANG

and so on.

Should I made changes there in order to export locale variables to the whole system?

Concerning to switch numlock on when desktop is alive:
ncmprhnsbl wrote:
04 Feb 2018, 23:27
then save /etc/runlevels/default/numlock (which is a symlink) to a module..
I've followed those steps with no luck.

I've check it out the numlock script, and found that is looking for /dev/vc(...) but they don't exists in filesystem.

(Sorry for the double-trouble)

Cheers!

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1513
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

Setting up locale

Post#5 by ncmprhnsbl » 09 Mar 2018, 22:03

M. Eerie wrote:
09 Mar 2018, 17:17
Further investigating, I've found that /etc/profile.d/locale.sh contains several variables:
LC_ALL=C
LC_CTYPE
LANG
and so on.

Should I made changes there in order to export locale variables to the whole system?
you could be right, here's what artix wiki https://wiki.artixlinux.org/Main/Instal ... figuration says:
Generate locales:

Code: Select all

 nano /etc/locale.gen  <- uncomment your locale
 locale-gen
To set the locale systemwide, edit /etc/profile.d/locale.sh (which is sourced by /etc/profile) or /etc/bash/bashrc.d/artix.bashrc or /etc/bash/bashrc.d/local.bashrc; user-specific changes may be made to their respective ~/.bashrc, for example:

Code: Select all

 export LANG="en_US.UTF-8"
 export LC_COLLATE="C"
looking at /usr/local/bin/setup-locales-live, it mentions localectl, which i guess is a systemd thing(therefore a leftover from a previous nemesis(systemd)version...

anyway heres the full locales .xzm : link 53mb
just extract it and grab the /usr/share/locales/? folder you need, and try editing /etc/locales.gen(uncomment the relevant one) and edit /etc/profile.d/locale.sh
and see how that goes
M. Eerie wrote:
09 Mar 2018, 17:17
I've check it out the numlock script, and found that is looking for /dev/vc(...) but they don't exists in filesystem.
not in the live filesystem? i'll have to look into it...
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Setting up locale

Post#6 by M. Eerie » 11 Mar 2018, 09:12

Thank you so much, ncmprhnsbl

Refering to
M. Eerie wrote:
09 Mar 2018, 17:17
/dev/vc(...) but they don't exists in filesystem
forget it. It happened in another (older) computer, but haven't see it again.

Thanks again.

M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

2018 Updated Nemesis Base Modules

Post#7 by M. Eerie » 04 Aug 2018, 15:03

ncmprhnsbl, I've managed to wipe my previous Nemesis usb key, and no way to recover from it.

How can I build spanish locales from scratch?

I've been unsuccessful trying to build with locale-gen both with guest/root users.

Thanks!

(Also numlock issue remains)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1513
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

2018 Updated Nemesis Base Modules

Post#8 by ncmprhnsbl » 04 Aug 2018, 23:38

hi M. Eerie, do you have the module from here: Setting up locale (Post by ncmprhnsbl #63133) ?
and the numlock instructions in that thread not working?
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

2018 Updated Nemesis Base Modules

Post#9 by M. Eerie » 05 Aug 2018, 21:24

ncmprhnsbl wrote:
04 Aug 2018, 23:38
do you have the module from here
Yes, I have it.

I think I've set locale to es-ES.utf8 but your module only provides es-ES

Checking...

EDIT: No way

Code: Select all

bash: warning: setlocale: LC_ALL: cannot change locale (es_ES)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1513
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

2018 Updated Nemesis Base Modules

Post#10 by ncmprhnsbl » 06 Aug 2018, 02:39

"setlocale" i presume, is haskell-setlocale, that you added?
i have little to no knowledge about language/locale setting, being an ignorant monolingual ;)
you have done this bit first? :

Code: Select all

 nano /etc/locale.gen  <- uncomment your locale
 locale-gen
further reference:
https://wiki.artixlinux.org/Main/Instal ... figuration
https://wiki.archlinux.org/index.php/Locale
https://jlk.fjfi.cvut.cz/arch/manpages/man/setlocale.3
(i'll probably move these post to the locale topic) done
EDIT:
i messed about some more and have put together a es_ES locale module for you, that appears to work..
uploading it now (and updated base modules)
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1513
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

Setting up locale

Post#11 by ncmprhnsbl » 06 Aug 2018, 08:47

M. Eerie, here is a locale module to try:
es_ES-locale.xzm 1.4 MB
md5sum: 9436d4f9e75779e1993a5dc62068a01e
contents: (not certain everything is needed)

Code: Select all

es_ES-locale
|-- etc
|   |-- bash
|   |   `-- bashrc.d
|   |       `-- porteus.bashrc
|   `-- locale.gen
`-- usr
    |-- lib
    |   `-- locale
    |       `-- locale-archive
    `-- share
        |-- i18n
        |   `-- locales
        |       `-- es_ES
        `-- locale
            |-- es
            |   |-- LC_MESSAGES
            |   |   |-- ConsoleKit2.mo
....................................................................many .mo
            |   |   `-- xkeyboard-config.mo
            |   `-- LC_TIME
            |       `-- coreutils.mo -> ../LC_MESSAGES/coreutils.mo
            `-- es_ES
                `-- LC_MESSAGES
                    `-- libvisual-0.4.mo

15 directories, 125 files
i'll write up the process in a howto...
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

M. Eerie
Samurai
Samurai
Posts: 102
Joined: 31 Aug 2017, 21:18
Distribution: APorteus BUDGIE x64

Setting up locale

Post#12 by M. Eerie » 06 Aug 2018, 18:10

ncmprhnsbl wrote:
06 Aug 2018, 08:47
i'll write up the process in a howto...
Thank you so much. Worked like a charm.

:good: :beer:

My xfce4-terminal is throwing this message:

Code: Select all

grep: /etc/porteus.d/login: No existe el fichero o el directorio


"grep: /etc/porteus.d/login: file or directory doesn't exists "

Found that string, in:
  • /mnt/live/memory/images/es_ES-locale.xzm/etc/bash/bashrc.d/porteus.bashrc
  • /mnt/live/memory/images/002-gui-20180706.xzm/usr/local/bin/autologin
  • /mnt/live/memory/images/001-core-20180706.xzm/etc/bash/bashrc.d/porteus.bashrc
  • /mnt/live/memory/images/002-gui-20180706.xzm/usr/local/bin/xdm

Should I remove/ comment next block?

Code: Select all

# Run the cliexec command if present
CMD=`egrep -o " cliexec=[^ ]+" /proc/cmdline | cut -d= -f2 | tr "~" " "`
[ -z "$CMD" ] && CMD=`grep "^cliexec=" /etc/porteus.d/login| cut -d'=' -f2`
[ "$CMD" ] && { echo "Starting 'cliexec=' commands"; su - -c "$CMD"; }
Also I've noticed these lines:

Code: Select all

#set es_ES locale
export LANG="es_ES.UTF-8"
export LC_COLLATE="C"
Shouldn't be LC_COLLATE set to es_ES.UTF-8 as well ?

Thanks again.

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 1513
Joined: 20 Mar 2012, 03:42
Distribution: 4.0-64bit all-DE+more
Location: australia
Contact:

Setting up locale

Post#13 by ncmprhnsbl » 06 Aug 2018, 22:53

M. Eerie wrote:
06 Aug 2018, 18:10
"grep: /etc/porteus.d/login: file or directory doesn't exists "
the question is: why isn't this there? /etc/porteus.d and it's contents should be created at boot via scripts in initrd
M. Eerie wrote:
06 Aug 2018, 18:10
Shouldn't be LC_COLLATE set to es_ES.UTF-8 as well ?
quite possibly
arch wiki says: https://wiki.archlinux.org/index.php/Lo ... _collation
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply