The time now is Mon 18 Jan 2021, 07:40
All times are UTC - 4 |
Author |
Message |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Mon 28 Nov 2011, 07:54 Post subject:
localizing-shell-scripts-without bashisms, gettext or ... Subject description: back from puppylinux.info |
|
Thank you, let us continue here.
In another thread fero10n wrote: | You guys are so computer-skilled, while all I can do is translate between five languages |
Our computer skills are very different. Technosaurus is master of hacking... while I am just trying to walk in some of his foot steps
but you are also a software tester now (Willy nilly )
-----
Edited
pt_BR should work now
If you first translate just some messages for pt (not all)
then these should be preloaded when starting pt_BR
Confirm?
----
Once more edited
If you do this then pt is killed.
Change script t12s line 234 from
mv ${T}/${x}/${app} ${T}/${this_LANG}/${app}_tmp
to
cp ${T}/${x}/${app} ${T}/${this_LANG}/${app}_tmp
That is: copy instead of move and pt will continue to live
And soon you will become a coder too
|
Back to top
|
|
 |
ferro10n
Joined: 15 Jun 2011 Posts: 106
|
Posted: Tue 29 Nov 2011, 00:08 Post subject:
Re: localizing-shell-scripts-without bashisms, gettext or ... Subject description: back from puppylinux.info |
|
L18L wrote: | you are also a software tester now |
Yes, sir!
L18L wrote: |
Edited
pt_BR should work now
If you first translate just some messages for pt (not all)
then these should be preloaded when starting pt_BR
Confirm?
----
Once more edited
If you do this then pt is killed.
Change script t12s line 234 from
mv ${T}/${x}/${app} ${T}/${this_LANG}/${app}_tmp
to
cp ${T}/${x}/${app} ${T}/${this_LANG}/${app}_tmp
That is: copy instead of move and pt will continue to live
And soon you will become a coder too  |
Done. Here are the results:
Tested t12s with mentioned line modified.
Translation was generated properly with no more question marks where special characters should be, for example 'n?o' instead of 'não'.
The adding of a new translated line caused the whole list of translatable lines to repeat below, making the list longer than it actually is.
At times I submitted a translation and then saw the line blank where the new translation should be, I had to Undo, Quit and start the script again to be able to submit the translation. Finally, as the bug continued, I had to edit the generated locale file to manually complete the translation process.
Generated translations:
Code: |
_M_10="AJUDA"
_M_11="Arquivo novo:"
_M_12="Arquivo novo ou .delta:"
_M_13="Arquivo velho:"
_M_14="por favor espere..."
_M_15="Por favor espere, procurando arquivo velho..."
_M_16="Desculpe não achous-se ${OLDFILENAME}. Terá de arrastá-lo manualmente na caixa ´Arquivo velho´"
_M_17="SUCESSO! ${SOURCEFILE_DELTA} gerado"
_M_18="SUCESSO! ${SOURCEFILE_NEW} gerado"
_M_19="O autor do Xdelta é Joshua MacDonald."
_M_20="Primeiro deve-se instalar o pacote ´xdelta´"
_M_21="Interface escrita por Barry Kauler. Licença GPL v2."
_M_22="O algoritmo Rsync, que inspirou o algoritmo delta central, deve-se a Andrew Tridgell e Paul Mackerras."
_M_23="Istas mudanças (deltas) são similares à saida do programa ´diff´ em que podem-se utilizar para armazenar e transmitir somente as mudanças entre arquivos. Porém, ao contrário do diff, a saida do Xdelta não é expressada em um formato legível pelos humanos (além disso Xdelta pode aplicar estes deltas a uma copia do arquivo original). Xdelta utiliza um rápido algoritmo linear e desenvolve-se bem tanto em arquivos binários quanto em arquivos de texto."
_M_24="Para criar um arquivo ´.delta´, você precisa dois arquivos originais, um arquivo ´velho´ e um ´novo´. O arquivo delta gerado terá uma extensão ´.delta´."
_M_25="Para gerar um arquivo ´.delta´, arraste os arquivos velho e novo aqui, ou para recriar o arquivo novo arraste os arquivos velho e ´.delta´ aqui"
_M_26="Bemvindo/a, ista é uma interface para a ferramenta ´xdelta´, para administrar mudanças entre dois arquivos"
_M_27="Xdelta é um programa de aplicação desenhado para computar mudanças entre dois arquivos."
_M_28="Você pode recriar o arquivo ´novo´ original, enquanto você tenha o arquivo ´velho´ original e o arquivo ´.delta´. Este frontend de interface faz com que isto seja fácil: somente arraste o arquivo .delta na caixa, e o programa procurará e localizará o arquivo velho original. Ou, somente clique em um arquivo .delta em uma janela do ROX-Filer para re-gerar o arquivo novo original."
_M_3="Erro, ´Arquivo novo´ não existe"
_M_4="Erro, ´Arquivo velho´ não existe"
_M_5="ERRO! falhiu a geração do arquivo .delta. Mensagem de erro:"
_M_6="ERRO! falhiu a recriação do arquivo novo. Mensagem de erro:"
_M_7="ERRO: ${SOURCEFILE} não existe"
_M_8="GERAR"
|
_________________ A beginner Puppy Linux user
Intel(R) Celeron(R) CPU 2.13GHz 512MB
LiveCD user
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Tue 29 Nov 2011, 14:29 Post subject:
Re: localizing-shell-scripts-without bashisms, gettext or ... Subject description: bugfix version 0.4.3 |
|
ferro10n wrote: |
The adding of a new translated line caused the whole list of translatable lines to repeat below, making the list longer than it actually is.
At times I submitted a translation and then saw the line blank where the new translation should be, I had to Undo, Quit and start the script again to be able to submit the translation. Finally, as the bug continued, I had to edit the generated locale file to manually complete the translation process.
|
Thank you
fixed
Description |
bugfix version 0.4.3 Rename it to t12s (without .gz)
|

