Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: emninger on November 05, 2015, 04:27:58 PM

Title: getlocale.sh
Post by: emninger on November 05, 2015, 04:27:58 PM
How does getlocale exactly work. I startet the script and activated the 3 locale which im interested in, ie.

Code: [Select]
de_DE.UTF-8
de_DE/ISO-8859-1
de_DE@euro/ISO-8859-15

In extlinux i set
Code: [Select]
lang=de_DE
Now, i see, not for all extensions there are also locales.tcz. But for those, which exist, shouldn't it work automatically? Is it presumed to put the locales.tcz in the bootlist? Or, for those ondemand in /tce/ondemand/ ?

I rebooted several times, but not one program with an existing locale is shown up in german ... (??)
Title: Re: getlocale.sh
Post by: Misalf on November 05, 2015, 04:45:42 PM
Correct. A  *-locale.tcz  will be loaded automatically if present in  /etc/sysconfig/tcedir/optional  and if the  lang=  boot code was used (or if $LANG was set another way).
Code: [Select]
if [ "$LANG" != "C" ]; then
LOCALEEXT="${1%.tcz}-locale.tcz"
[ -f "$LOCALEEXT" ] && install "$LOCALEEXT"
fi

It depends on the extension if German translation is actually provided though.
I know it works for Xfe.
Title: Re: getlocale.sh
Post by: emninger on November 05, 2015, 05:13:47 PM
Thanks for the explanation; the script you provided, should i put it in /sda1/opt (where .filelist and .xfilelist sit) or start it from within bootlocal.sh ?
Title: Re: getlocale.sh
Post by: Misalf on November 05, 2015, 05:25:05 PM
No. That's already part of tce-load.

Which extensions did you test and did you download their respective *-locale.tcz?
Title: Re: getlocale.sh
Post by: emninger on November 05, 2015, 06:09:14 PM
It continues to not work for me: To be completely coherent, i changed getlocale.sh and chose only one option (de_DE/ISO-8859-1) and set lang=de_DE in the bootcode.

I tried the existing locales for:
XFE
Viewnior
lxrandr
vlc
nano
Title: Re: getlocale.sh
Post by: curaga on November 06, 2015, 06:47:35 AM
To check it's working, type "locale". There should be no errors.
Title: Re: getlocale.sh
Post by: emninger on November 06, 2015, 07:25:16 AM
That's what i get:

Code: [Select]
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de
LC_CTYPE="de"
LC_NUMERIC="de"
LC_TIME="de"
LC_COLLATE="de"
LC_MONETARY="de"
LC_MESSAGES="de"
LC_PAPER="de"
LC_NAME="de"
LC_ADDRESS="de"
LC_TELEPHONE="de"
LC_MEASUREMENT="de"
LC_IDENTIFICATION="de"
LC_ALL=
Title: Re: getlocale.sh
Post by: curaga on November 06, 2015, 07:41:48 AM
Then something is wrong. "locale -a" will list valid options, "de" is not a valid one.
Title: Re: getlocale.sh
Post by: emninger on November 06, 2015, 03:28:12 PM
Then something is wrong. "locale -a" will list valid options, "de" is not a valid one.

I restarted getlocale.sh, chose de_DE, de_DE.UTF-8, de_DE@euro, set lang=de_DE@euro in the bootcodes, but the result remains the same.

May be, there is some config file which is not covered by my backup setup? What does getlocale.sh exactly do?
Title: Re: getlocale.sh
Post by: curaga on November 06, 2015, 04:18:37 PM
getlocale.sh generates the locale archive extension, containing those locales you chose. The bootcode then activates one of them.

If locale claims it is "de", then you have two lang= bootcodes, with one being wrong perhaps?
Title: Re: getlocale.sh
Post by: emninger on November 06, 2015, 04:27:56 PM
This is my extlinux.conf:
Code: [Select]
DEFAULT core
LABEL core
KERNEL /tce/boot/vmlinuz
APPEND initrd=/tce/boot/core.gz quiet lang=de_DE@euro waitusb=10:UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" tce=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" restore=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" swapfile=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" home=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" opt=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" local=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" tz=CET-1CEST,M3.5.0,M10.5.0/3 showapps blacklist=b43,ssb,bcma noautologin

(I even left out kmap=de to not create eventual confusion; which, otoh, in any case seem to not have any effect on the console, which despite that setting still uses english/us keymap. Aterm uses the lower 128 ascii of the german keyboard, but i think, aterm is an X application and therefore controlled by the keyboard setting of X).
Title: Re: getlocale.sh
Post by: coreplayer2 on November 06, 2015, 08:54:56 PM
Looking through the list of valid lang settings i didn't see this   
Quote
lang=de_DE@euro
 

