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 Sat 20 Dec 2014, 06:26
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
localizing-shell-scripts-without bashisms, gettext or ...
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 5 [63 Posts]   Goto page: Previous 1, 2, 3, 4, 5 Next
Author Message
L18L

Joined: 19 Jun 2010
Posts: 2612
Location: www.eussenheim.de/

PostPosted: Tue 13 Dec 2011, 15:29    Post subject: automated translation  

Dutch people appear to have trained the bot better than the Germans Very Happy

Crying HELP is ignored
automated_translations.png
 Description   
 Filesize   58.23 KB
 Viewed   896 Time(s)

automated_translations.png

Back to top
View user's profile Send private message 
ferro10n

Joined: 15 Jun 2011
Posts: 106

PostPosted: Sun 18 Dec 2011, 15:31    Post subject:  

ferro10n (me) wrote:
I think I'm ready to learn how to make the scripts translatable myself


OK, I spoke too soon Embarassed
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
Back to top
View user's profile Send private message Visit poster's website 
Bert


Joined: 30 Jun 2006
Posts: 996

PostPosted: Sun 18 Dec 2011, 16:46    Post subject: Re: automated translation  

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

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 Rolling Eyes

_________________


Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4424

PostPosted: Sun 18 Dec 2011, 19:49    Post subject: Re: automated translation  

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

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 Rolling Eyes


Sounds great, maybe we can translate it back to English for en_US.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2612
Location: www.eussenheim.de/

PostPosted: Sat 31 Dec 2011, 10:51    Post subject: 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:
Code:
      # 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
t12s.gz
Description  rename to t12s
gz

 Download 
Filename  t12s.gz 
Filesize  19.68 KB 
Downloaded  279 Time(s) 
t12s_rtl.png
 Description   xdelta_gui iw
 Filesize   39.53 KB
 Viewed   859 Time(s)

t12s_rtl.png

Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2612
Location: www.eussenheim.de/

PostPosted: Wed 04 Jan 2012, 06:17    Post subject: Re: automated translation
Subject description: translation from languages other than English
 

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

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 Rolling Eyes


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 Laughing
t12s.gz
Description  rename to t12s
version 0.5
gz

 Download 
Filename  t12s.gz 
Filesize  20.01 KB 
Downloaded  301 Time(s) 
t12s_DutchToAmerican.png
 Description   
 Filesize   8.9 KB
 Viewed   754 Time(s)

t12s_DutchToAmerican.png

t12s_automated_nl_to en_US.png
 Description   
 Filesize   9.59 KB
 Viewed   815 Time(s)

t12s_automated_nl_to en_US.png

Back to top
View user's profile Send private message 
vezuve


Joined: 24 Jan 2008
Posts: 1289

PostPosted: Mon 30 Jan 2012, 16:33    Post subject:  

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 Question
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. Quote:
    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 Question
    2. la fonction "CTRL-ALT-F2" est elle obligatoire
      function "CTRL-ALT-F2" is obligatory Question
    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 Question
    
    1. L18 http://extra-inter.net/puppy/t12s_DOC/t12s.html 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é Exclamation
We regret that the script has not been internationalized

@+

_________________
Recherche
sur PUPPY anglai + souven
PUPPY wikka tou sur tou anglai
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1851
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Tue 31 Jan 2012, 08:30    Post subject:  Why t12s was not translated using... t12s?
Subject description: ... This would have been the best example!
 

Hello,
Quote:
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! Very Happy

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:
[ "`grep _M_ $myfile`" ] && break
Code:
<span color='red'>_M_</span>

Code:
...

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, 09:41; edited 7 times in total
Back to top
View user's profile Send private message Visit poster's website 
Argolance


Joined: 06 Jan 2008
Posts: 1851
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Tue 31 Jan 2012, 12:03    Post subject:  

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

Cordialement.

_________________

Back to top
View user's profile Send private message Visit poster's website 
shinobar


Joined: 28 May 2009
Posts: 2631
Location: Japan

PostPosted: Sun 05 Feb 2012, 08:46    Post subject: Is the t12s easier than gettext?
Subject description: i cannot see what is the problem in 'gettext' and what is the issue the 't12s' intends to improve.
 

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/viewtopic.php?p=599234#599234

_________________
Google Chrome portable
Downloads for Puppy Linux http://shino.pos.to/linux/downloads.html
Back to top
View user's profile Send private message Visit poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2612
Location: www.eussenheim.de/

PostPosted: Tue 07 Feb 2012, 15:37    Post subject:  

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 Question


a Difference to gettext: all-in-one script, faster in execution
b /usr/share/locales/language/script

vezuve wrote:

[list=1][*]
Quote:
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 Question
  2. la fonction "CTRL-ALT-F2" est elle obligatoire
    function "CTRL-ALT-F2" is obligatory Question
  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 Question

0.4.5.1 is in woof now.


vezuve wrote:

On regrette que le script na pas été internationalisé Exclamation
We regret that the script has not been internationalized

Je ne regrette rien Laughing
The translator really should understand English, shouldn´t she?

Thanks for your feedback
L
Back to top
View user's profile Send private message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Tue 07 Feb 2012, 16:10    Post subject: 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.
t12s_xdelta.jpg
 Description   
 Filesize   27.66 KB
 Viewed   545 Time(s)

t12s_xdelta.jpg


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

Joined: 19 Jun 2010
Posts: 2612
Location: www.eussenheim.de/

PostPosted: Tue 07 Feb 2012, 16:16    Post subject: Re: Why t12s was not translated using... t12s?
Subject description: ... This would have been the best example!
 

Argolance wrote:
Hello,
Quote:
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! Very Happy

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:
[ "`grep _M_ $myfile`" ] && break
Code:
<span color='red'>_M_</span>

Code:
...

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?
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2612
Location: www.eussenheim.de/

PostPosted: Tue 07 Feb 2012, 16:29    Post subject: Re: t12s strange behaviour  

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:
t12s /usr/sbin/xdelta_gui

thanks for feedback Smile
Back to top
View user's profile Send private message 
rodin.s

Joined: 22 Sep 2010
Posts: 338
Location: Ukraine

PostPosted: Tue 07 Feb 2012, 16:49    Post subject: 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.
xdelta_gui.gz
Description 
gz

 Download 
Filename  xdelta_gui.gz 
Filesize  1.31 KB 
Downloaded  250 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 5 [63 Posts]   Goto page: Previous 1, 2, 3, 4, 5 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.1323s ][ Queries: 13 (0.0080s) ][ GZIP on ]