Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 20 Oct 2014, 18:54
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
internationalization of initrd messages at bootup
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 4 [52 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Author Message
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 13 Dec 2011, 13:54    Post subject: multi-byte char ↓ (arrow down) in initrd  

amigo wrote:
They should remain separate -I have a 'de' keyboard but use English and I imagine there are others that do similar.


Sorry, I have no idea what you wanted to tell me Rolling Eyes

In his blog BarryK wrote:
However, 'echo' strings would probably have to stay as ascii only, as I have not yet configured Busybox as multi-byte aware (I did experiment with that awhile back but rolled back).


This was meant to be just a little demonstration of using a multi-byte char in busybox successfully Smile

Last edited by L18L on Tue 13 Dec 2011, 14:07; edited 1 time in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 13 Dec 2011, 14:06    Post subject: little chunks  

technosaurus wrote:
also you can use read -t <seconds>

but here is are a couple little chunks

Code:
cd $DIR
i=0; for x in *; do i=$(($i+1)) && echo "( $i ) $x"; done

read -t 10 x
echo * |awk '{print $'${x:-$defaultvalue}'}'


I will be able to use them as replacements for ls and pause Smile
Thank you.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Mon 13 Feb 2012, 14:04    Post subject: internationalization of initrd messages at bootup
Subject description: using t12s now
 

# pwd
/initrd/mnt/dev_save/racy5225
# ls -l initrd.gz*
-rw-r--r-- 1 root root 3477530 2012-02-13 13:51 initrd.gz
-rw-r--r-- 1 root root 3475506 2012-02-09 12:00 initrd.gz.orig
#

What was added?

usr/share/locales/de/init (complete)
usr/share/locales/ru/init (just some automatically translated phrases)

# pwd
/initrd/mnt/dev_save/racy5225/puppy-init/usr/share/locales/ru
# cat init
#Pусский
_M_17="смогли"
_M_2="'${1}' проверки файловой системы, пожалуйста, подождите ..."
_M_22="Загрузка драйвера, необходимые для доступа к дискам"
_M_25="Загрузка '${PKEYS}' раскладку клавиатуры..."
_M_36="Загрузка драйвера, необходимые для доступа к дискам"
_M_37="Поиск Puppy файлы..."
_M_9="сделал"
#

Important: 1st line has to have name of language as a comment (ex: #Pусский), this is used in a menu.

What else was added?

LatGrkCyr-8x16.psfu.gz a font for LatinGreekCyrillic

Changes in script init:

- New boot parameter plang for language (ex: de or ru)

- If plang is not set then there is a menu for choosing from included languages.

- OUTPUT_CHARSET=UTF-8 is passed through to puppy.
This enables correct output also if utf8 is NOT activated.
Tested successfully with pizzasgood´s retrovol (C code)
and puppy will immediately start in the chosen language

_____________
edited
Other languages

Extract attachment and start
Code:
t12s init

Translation file init will be in /usr/share/locales/<language>


__________________________
edited
update see 2 posts down please
addition_to_initrd.tar.gz
Description 
gz

 Download 
Filename  addition_to_initrd.tar.gz 
Filesize  33.02 KB 
Downloaded  285 Time(s) 

Last edited by L18L on Tue 14 Feb 2012, 09:08; edited 1 time in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 14 Feb 2012, 07:54    Post subject: internationalization of initrd messages at bootup
Subject description: other Languages
 

As there are some issues using the script t12s here is an altenative method for all who like to boot up in their own language (sorry: no Chinese, Japanese, Korean).
Arab and Hebrew use text editor yudit.
French: Deja fait par esmourguit

Just translate the following lines to your language.
1st line: your language in your language.
Let $.... unchanged
Post the translation here as file named
init.<your-language-code>
for inclusion in next initrd as
usr/share/locales/<your-language-code>/init

Thanks Smile

#English
_M_10="${DROPOUT} not found. Dropping out to initial-ramdisk console..."
_M_1="0 none"
_M_11="Dropped to initramfs shell. Type 'exec switch' to continue booting Puppy."
_M_12="Dumping last lines of kernel log..."
_M_13="Dumping last lines of /tmp/bootinit.log..."
_M_14="ENTER key only to copy: "
_M_15="ENTER only to upgrade: "
_M_16="ERROR: Windows NTFS hibernated partition, cannot mount"
_M_17="failed"
_M_18="Folder $ONEFOLDER marked bad."
_M_19="from version $xOLDPVERSION"
_M_20="Hit the ENTER key only if it is okay to upgrade this file, or to not use it and boot up in RAM only type any other printable character."
_M_2="'${1}' filesystem check, please wait..."
_M_21="Increasing $PUPSAVEFILE by $KILOBIG Kbytes, please wait..."
_M_22="Loading drivers needed to access disk drives"
_M_23="Loading folder $ONEFOLDER from CD/DVD..."
_M_24="Loading personal file $PUPSAVEFILE ($PUPSAVEDEV)..."
_M_25="Loading '${PKEYS}' keyboard layout..."
_M_26="Loading the '${basepupsfs}' main file..."
_M_27="Mounting encrypted $PUPSAVEFILE..."
_M_28="NOTICE: As you type your password nothing will be displayed on the screen for absolute security. Just type it in then press ENTER key..."
_M_29="Overlaying preconfig files..."
_M_30="Overwritten old files have been moved to /tmp/versioncleanup/"
_M_31="Password: "
_M_32="pausing"
_M_33="Pausing for 60 seconds..."
_M_34="Performing a 'switch_root' to the layered filesystem..."
_M_35="RAM full"
_M_36="'save file' filesystem check, please wait..."
_M_37="Searching for Puppy files..."
_M_38="Setting up the layered filesystem..."
_M_39="SORRY, cannot check filesystem"
_M_3="After bootup please examine this directory (before shutdown) for anything that you might like to recover. Pausing 30 secs so you can read this msg..."
_M_40="SORRY, cannot resize $PUPSAVEFILE"
_M_41="...successfully mounted"
_M_42="The main Puppy file '${basepupsfs}' is being loaded off the optical disc."
_M_43="then on next boot it will load fast. Type any printable char not to copy it."
_M_44="This is a radical file cleanup for broken systems, could alter some settings."
_M_45="This is a simulated version upgrade, which performs a file cleanup."
_M_46="This save-file was last used with version $OLDDISTRO_VERSION of Puppy"
_M_47="Type a number to choose which personal file to use:"
_M_48="Version update, restoring 'official' files, please wait..."
_M_49="Very slow! Type ENTER key only to copy it to the same partition as the save-file"
_M_4="Backing off, not using save-file, booting in RAM only, PUPMODE=5..."
_M_50="(with a slow CPU this may take sometime, please be patient)"
_M_51="You are upgrading Puppy ${OLDstr} to ${NEWPVERSION}."
_M_5="'${basepupsfs}' now copying to hard drive (but only available next boot)..."
_M_6="Can't mount file, press ENTER key to try again, or any other char then ENTER for f.s. check then try again, or for developers type 'quit' to drop out to console: "
_M_7="...continuing with loading $PUPSAVEFILE..."
_M_8="copying to ram"
_M_9="done"
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 14 Feb 2012, 09:07    Post subject: internationalization of initrd messages at bootup
Subject description: update
 

Menu is populated now by

Arabic (just some automatically translated phrases)
and French (complete translation by toutou´s creator esmourguit)

Font LatArCyrHeb-16.psfu.gz is added which enables Arabic and Hebrew.
addition2_to_initrd.tar.gz
Description 
gz

 Download 
Filename  addition2_to_initrd.tar.gz 
Filesize  39.18 KB 
Downloaded  291 Time(s) 
Back to top
View user's profile Send private message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Tue 14 Feb 2012, 15:05    Post subject: Russian translation  

I have made Russian translation. But it works only for three top lines. Some other file (/etc/rc.d/rc.sysinit) has to be translated for the rest.
But it's good that Russian font in console is loaded in initrd and all Russian messages in console displayed well. My unicode pet is not needed.

Edit: gettext doesn't work in /etc/rc.d/rc.sysinit.
Edit2: No. I was wrong. Gettext works in /etc/rc.d/rc.sysinit. And now all console boot messages are in Russian.
init.gz
Description  Russian translation
gz

 Download 
Filename  init.gz 
Filesize  3.33 KB 
Downloaded  302 Time(s) 
rc_sysinit.tar.gz
Description  i18n with gettext of /etc/rc.d/rc.sysinit, pot file and ru.po and mo.
gz

 Download 
Filename  rc_sysinit.tar.gz 
Filesize  12.75 KB 
Downloaded  310 Time(s) 

Last edited by rodin.s on Wed 15 Feb 2012, 07:09; edited 1 time in total
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Tue 14 Feb 2012, 16:35    Post subject: Re: Russian translation  

rodin.s wrote:
I have made Russian translation. But it works only for three top lines. Some other file (/etc/rc.d/rc.sysinit) has to be translated for the rest.
But it's good that Russian font in console is loaded in initrd and all Russian messages in console displayed well. My unicode pet is not needed.

Edit: gettext doesn't work in /etc/rc.d/rc.sysinit.


Thank you very much rodin.s,

Your way of distributing the translation file is very good. I like it,
English as comment and an empty line

Code:
#Русский
#_M_10="${DROPOUT} not found. Dropping out to initial-ramdisk console..."
_M_10="${DROPOUT} не найден. Будет запущена консоль инит-рамдиска..."

#_M_1="0 none"
_M_1="0 нет"


Yes it are usually just the first (3 ?) lines from initrd.

I have found a folder puppy_rcd_i18n made by me
dated from July 2010
containing all scripts of rc.d gettexted
was never published
but if I remember correctly it was running in puppy4.3.1 Cool

Stuff for the next days....

-----
edited
Now I have seen your change: gettext is working Very Happy Very Happy
Back to top
View user's profile Send private message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Wed 15 Feb 2012, 07:16    Post subject: Russian translation  

I have found one small mistake in my translation (variable _M_8 was _M_7). init.gz is re-uploaded.
There is one strange but positive thing. When I boot pfix=ram and choose ru in initrd I got quicksetup in Russian while locale is set to en.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Wed 15 Feb 2012, 09:22    Post subject: Re: Russian translation
Subject description: positive thing
 

rodin.s wrote:
I have found one small mistake in my translation (variable _M_8 was _M_7). init.gz is re-uploaded.

Thanks, I have updated my copy. Will be in next upload.
rodin.s wrote:
There is one strange but positive thing. When I boot pfix=ram and choose ru in initrd I got quicksetup in Russian while locale is set to en.

The strange thing was intended Cool
It is done by setting LANGUAGE

At the moment this is not set properly as I did not know another way: It was written into /pup_rw/etc/rc.d/PUPSTATE by init script and can be found in puppy in the file /etc/rd.d/PUPSTATE.

Bad consequence is: You cannot run a program in another language
Code:
LANGUAGE=de quicksetup
will stay in Russian for you
because quicksetup (and almost every other program is reading PUPSTATE and thus always stay Russian)

This is not good. I think people like me like to switch to another LANGUAGE sometimes.

fix:
Code:
# [ `grep -E '^LANGUAGE=' /etc/rc.d/PUPSTATE` ] && ( mv /etc/rc.d/PUPSTATE P; sed 's/^LANGUAGE=/\#LANGUAGE=/' P > /etc/rc.d/PUPSTATE; rm P )

This one-liner makes the LANGUAGE=.. command in PUPSTATE to be a comment so you can use a LANGUAGE other than the one you have been booting.
This one-liner should be inserted maybe in quicksetup?

Or is there another better way for booting language being passthrough´ed Question
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Wed 15 Feb 2012, 16:35    Post subject: gettext at bootup
Subject description: work or not work :?:
 

rodin.s wrote:
...
Edit: gettext doesn't work in /etc/rc.d/rc.sysinit.
Edit2: No. I was wrong. Gettext works in /etc/rc.d/rc.sysinit. ...


It did not work with me.

And now I remember why I did not not publish the before mentioned script from 2010: it did not work.

And now it is clear why not:
quote from http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html
Quote:
Note: The variable LANGUAGE is ignored if the locale is set to ‘C’. In other words, you have to first enable localization, by setting LANG (or LC_ALL) to a value other than ‘C’, before you can use a language priority list through the LANGUAGE variable.


At the time of running /etc/rc.d/rc.sysinit there is no locale set. That´s it!

When the desktop has been started there is a locale: LANG=en_US
and gettext prefers the LANGUAGE which was set as boot parameter or chosen in the menu.

I have made a version of rc.sysinit using t12s
tested succesfully in Russian and German.

The translation file was created from ru.po

Have fun Smile
rc.sysinit-t12s.tar.gz
Description  /etc/rc.d/rc.sysinit
ru and de
gz

 Download 
Filename  rc.sysinit-t12s.tar.gz 
Filesize  12.6 KB 
Downloaded  278 Time(s) 
Back to top
View user's profile Send private message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Wed 15 Feb 2012, 17:50    Post subject: rc.sysinit works  

Yes, rc.sysinit with t12s is working. But one phrase "next boot will be faster" from rc.update also should to be translated.
Gettexted rc.sysinit started to work for me after I added line:
Code:
LANG=$(cat /etc/profile | grep '^LANG=' | cut -d '=' -f2 )

Code:
# cat /etc/profile | grep '^LANG=' | cut -d '=' -f2
ru_UA.UTF-8
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Thu 16 Feb 2012, 06:02    Post subject:  

L18L,
I like your little i18n test program!

I have put the two fonts that you have provided into the initrd in Woof.

After bootup:
One problem: running in the console, I start 'mp' and the border lines do not display properly.

...I wonder if there is a fix for this?

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Thu 16 Feb 2012, 09:35    Post subject: mp in console  

Barry,

console is urxvt or CONTROL-ALT-F2 ?

I have played with both of them,
did not see immediately the border line problem

file named äöü
see picture in X
äöü is blinking
same file named aou does not blink

in console (sorry no photograph available)
file name in title bar is displayed inproperly (equiv. to blinking?)

I can input äöü but it displaed not immediately correctly.
mp.png
 Description   mp and UTF-8
 Filesize   9.66 KB
 Viewed   499 Time(s)

mp.png

Back to top
View user's profile Send private message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Thu 16 Feb 2012, 15:03    Post subject: border lines  

Maybe Barry means border lines in menu when you press Ctrl-A. Maybe you could try two console fonts from my unicode pet ter-u16n.psf.gz and cyr-sun16.psfu.gz. Do not install the pet. Just unpack it and get fonts. In both of them border lines are back and both of them work for Russian and English. Not sure about other languages.
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Thu 16 Feb 2012, 17:02    Post subject: console font  

After rodin.s´ hint I have repeated test in console

From my view there is nothing bad to report about border lines
No ! ctrl-a menu: left border is corrupt

Just cosmetic

But
- no öü
- no §
neither in mp nor in command line!

My conclusion:
The "new" consolefont is good just for displaying
but not for input.

Do Puppians really use console for things other than ASCII Question
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 4 [52 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1085s ][ Queries: 12 (0.0063s) ][ GZIP on ]