also I don't believe the "local=" boot code is valid either..

I think we said earlier that showapps is only for diagnostic purposes as it delays the boot process a little


corrected boot code
Code: [Select]
DEFAULT core
LABEL core
KERNEL /tce/boot/vmlinuz
APPEND initrd=/tce/boot/core.gz quiet lang=de_DE waitusb=10:UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" tce=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" swapfile=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" home=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" opt=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" tz=CET-1CEST,M3.5.0,M10.5.0/3 blacklist=b43,ssb,bcma noautologin

:)
Title: Re: getlocale.sh
Post by: emninger on November 07, 2015, 02:25:18 AM
But getlocale.sh says:

Code: [Select]
Now processing... /
Locales installed. Creating extension... |

Done. The extension is at /mnt/sda1/tce/optional/mylocale.tcz and in onboot.lst
Reboot with lang=xyz (for example lang=de_DE@euro) to start using this.


Press enter to quit.

In any case, i tried all, but to no extent. The result of
Code: [Select]
~$ locale is:
Code: [Select]
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de
LC_CTYPE="de"
LC_NUMERIC="de"
LC_TIME="de"
LC_COLLATE="de"
LC_MONETARY="de"
LC_MESSAGES="de"
LC_PAPER="de"
LC_NAME="de"
LC_ADDRESS="de"
LC_TELEPHONE="de"
LC_MEASUREMENT="de"
LC_IDENTIFICATION="de"
LC_ALL=

I suspect there might be somewhere a rest of the previous (default) Xvesa setup, because at the end of the boot process i get the - obviously harmless - prompt:
Code: [Select]
xset: unable to open display ""
Title: Re: getlocale.sh
Post by: emninger on November 07, 2015, 05:01:23 AM
Some additional info. When i do APPS > Maintainance > Check for Updates i see there this error msg:

Quote
Error Could not verify mylocale.tcz
. Why? And what does that mean?
Title: Re: getlocale.sh
Post by: Juanito on November 07, 2015, 05:35:28 AM
mylocale is the local extension created by running the script from the getlocale extension.

mylocale doesn't exist in the repo, hence the error message.
Title: Re: getlocale.sh
Post by: emninger on November 07, 2015, 05:47:15 AM
I understand. Thanks! :)
Title: Re: getlocale.sh
Post by: curaga on November 07, 2015, 07:33:34 AM
Something in your system is causing LANG to be "de". If it's not your bootloader, then it must be something in your backup or home dir.
Title: Re: getlocale.sh
Post by: emninger on November 07, 2015, 07:48:15 AM
Something in your system is causing LANG to be "de". If it's not your bootloader, then it must be something in your backup or home dir.

But what? Do you have, by chance, an idea, where i could look?

Thanks a lot in advance.
Title: Re: getlocale.sh
Post by: Juanito on November 07, 2015, 08:09:00 AM
If you're using a backup, then you can use the "norestore" boot code to boot without restoring your backup and check if the problem disappears.
Title: Re: getlocale.sh
Post by: gerald_clark on November 07, 2015, 08:47:58 AM
Make sure you do not have etc in your .filetool.lst.
Title: Re: getlocale.sh
Post by: Rich on November 07, 2015, 09:01:37 AM
Hi emninger
In my comments about the results of the  showbootcodes  command here:
http://forum.tinycorelinux.net/index.php/topic,19088.msg117402.html#msg117402
I stated:
Quote
Code: [Select]
home=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f" opt=UUID="3b305a3c-d95b-4f80-b1fa-b7baaf7db06f"These two items specify that you have persistant  /home  and  /opt  directories, so they don't need to be included in
your backup. Open your  filetool.lst  file, remove any lines beginning with  home  or  opt, then run a backup.
Did you correct your  filetool.lst  file?
Title: Re: getlocale.sh
Post by: emninger on November 07, 2015, 11:39:56 AM
I believed i did, but effectively, i did not. Now it's corrected ;)
Title: Re: getlocale.sh
Post by: emninger on November 07, 2015, 12:12:03 PM
But nevertheless the error msg after
Code: [Select]
# locale persists ... :-(
Title: Re: getlocale.sh
Post by: emninger on November 08, 2015, 07:37:10 AM
It's funny: Abiword (although there is no locale extension) shows up in german skin?

PS. But apparently there is missing some functionality (?)