localizing-shell-scripts-without bashisms, gettext or ...
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
localizing-shell-scripts-without bashisms, gettext or ...
Having played with some of 01micko´s scripts it is time for a new version 0.4.5 of t12s now.
You may use now single quotes and double quotes inside messages
There is no more need to change them to apostrophes.
Using brackets [ ] you must have space after [ and before ]
Have fun
You may use now single quotes and double quotes inside messages
There is no more need to change them to apostrophes.
Using brackets [ ] you must have space after [ and before ]
Have fun
- Attachments
-
- t12s.gz
- rename to t12s
- (15.79 KiB) Downloaded 678 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
localizing-shell-scripts-without bashisms, gettext or ...
doc or tutorial updated
and bugfix version='0.4.5.1
bug was:
-automated translation invoked though not good (no UTF8)
-pseudo language xxx not working (see doc above)
and bugfix version='0.4.5.1
bug was:
-automated translation invoked though not good (no UTF8)
-pseudo language xxx not working (see doc above)
- Attachments
-
- t12s.gz
- (16 KiB) Downloaded 465 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
xdelta_gui
@Barry,
Spanish and German translations for xdelta_gui attached
xmessage does not display UTF-8
Could you convert xmessages to pupdialog --msgbox please?
Spanish and German translations for xdelta_gui attached
xmessage does not display UTF-8
Could you convert xmessages to pupdialog --msgbox please?
- Attachments
-
- xdelta_gui_locales.tar.gz
- spanish and german for xdelta_gui
- (2.29 KiB) Downloaded 480 times
Re: xdelta_gui
For Russian I used a link from xmessage to gxmessage.L18L wrote:
xmessage does not display UTF-8
Could you convert xmessages to pupdialog --msgbox please?
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: xdelta_gui
I prefer yad --text="message" --button="gtk-ok:0"rodin.s wrote:For Russian I used a link from xmessage to gxmessage.L18L wrote:
xmessage does not display UTF-8
Could you convert xmessages to pupdialog --msgbox please?
But it is PuppyMaster´s choice
-----
t12s problem with " reminds me of our triple backslash fights
and your way to rewrite gtkdialogs
DIALOG='.....'"....."'....'
instead of
DIALOG="...."..."...."
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
automated translation
Dutch people appear to have trained the bot better than the Germans
Crying HELP is ignored
Crying HELP is ignored
- Attachments
-
- automated_translations.png
- (58.23 KiB) Downloaded 1010 times
Re: automated translation
Did I hear the word "Dutch"?L18L wrote:Dutch people appear to have trained the bot better than the Germans
Crying HELP is ignored
Don't worry, the automated dutch translation is horrible.
Imagine a spoiled son of a rich lawyer, with lots of whisky and some royal blood running through his veins, who is about to spend the last bits of the family fortune on 'Wein, Weib und Gesang', trying to get up from his chair at the bar, with the intention to deliver an unforgettable speech..that's more or less how the G-translation sounds
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
- technosaurus
- Posts: 4853
- Joined: Mon 19 May 2008, 01:24
- Location: Blue Springs, MO
- Contact:
Re: automated translation
Sounds great, maybe we can translate it back to English for en_US.Bert wrote:Did I hear the word "Dutch"?L18L wrote:Dutch people appear to have trained the bot better than the Germans
Crying HELP is ignored
Don't worry, the automated dutch translation is horrible.
Imagine a spoiled son of a rich lawyer, with lots of whisky and some royal blood running through his veins, who is about to spend the last bits of the family fortune on 'Wein, Weib und Gesang', trying to get up from his chair at the bar, with the intention to deliver an unforgettable speech..that's more or less how the G-translation sounds
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
automated translation
t12s version 0.4.6
After a time of being not connected to internet I have added automated translation now.
Note, I was a bit lazy converting, tested just ru ar el iw
line 376 ff:
Translated names of variables should be restored now.
Messages which have more than 1 variable are excluded.
Happy New Year
After a time of being not connected to internet I have added automated translation now.
Note, I was a bit lazy converting, tested just ru ar el iw
line 376 ff:
Code: Select all
# convert file to=utf-8
case ${x} in
de|fr|it|pt|nl|da|sv|no|fi) fromCHAR=ISO8859-1;;
ru) fromCHAR=KOI-8;;
ar) fromCHAR=ISO8859-6;;
el) fromCHAR=ISO8859-7;;
iw) fromCHAR=ISO8859-8;;
*) fromCHAR=ISO8859-16;;
esac
iconv -f $fromCHAR -t UTF-8 < ${T}/${x}/${app} >${T}/${x}/${app}_utf8
Messages which have more than 1 variable are excluded.
Happy New Year
- Attachments
-
- t12s.gz
- rename to t12s
- (19.68 KiB) Downloaded 565 times
-
- t12s_rtl.png
- xdelta_gui iw
- (39.53 KiB) Downloaded 959 times
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: automated translation
Automated translations from other languages are possible in version 0.5 now.technosaurus wrote:Sounds great, maybe we can translate it back to English for en_US.Bert wrote:Did I hear the word "Dutch"?L18L wrote:Dutch people appear to have trained the bot better than the Germans
Crying HELP is ignored
Don't worry, the automated dutch translation is horrible.
Imagine a spoiled son of a rich lawyer, with lots of whisky and some royal blood running through his veins, who is about to spend the last bits of the family fortune on 'Wein, Weib und Gesang', trying to get up from his chair at the bar, with the intention to deliver an unforgettable speech..that's more or less how the G-translation sounds
See example nl to en_US
- Attachments
-
- t12s.gz
- rename to t12s
version 0.5 - (20.01 KiB) Downloaded 582 times
-
- t12s_DutchToAmerican.png
- (8.9 KiB) Downloaded 863 times
-
- t12s_automated_nl_to en_US.png
- (9.59 KiB) Downloaded 916 times
Hello,
En français et traduit en anglais par google traduction.
In French and translated by google translation.
Essais avec une base lupu 5.28 francisée et customiser en asriedu300profs_20111002 par ASRI.
Après avoir lu vos différents messages, cliqué sur différents lien URL que vous mentionner, je suis un perdu:
Tests with a base and customize lupu 5.28 Frenchified in asriedu300profs_20111002 by ASRI.
After reading your various posts, click different URL that you mention, I'm lost:
For now, I prefer to use gettext as:
Here are some points that I have some problems:
We regret that the script has not been internationalized
@+
En français et traduit en anglais par google traduction.
In French and translated by google translation.
Essais avec une base lupu 5.28 francisée et customiser en asriedu300profs_20111002 par ASRI.
Après avoir lu vos différents messages, cliqué sur différents lien URL que vous mentionner, je suis un perdu:
Tests with a base and customize lupu 5.28 Frenchified in asriedu300profs_20111002 by ASRI.
After reading your various posts, click different URL that you mention, I'm lost:
- a comprendre son utilisation et la différence avec gettext du point de vue de celui qui va traduire
to understand its use and the difference with gettext the point of view of one who will bring - ou il sauvegarde le fichier de langue qu'il crée, car sur cet capture d'image il n'y a pas de bouton d'enregistrement
and it saves the language file it creates, because of this image capture, it no record button
For now, I prefer to use gettext as:
Voici les quelques points qui me pose quelque problème:shinobar Post subject: Is it easier? wrote: Subject description: i think gettext is more simple and easy.
As a conclusion, i do not think it is easier than using gettext.
gettext '.po' file can be edited by text editors. The original message is associated on the 'po' file.
But using the smert tools like poedit is more easier.
Here are some points that I have some problems:
- L18L PostPosted: 15 Nov 2011 11:32
To test the script completely you must do this as fido or spot.
I have run it in a real console (CTRL-ALT-F2, switch back to X by CTRL-ALT-F4):
login as root, then
su fido
pmount
This will ask for administrator's password using your translation.- les mots mentionné ne fonctionne pas chez moi
the words mentioned does not work for me - la fonction "CTRL-ALT-F2" est elle obligatoire
function "CTRL-ALT-F2" is obligatory - si oui pourriez vous fournir le nom d'utilisateur et le mot de passe
If so could you provide the username and password
- les mots mentionné ne fonctionne pas chez moi
- Concernant les lignes a ajouté en tête du script, on trouve différentes version y compris dans le script t12s, quel est la bonne version
On the lines added at the top of the script, there are different versions including the script t12s, what is good version
- L18 [url]http://extra-inter.net/puppy/t12s_DOC/t12s.html[/url] wrote: Preparation (Developers only)
Copy the following code into first lines of your script:
app=`basename $0`
T=/usr/share/locales # TEXTDOMAINDIR
# a one-liner to find existing translation file LOCALES allowing 'dialects'
[ ! -f ${T}/${LANG%.*}/${app} ] && LOCALES=${T}/${LANG%_*}/${app} || LOCALES=${T}/${LANG%.*}/${app}
[ -f $LOCALES ] && . $LOCALES # (re)load translation file (when using variables) - L18L for example: askpass wrote:#111112 i18n by L18L using Technosaurus' method <smile>
# /dev/console: write permission for users required !!!
LANGPATH=/usr/share/locale/${LANG%_*}/askpass
[ -f $LANGPATH ] && . $LANGPATH
PSALL="`ps`"
CALLEDAPP="`echo "$PSALL" | grep -o ' sudo \-A .*' | tr -s ' ' | cut -f 4 -d ' '`"
if [ "$CALLEDAPP" ];then
INSERTMSG=" <text><label>${_M_1:-This application wants to run:}</label></text> - L18L nother script /usr/sbin/alsawizard prepared translated and tested in 1 hour. Here it is: wrote:#111116 i18n using _ M _ method L18L
# note, simple quote (') inside message is not allowed, used (´) instead
OUTPUT_CHARSET=UTF-8
export OUTPUT_CHARSET
TEXTDOMAINDIR=/usr/share/locale
TEXTDOMAIN=`basename $0`
LANGPATH=${TEXTDOMAINDIR}/${LANG%.*}/$TEXTDOMAIN
[ ! -f $LANGPATH ] && LANGPATH=${TEXTDOMAINDIR}/${LANG%_*}/$TEXTDOMAIN
[ -f $LANGPATH ] && . $LANGPATH
# - script t12s wrote:RESTART=$0
myfile=$1
OUTPUT_CHARSET=UTF-8 # needed?
T=/usr/share/locales # TEXTDOMAINDIR
title="t12s -v $version "
[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} # write to TEXTDOMAINDIR
delim='`' # delimiter for sed, no backtick in messages !
We regret that the script has not been internationalized
@+
Recherche
[url=http://wellminded.com/puppy/pupsearch.html]sur PUPPY[/url] anglai + souven
[url=http://puppylinux.org/wikka/PageIndex]PUPPY wikka tou sur tou[/url] anglai
[url=http://wellminded.com/puppy/pupsearch.html]sur PUPPY[/url] anglai + souven
[url=http://puppylinux.org/wikka/PageIndex]PUPPY wikka tou sur tou[/url] anglai
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Why t12s was not translated using... t12s?
Hello,
I tried to do it but didn't succeed! I noticed that _M_ was identified as the beginning of chains to be translated, making t12s to be mistaken and generate corrupted tmp file...
Then, text using markup (<span></span>) seems causing problem too or at least, really complicate work if translator has to split text chains to turn it round. (As far as I know, this doesn't happen using gettext?).
Examples:
I guess I actually don't see benefits translators can get from this way to internationalize applications compared to gettext and poeditor (or even the simpliest way I ever encountered: I mean the 'simple' script based on MU written by shinobar).
Cordialement.
This would be indeed a very good example of what t12s, funny thing, cannot (yet) properly do!We regret that the script has not been internationalized
I tried to do it but didn't succeed! I noticed that _M_ was identified as the beginning of chains to be translated, making t12s to be mistaken and generate corrupted tmp file...
Then, text using markup (<span></span>) seems causing problem too or at least, really complicate work if translator has to split text chains to turn it round. (As far as I know, this doesn't happen using gettext?).
Examples:
Code: Select all
[ "`grep _M_ $myfile`" ] && break
Code: Select all
<span color='red'>_M_</span>
Code: Select all
...
Cordialement.
Last edited by Argolance on Wed 01 Feb 2012, 13:41, edited 7 times in total.
Is the t12s easier than gettext?
I have posted on the Barry's BLOG on the t12s system.
http://bkhome.org/blog/?viewDetailed=02673
T12s flat text files can be edited by using editors, but using t12s editor is better.
I cannot find any difference between the gettext and the t12s.
The point is which is familiar with the gettext or the t12s.
Anyway, the gettext is essential for Puppy applications and the t12s is not.
I have already pointed out no meaning of the running time. I cannot find any applications slowed by the gettext messaging.
http://www.murga-linux.com/puppy/viewto ... 234#599234
http://bkhome.org/blog/?viewDetailed=02673
The .po files are flat text files and the translators can post .po files using editors, but using poeditor or something is easier i guess.technosaurus wrote:flat text files are more accessible to edit
T12s flat text files can be edited by using editors, but using t12s editor is better.
I cannot find any difference between the gettext and the t12s.
The point is which is familiar with the gettext or the t12s.
Anyway, the gettext is essential for Puppy applications and the t12s is not.
I have already pointed out no meaning of the running time. I cannot find any applications slowed by the gettext messaging.
http://www.murga-linux.com/puppy/viewto ... 234#599234
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Hello vezuve,
sorry for this late reply I will try to answer your questions.
b /usr/share/locales/language/script
The translator really should understand English, shouldn´t she?
Thanks for your feedback
L
sorry for this late reply I will try to answer your questions.
a Difference to gettext: all-in-one script, faster in executionvezuve wrote:
- a comprendre son utilisation et la différence avec gettext du point de vue de celui qui va traduire
to understand its use and the difference with gettext the point of view of one who will bring- ou il sauvegarde le fichier de langue qu'il crée, car sur cet capture d'image il n'y a pas de bouton d'enregistrement
and it saves the language file it creates, because of this image capture, it no record button
b /usr/share/locales/language/script
The script askpass asks for root´s password if you are not root.vezuve wrote:
L18L PostPosted: 15 Nov 2011 11:32
To test the script completely you must do this as fido or spot.
I have run it in a real console (CTRL-ALT-F2, switch back to X by CTRL-ALT-F4):
login as root, then
su fido
pmount
This will ask for administrator's password using your translation.
- les mots mentionné ne fonctionne pas chez moi
the words mentioned does not work for me- la fonction "CTRL-ALT-F2" est elle obligatoire
function "CTRL-ALT-F2" is obligatory- si oui pourriez vous fournir le nom d'utilisateur et le mot de passe
If so could you provide the username and password
0.4.5.1 is in woof now.vezuve wrote:[*]Concernant les lignes a ajouté en tête du script, on trouve différentes version y compris dans le script t12s, quel est la bonne version
On the lines added at the top of the script, there are different versions including the script t12s, what is good version
Je ne regrette rienvezuve wrote: On regrette que le script na pas été internationalisé
We regret that the script has not been internationalized
The translator really should understand English, shouldn´t she?
Thanks for your feedback
L
t12s strange behaviour
I was translating xdelta_gui from woof using t12s today and there were strange repetitions of strings which were very confusing and it was hard to understand which line to translate.
- Attachments
-
- t12s_xdelta.jpg
- (27.66 KiB) Downloaded 656 times
Last edited by rodin.s on Tue 07 Feb 2012, 20:25, edited 1 time in total.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Why t12s was not translated using... t12s?
It was never intended to internationalize t12s thus it does not work.Argolance wrote:Hello,This would be indeed a very good example of what t12s, funny thing, cannot (yet) properly do!We regret that the script has not been internationalized
I tried to do it but didn't succeed! I noticed that _M_ was identified as the beginning of chains to be translated, making t12s to be mistaken and generate corrupted tmp file...
Then, text using markup (<span></span>) seems causing problem too or at least, really complicate work if translator has to split text chains to turn it round. (As far as I know, this doesn't happen using gettext?).
Examples:Code: Select all
[ "`grep _M_ $myfile`" ] && break
Code: Select all
<span color='red'>_M_</span>
I guess I actually don't see benefits translators can get from this way to internationalize applications compared to gettext and poeditor (or even the simpliest way I ever encountered: I mean the 'simple' script based on MU written by shinobar).Code: Select all
...
Cordialement.
You have tried it?
If I try to run it I get a messages starting with
Sorry, could not....
Goal was not benefits for translators but speed of execution. Remember?
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: t12s strange behaviour
could you try version 0.5 (some posts back) please?rodin.s wrote:I was translating xdelta_gui from woof using t12s today and there were strange repetitions of strings which were very confusing and it was hard to understand which line to translate.
Code: Select all
t12s /usr/sbin/xdelta_gui
xdelta_gui
Same with version 0.5. Here is my translation. You can try it by yourself. It has something to do with UTF-8. Console messages were interesting.
- Attachments
-
- xdelta_gui.gz
- (1.31 KiB) Downloaded 498 times