Download |
Filename |
t12s.gz |
Filesize |
13.09 KB |
Downloaded |
515 Time(s) |
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Wed 30 Nov 2011, 16:36 Post subject:
|
|
Hi L18L
First, great job
I have 3 queries before I embark on my first attempt. (later, answered myself, app link at bottom of post )
1) Does this method handle strings with a newline char? ( \n )
example: Code: | echo -en "Choices \n1. Firefox \n2. Seamonkey \n\nChoose 1 or 2 to download \n" |
A: Yes
2) Can we use escaped quotes?
example: Code: | echo "get_mozilla_browser-0.1
Invoke with \"get_mozilla_browser\" and you are offered a choice of
\"firefox\" or \"seamonkey\" latest stable browsers direct from mozilla
in your default locale if it exists.(snip)" |
A: Yes
3) Can we use variables inside a string?
example: Code: | echo "$PACKAGE en-US will be downloaded " |
A; No
-
If the answer to any or all of these is "no" it isn't a problem as I can split up the strings.
TIA
EDIT: app here!
_________________ Puppy Linux Blog - contact me for access
Last edited by 01micko on Thu 01 Dec 2011, 01:47; edited 1 time in total
|
Back to top
|
|
 |
ferro10n
Joined: 15 Jun 2011 Posts: 106
|
Posted: Thu 01 Dec 2011, 00:22 Post subject:
|
|
This time around the t12s script worked nicely
I've even been able to change language so that I can make a new locale for the same file just after I finished the one I've worked on previously. However, I had to check that the locale folders were in place -- as the 'locales' folder was empty, I had to create individual folders for the locales I usually make (es, pt_BR, it, fr) so that the translations were generated there. If there wasn't a folder for the locale I wanted to work with, upon selecting the script to translate I got an empty list with no lines to translate, so I quit, created the locale folders and started t12s again, then I just wrote the folder name (es, it, fr, etc.) and got the list of translatable lines.
I think I'm ready to learn how to make the scripts translatable myself . Who knows, maybe I can make a localized pupplet, something like 'Wary EPI (= Español-Português-Italiano, the languages with less pupplets available that are based on newer puppy versions)'
_________________ A beginner Puppy Linux user
Intel(R) Celeron(R) CPU 2.13GHz 512MB
LiveCD user
Last edited by ferro10n on Sun 18 Dec 2011, 15:29; edited 2 times in total
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Thu 01 Dec 2011, 16:11 Post subject:
localizing-shell-scripts-without bashisms, gettext or ... Subject description: A 3 |
|
Hi 01micko,
thanks for answering the first two questions yourself
you wrote: | ...
3) Can we use variables inside a string?
example: Code: | echo "$PACKAGE en-US will be downloaded " |
A; No
-
If the answer to any or all of these is "no" it isn't a problem as I can split up the strings.
... |
Splitting strings is
RTFineM
Enabling translation of entire sentences, that is the purpose of eval_gettext.
The equivalent in t12s method is (your example):
Code: | [ -f $LOCALES ] && . $LOCALES
echo ${_M_:-$PACKAGE en-US will be downloaded } |
A: Yes
The last two days I was trying this method on playmusic:
nice experience, bugfixes
I will have to update the documentation (BTW did you klick the button ´Developer´ ?)
{VAR} is no more required, see your PACKAGE example.
I will have a look into your app tomorrow.
Cheers
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Thu 01 Dec 2011, 16:39 Post subject:
localizing-shell-scripts-without bashisms, gettext or ... Subject description: locales folder |
|
ferro10n wrote: | This time around the t12s script worked nicely
I've even been able to change language so that I can make a new locale for the same file just after I finished the one I've worked on previously. |
Glad to read this
ferro10n wrote: | However, I had to check that the locale folders were in place -- as the 'locales' folder was empty, I had to create individual folders for the locales I usually make (es, pt_BR, it, fr) so that the translations were generated there. If there wasn't a folder for the locale I wanted to work with, upon selecting the script to translate I got an empty list with no lines to translate, so I quit, created the locale folders and started t12s again, then I just wrote the folder name (es, it, fr, etc.) and got the list of translatable lines. |
Sorry, but I cannot reproduce this. When I choose ar (Arabic, just an example ) then immediately the folder ar is automatically made in /usr/share/locales
ferro10n wrote: | I think I'm ready to learn how to make the scripts translatable myself . Who knows, maybe I can make a localized pupplet, something like 'Wary EPI (= Español-Português-Italiano, the languages with less pupplets available that are based on newer puppy versions)' |
Nice idea,
not
Español OR Português OR Italiano
but
Español AND Português AND Italiano QLS(QuickLanguageSwitcher) no joke
-----------------------------------
Attached version 0.4.4 enables use of [ ] in message (result of my trial with pmusic)
Description |
rename to t12s (without .gz) copy into /usr/sbin requires yad
|

