zigbert and gettext
zigbert and gettext
Hi all
L18L had an course with me regarding gettext. I have avoided this as much as possible, but he (I assume that it's a he) pushed it the all way through, so I simply couldn't step off..... The result is seen in pClock which uses gettext for NLS - thanks to L18L.
Now that I know how it works you might find it reasonable that I convert my tiny apps to gettext to give our translators a better working environment. I have spend the last day thinking about this, and come to a conclusion. The work is just bigger than I find inspiration to offer. Puppy is mainly a fun-project for me, and I want it to stay that way..... I already spend some hours maintaining codelines, and I don't find bugfixing to be funny only.
But that doesn't mean I don't want gettext.
If someone out there wants to help out converting apps to use gettext (like L18L did for pClock), that is no problem to fix. The only thing we need to keep track of is that you work on the latest code. And it is no problem for me if you spend some time on the work. I don't work on all apps at the same time anyway. Let's just agree what app I should stay away from.
Today I released Pmusic 2.6.4. This is a bugfix release, and I plan the next to be 2.7.0 which includes new stuff - This will take much time, and if someone wants to work on NLS, now it's a perfect time.
Most of the others apps are smaller (except Pburn), so these is probably less time consuming to work with.
The apps in the official Puppy:
- pBurn (done by rodin.s) All NLS files are converted
- pMirror (done by rodin.s)
- pTiming (done by zigbert)
- pBackup (let's stay away from this creepy code)
- pMusic (done by zigbert)
- pClock (done by L18L)
- pSchedule (done by zigbert)
- pFind (done by L18L)
- pFilesearch (done by L18L)
- pProcess (done by rodin.s)
- pEqualizer (done by zigbert)
See you around
Sigmund
L18L had an course with me regarding gettext. I have avoided this as much as possible, but he (I assume that it's a he) pushed it the all way through, so I simply couldn't step off..... The result is seen in pClock which uses gettext for NLS - thanks to L18L.
Now that I know how it works you might find it reasonable that I convert my tiny apps to gettext to give our translators a better working environment. I have spend the last day thinking about this, and come to a conclusion. The work is just bigger than I find inspiration to offer. Puppy is mainly a fun-project for me, and I want it to stay that way..... I already spend some hours maintaining codelines, and I don't find bugfixing to be funny only.
But that doesn't mean I don't want gettext.
If someone out there wants to help out converting apps to use gettext (like L18L did for pClock), that is no problem to fix. The only thing we need to keep track of is that you work on the latest code. And it is no problem for me if you spend some time on the work. I don't work on all apps at the same time anyway. Let's just agree what app I should stay away from.
Today I released Pmusic 2.6.4. This is a bugfix release, and I plan the next to be 2.7.0 which includes new stuff - This will take much time, and if someone wants to work on NLS, now it's a perfect time.
Most of the others apps are smaller (except Pburn), so these is probably less time consuming to work with.
The apps in the official Puppy:
- pBurn (done by rodin.s) All NLS files are converted
- pMirror (done by rodin.s)
- pTiming (done by zigbert)
- pBackup (let's stay away from this creepy code)
- pMusic (done by zigbert)
- pClock (done by L18L)
- pSchedule (done by zigbert)
- pFind (done by L18L)
- pFilesearch (done by L18L)
- pProcess (done by rodin.s)
- pEqualizer (done by zigbert)
See you around
Sigmund
Last edited by zigbert on Sat 30 Mar 2013, 16:08, edited 16 times in total.
pProcess
I would like to try something simple like pProcess first. Maybe even some automatic script based on sed can do it: to take some lines from translation file and put them into main script with addition of necessary gettext syntax...
Awesome!rodin.s wrote:I would like to try something simple like pProcess
I have uploaded pprocess-2.2.5.pet to sync with my local codebase.
Sigmund
Re: pProcess
Hi rodin.srodin.s wrote:I would like to try something simple like pProcess first. Maybe even some automatic script based on sed can do it: to take some lines from translation file and put them into main script with addition of necessary gettext syntax...
I have a script that you made for Pmusic 2.6.3, I was able to create a .pot file. Do I need an updated version of your script for new versions of Pmusic?
Sorry for the off-topic (well, not so off-topic): I need someone who is able to teach me some gettext basics. The information I find on the Internet assumes I have console and compiling skills (not something I can learn in the short term). If anyone is willing to, just PM me. (I know, there is MoManager, but I haven't seen any puplets with MoManager yet, and not all software is internationalized to use this method)
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Re: pProcess
I don't know what you mean by the second half of the sentence.vicmz wrote:I know, there is MoManager, but I haven't seen any puplets with MoManager yet, and not all software is internationalized to use this method
All puppies built from Woof since late February 2012 have MoManager and the support inftrastructure.
That includes Wary, Racy (me), Slacko (01micko). There are various Debian and Ubuntu builds, including a Upup made by pemasu from a recent Woof. Also there is a Mageia puplet created by scsijon. Probably some others too that I can't recall right now.
Oh yes, the ARM-board puppies are built from latest Woof.
Looking ahead, all puppies will have it.
There are some "legacy" puppies that don't, however, in theory MoManager could be backported.
The special case of forks of Woof, such as FatDog64, MoManager could also be ported to that. But, that would be up to the FatDog developers. It would be a very good thing for them to do, as then all of the langpacks would work on their puplet, and we have a growing collection.
[url]https://bkhome.org/news/[/url]
- BarryK
- Puppy Master
- Posts: 9392
- Joined: Mon 09 May 2005, 09:23
- Location: Perth, Western Australia
- Contact:
Re: pProcess
In a recent Puppy (with MoManager), go to the menu and choose "Help" then "HOWTO internationalization". This has links to some documentation.vicmz wrote:Sorry for the off-topic (well, not so off-topic): I need someone who is able to teach me some gettext basics. The information I find on the Internet assumes I have console and compiling skills
To learn more about MoManager, go to my blog and type "MoManager" into the search-box:
http://bkhome.org/blog/
With MoManager, you should not require "console" or "compiling" skills. It is a GUI, and the console utilities are executed automatically. MoManager will even create a langpack PET for you automatically.
[url]https://bkhome.org/news/[/url]
pmusic script
As for pmusic gettext script: yes, it has to be updated if pmusic translation changes. Some new lines added, old ones removed.
Thank you guys. Regarding puplets I've received requests for compatibility with puplets that were built before MoManager was implemented, especially Lucid and Saluki, that was the reason of my request. I do use MoManager actively and release at least one update per month, many users are glad that you created it, BarryK. OK, after this I can focus entirely on the official langpack_es. The langpack_es official page explains which Puppy versions are compatible but doesn't include any puplets, so I'll add those you mentioned. Thank you again.
gettext in pProcess
I have added gettext to pProcess. It's MoManager compatible. File pprocess.mo will be created in MoManager after translation. I had to do some workaround sins MoManager supports only one script for one mo-file and pprocess has tree scripts with gettext. Main script is pprocess so I have added lines from two others into main script.
Maybe now I want to try pBurn as something more complex.
Maybe now I want to try pBurn as something more complex.
- Attachments
-
- MoManager-ru_UA-pprocess_gtxt-2.2.5.tar.gz
- MoManager Russian translation for pProcess
- (1.69 KiB) Downloaded 745 times
-
- pprocess_gtxt-2.2.5.pet
- pProcess with gettext
- (3.94 KiB) Downloaded 735 times
gettext seems to work just fine in pProcess.
What I don't like is the comments at the end to sync with *.pot. I see this as a temporarily solution until MoManager supports multiple scripts for one *.mo file. For pProcess, the comments are few.... for pMusic it will be 'endless'. The worst is not extra codelines, but the fact that I have to update these comments as the app evolves. The arguments for gettext fails with this solution. We could instead use your pMusic-gettext script....
I assume that MoManager will be improved, and we continue the way towards gettext.....
Thank you
Sigmund
What I don't like is the comments at the end to sync with *.pot. I see this as a temporarily solution until MoManager supports multiple scripts for one *.mo file. For pProcess, the comments are few.... for pMusic it will be 'endless'. The worst is not extra codelines, but the fact that I have to update these comments as the app evolves. The arguments for gettext fails with this solution. We could instead use your pMusic-gettext script....
I assume that MoManager will be improved, and we continue the way towards gettext.....
Thank you
Sigmund
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
momanager
Just detected this threadzigbert wrote:....
I assume that MoManager will be improved, and we continue the way towards gettext.....
For example /usr/local/pprocess/pprocess:
delete the comments at the end and
change 1st line to:
export TEXTDOMAIN=pprocess # box_ok func
and change momanager ~755
*)
cp -f "$ASCRIPT" ${ANAME}.sh #hack
#additional_scripts for xgettext
#LANG=${ORIGLANG} rxvt -e xgettext --no-wrap -o ${ATEXTDOMAIN}.pot ${ANAME}.sh
LANG=${ORIGLANG} rxvt -e xgettext --no-wrap -o ${ATEXTDOMAIN}.pot ${ANAME}.sh `grep 'export TEXTDOMAIN=' $ASCRIPT | cut -d '#' -f2`
;;
esac
makes xgettext to create the complete pprocess.pot file.
Zigbert, I agree totally: puppy and woof will stay fun
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
zigbert and gettext
I am going to try converting Pfilesearch now.
Re: zigbert and gettext
Great. Version 1.30 is up to dateL18L wrote:I am going to try converting Pfilesearch now.
Puppy backup which is an improved clone of pmirror
is finished.
Pmirror can and should be forgotten.
Localized with Zigbert's method.
Yaf-splash is now used to indicate activity.
I've gone as far as I can with this one.
http://murga-linux.com/puppy/viewtopic.php?t=77685
_____________________________________________________
is finished.
Pmirror can and should be forgotten.
Localized with Zigbert's method.
Yaf-splash is now used to indicate activity.
I've gone as far as I can with this one.
http://murga-linux.com/puppy/viewtopic.php?t=77685
_____________________________________________________
Re: zigbert and gettext
Great.zigbert wrote:If someone out there wants to help out converting apps to use gettext (like L18L did for pClock), that is no problem to fix. The only thing we need to keep track of is that you work on the latest code.
I guess we can convert your localization to gettext automatically. It will ensure the code always to be the latest.
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/
Re: zigbert and gettext
It has been not so simple.zigbert wrote:Great. Version 1.30 is up to dateL18L wrote:I am going to try converting Pfilesearch now.
gettext does not like messages starting with - (minus)
so I had to change the text, see picture
But using the new momanager_enhanced was fun.
I have made 1.31.pet ( containing de also )
Code: Select all
# ./pfilesearch -h
Optionen
-b als backend benutzen. Keine Suchergebnisse anzeigen
-bb Nicht 'Keine Dateien gefunden!' anzeigen
-bbb Nicht 'Suche...' anzeigen
-c [STRING] Stumme Suche. Kein GUI
-d [DIR] In einem spezifischen Ordner suchen
-e Embedded laufen - gtkdialog code is pointed to stdout
-ee Embedded laufen - Optionen überspringen
-f [FILTER] Nur durchsuchen nach Dateigruppen:
documents Dokumente
pictures Bilder
music Musik
videos Videos
emails E-Mails
compressed_files Komprimierte Dateien
code_files Code-Dateien
-i Konfigurationsdateien installieren und beenden
-h Diese Hilfe anzeigen
-p Einstellungen GUI bei Start anzeigen
-t [STRING] Standard-Suchtext definieren
-v Version von Pfilesearch anzeigen
#
- Attachments
-
- pfilesearch.png
- (40.57 KiB) Downloaded 985 times
-
- pfilesearch-1.31.pet
- for testing only
- (11.99 KiB) Downloaded 593 times
Re: zigbert and gettext -automate
Yeh.L18L wrote:It has been not so simple.
gettext does not like messages starting with - (minus)
so I had to change the text,
I have tried automatic conversion by next code against the locales file:
Code: Select all
sed -e 's/\([^=\]\)"\([ ]*#.*$\)/\1")\2/' -e 's/\([^=\]\)"[ ]*$/\1")/' -e 's/^\([A-Z][0-9A-Z_]*\)="/\1=$(gettext "/' -e "s/\\([^=\\]\\)'\\([ ]*#.*\$\\)/\\1')\\2/" -e "s/\\([^=\\]\\)'[ ]*\$/\\1')/" -e "s/^\\([A-Z][0-9A-Z_]*\\)='/\\1=\$(gettext '/" $SOURCE > $DEST
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]