localizing-shell-scripts-without bashisms, gettext or ...

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

localizing-shell-scripts-without bashisms, gettext or ...

#41 Post by L18L »

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
Attachments
t12s.gz
rename to t12s
(15.79 KiB) Downloaded 676 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

localizing-shell-scripts-without bashisms, gettext or ...

#42 Post by L18L »

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)
Attachments
t12s.gz
(16 KiB) Downloaded 461 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

xdelta_gui

#43 Post by L18L »

@Barry,

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 476 times

rodin.s
Posts: 344
Joined: Wed 22 Sep 2010, 19:50
Location: Ukraine

Re: xdelta_gui

#44 Post by rodin.s »

L18L wrote:
xmessage does not display UTF-8

Could you convert xmessages to pupdialog --msgbox please?
For Russian I used a link from xmessage to gxmessage.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: xdelta_gui

#45 Post by L18L »

rodin.s wrote:
L18L wrote:
xmessage does not display UTF-8

Could you convert xmessages to pupdialog --msgbox please?
For Russian I used a link from xmessage to gxmessage.
I prefer yad --text="message" --button="gtk-ok:0"

But it is PuppyMaster´s choice :)

-----
t12s problem with " reminds me of our triple backslash fights :wink:
and your way to rewrite gtkdialogs
DIALOG='.....'"....."'....'
instead of
DIALOG="...."..."...."
:)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

automated translation

#46 Post by L18L »

Dutch people appear to have trained the bot better than the Germans :D

Crying HELP is ignored
Attachments
automated_translations.png
(58.23 KiB) Downloaded 1010 times

ferro10n
Posts: 106
Joined: Wed 15 Jun 2011, 20:18
Contact:

#47 Post by ferro10n »

ferro10n (me) wrote:I think I'm ready to learn how to make the scripts translatable myself
OK, I spoke too soon :oops:
I think I'll just keep testing until I get some experience
A beginner Puppy Linux user
Intel(R) Celeron(R) CPU 2.13GHz 512MB
LiveCD user

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

Re: automated translation

#48 Post by Bert »

L18L wrote:Dutch people appear to have trained the bot better than the Germans :D

Crying HELP is ignored
Did I hear the word "Dutch"? :wink:

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 :roll:
[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]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Re: automated translation

#49 Post by technosaurus »

Bert wrote:
L18L wrote:Dutch people appear to have trained the bot better than the Germans :D

Crying HELP is ignored
Did I hear the word "Dutch"? :wink:

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 :roll:
Sounds great, maybe we can translate it back to English for en_US.
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].

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

automated translation

#50 Post by L18L »

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:

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
Translated names of variables should be restored now.
Messages which have more than 1 variable are excluded.

Happy New Year
Attachments
t12s.gz
rename to t12s
(19.68 KiB) Downloaded 561 times
t12s_rtl.png
xdelta_gui iw
(39.53 KiB) Downloaded 959 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: automated translation

#51 Post by L18L »

technosaurus wrote:
Bert wrote:
L18L wrote:Dutch people appear to have trained the bot better than the Germans :D

Crying HELP is ignored
Did I hear the word "Dutch"? :wink:

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 :roll:
Sounds great, maybe we can translate it back to English for en_US.
Automated translations from other languages are possible in version 0.5 now. :wink:
See example nl to en_US :lol:
Attachments
t12s.gz
rename to t12s
version 0.5
(20.01 KiB) Downloaded 577 times
t12s_DutchToAmerican.png
(8.9 KiB) Downloaded 863 times
t12s_automated_nl_to en_US.png
(9.59 KiB) Downloaded 916 times

User avatar
vezuve
Posts: 1291
Joined: Thu 24 Jan 2008, 15:09

#52 Post by vezuve »

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:
  1. 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
  2. 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 :?:
Pour l'instant, je préfère l'utilisation de gettext comme:
For now, I prefer to use gettext as:
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.
Voici les quelques points qui me pose quelque problème:
Here are some points that I have some problems:
  1. 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.
    1. les mots mentionné ne fonctionne pas chez moi
      the words mentioned does not work for me :?:
    2. la fonction "CTRL-ALT-F2" est elle obligatoire
      function "CTRL-ALT-F2" is obligatory :?:
    3. si oui pourriez vous fournir le nom d'utilisateur et le mot de passe
      If so could you provide the username and password
  2. 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 :?:
    
    1. 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)
    2. 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>
    3. 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
      #
    4. 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 !
On regrette que le script na pas été internationalisé :!:
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

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

Why t12s was not translated using... t12s?

#53 Post by Argolance »

Hello,
We regret that the script has not been internationalized
This would be indeed a very good example of what t12s, funny thing, cannot (yet) properly do! :D

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

...
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.
Last edited by Argolance on Wed 01 Feb 2012, 13:41, edited 7 times in total.

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#54 Post by Argolance »

Post scriptum:
May I suggest latest release(s) of t12s to be downloadable from the first (updated!) post of this thread?

Cordialement.

User avatar
shinobar
Posts: 2672
Joined: Thu 28 May 2009, 09:26
Location: Japan
Contact:

Is the t12s easier than gettext?

#55 Post by shinobar »

I have posted on the Barry's BLOG on the t12s system.
http://bkhome.org/blog/?viewDetailed=02673
technosaurus wrote:flat text files are more accessible to edit
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.
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]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#56 Post by L18L »

Hello vezuve,
sorry for this late reply I will try to answer your questions.
vezuve wrote:
  1. 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
  2. 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 :?:
a Difference to gettext: all-in-one script, faster in execution
b /usr/share/locales/language/script
vezuve wrote:
  1. 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.
    1. les mots mentionné ne fonctionne pas chez moi
      the words mentioned does not work for me :?:
    2. la fonction "CTRL-ALT-F2" est elle obligatoire
      function "CTRL-ALT-F2" is obligatory :?:
    3. si oui pourriez vous fournir le nom d'utilisateur et le mot de passe
      If so could you provide the username and password
The script askpass asks for root´s password if you are not root.
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 :?:
0.4.5.1 is in woof now.

vezuve wrote: On regrette que le script na pas été internationalisé :!:
We regret that the script has not been internationalized
Je ne regrette rien :lol:
The translator really should understand English, shouldn´t she?

Thanks for your feedback
L

rodin.s
Posts: 344
Joined: Wed 22 Sep 2010, 19:50
Location: Ukraine

t12s strange behaviour

#57 Post by rodin.s »

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.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Why t12s was not translated using... t12s?

#58 Post by L18L »

Argolance wrote:Hello,
We regret that the script has not been internationalized
This would be indeed a very good example of what t12s, funny thing, cannot (yet) properly do! :D

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

...
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.
It was never intended to internationalize t12s thus it does not work.
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?

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: t12s strange behaviour

#59 Post by L18L »

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.
could you try version 0.5 (some posts back) please?

Code: Select all

t12s /usr/sbin/xdelta_gui
thanks for feedback :)

rodin.s
Posts: 344
Joined: Wed 22 Sep 2010, 19:50
Location: Ukraine

xdelta_gui

#60 Post by rodin.s »

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 491 times

Post Reply