Download |
Filename |
t12s.gz |
Filesize |
14.06 KB |
Downloaded |
481 Time(s) |
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Thu 01 Dec 2011, 20:11 Post subject:
|
|
Please don't misunderstand, I didn't use the t12s prog, I did it manually.
I realise my syntax is wrong, which I'll fix and then try t12s.
Cheers
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Fri 02 Dec 2011, 05:41 Post subject:
localizing-shell-scripts-without bashisms, gettext or ... Subject description: t12s |
|
01micko wrote: | Please don't misunderstand, I didn't use the t12s prog, I did it manually.
I realise my syntax is wrong, which I'll fix and then try t12s.
Cheers |
OK, I did misunderstand
Start script t12s from command line line please.
The idea for this script was coming from practical use of the method:
Making IDs manually is ...
Repeated message (ex: please wait...) can be overseen
Numeric ID are shortest
The problem was to display the messages (including $...) in yad.
Every new app had new requirements to improve the code.
@ferro10n,
Maybe starting from command line can solve your problem?
@01micko,
your ´Browser Installer2´ appears to be a nice little app for demonstration. I would like to take screenshots from it and put them into my docu of t12s
apps I have converted to t12s
askpass
alsawizard
xdelta_gui
playmusic
None of these is good for public understanding (I will have to review them checking syntax...) but´Browser Installer2´ is an app everybody will understand.
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 8787 Location: qld
|
Posted: Fri 02 Dec 2011, 09:21 Post subject:
|
|
L18L wrote: | OK, I did misunderstand  | ..and ok too I did mislead
L18L wrote: | @01micko,
your ´Browser Installer2´ appears to be a nice little app for demonstration. I would like to take screenshots from it and put them into my docu of t12s |
By all means. I deliberately kept it as simple as possible, partly with this in mind.
Later, (in a week maybe) I'll have some more time to help, give feedback, dive in, etcetera. Your t12s has great potential I think.
_________________ Puppy Linux Blog - contact me for access
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Fri 09 Dec 2011, 14:43 Post subject:
localizing-shell-scripts-without bashisms, gettext or ... Subject description: new version of t12s |
|
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
Description |
rename to t12s
|

Download |
Filename |
t12s.gz |
Filesize |
15.79 KB |
Downloaded |
724 Time(s) |
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Sat 10 Dec 2011, 17:42 Post subject:
localizing-shell-scripts-without bashisms, gettext or ... Subject description: doc |
|
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)
Description |
|

Download |
Filename |
t12s.gz |
Filesize |
16 KB |
Downloaded |
500 Time(s) |
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Sun 11 Dec 2011, 15:25 Post subject:
xdelta_gui Subject description: xmessage and 2 translations |
|
@Barry,
Spanish and German translations for xdelta_gui attached
xmessage does not display UTF-8
Could you convert xmessages to pupdialog --msgbox please?
Description |
spanish and german for xdelta_gui
|

Download |
Filename |
xdelta_gui_locales.tar.gz |
Filesize |
2.29 KB |
Downloaded |
511 Time(s) |
|
Back to top
|
|
 |
rodin.s
Joined: 22 Sep 2010 Posts: 344 Location: Ukraine
|
Posted: Sun 11 Dec 2011, 15:36 Post subject:
Re: xdelta_gui Subject description: xmessage and 2 translations |
|
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.
|
Back to top
|
|
 |
L18L

Joined: 19 Jun 2010 Posts: 3493 Location: www.eussenheim.de/
|
Posted: Sun 11 Dec 2011, 15:56 Post subject:
Re: xdelta_gui Subject description: xmessage and 2 translations |
|
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
and your way to rewrite gtkdialogs
DIALOG='.....'"....."'....'
instead of
DIALOG="....\"...\"...."
|
Back to top
|
|
 |
|
|
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
|