zigbert and gettext

For efforts in internationalising Puppy and solving problems in this area
Message
Author
User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

zigbert and gettext

#1 Post by zigbert »

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
Last edited by zigbert on Sat 30 Mar 2013, 16:08, edited 16 times in total.

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

pProcess

#2 Post by rodin.s »

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...

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#3 Post by zigbert »

rodin.s wrote:I would like to try something simple like pProcess
Awesome!
I have uploaded pprocess-2.2.5.pet to sync with my local codebase.


Sigmund

User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

Re: pProcess

#4 Post by vicmz »

rodin.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...
Hi rodin.s
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]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: pProcess

#5 Post by BarryK »

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
I don't know what you mean by the second half of the sentence.

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]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

Re: pProcess

#6 Post by BarryK »

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
In a recent Puppy (with MoManager), go to the menu and choose "Help" then "HOWTO internationalization". This has links to some documentation.

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]

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

pmusic script

#7 Post by rodin.s »

As for pmusic gettext script: yes, it has to be updated if pmusic translation changes. Some new lines added, old ones removed.

User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

#8 Post by vicmz »

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. :D

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

I will be posting a new version of puppy backup
(the improved version of pmirror). It will
have a yaf-splash window to show activity.
It should be released in couple of days so I can
test it thoroughly.

So don't bother converting pmirror.

__________________________________

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

gettext in pProcess

#10 Post by rodin.s »

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.
Attachments
MoManager-ru_UA-pprocess_gtxt-2.2.5.tar.gz
MoManager Russian translation for pProcess
(1.69 KiB) Downloaded 742 times
pprocess_gtxt-2.2.5.pet
pProcess with gettext
(3.94 KiB) Downloaded 734 times

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#11 Post by zigbert »

rodin.s
:D

I'll check it out and release a new version of pProcess
Pburn 3.7.3 is up to date and ready to go


T H A N K S . . A . . L O T
Sigmund

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#12 Post by zigbert »

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

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

momanager

#13 Post by L18L »

zigbert wrote:....
I assume that MoManager will be improved, and we continue the way towards gettext..... :)
Just detected this thread :)

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 :lol:

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

zigbert and gettext

#14 Post by L18L »

I am going to try converting Pfilesearch now.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

Re: zigbert and gettext

#15 Post by zigbert »

L18L wrote:I am going to try converting Pfilesearch now.
Great. Version 1.30 is up to date

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#16 Post by zigbert »

L18L
Waiting for response of Barry before updating pProcess to benefit of your MoManager improvements.


Sigmund

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#17 Post by don570 »

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. :lol:

http://murga-linux.com/puppy/viewtopic.php?t=77685

_____________________________________________________

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

Re: zigbert and gettext

#18 Post by shinobar »

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.
Great.
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]

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

Re: zigbert and gettext

#19 Post by L18L »

zigbert wrote:
L18L wrote:I am going to try converting Pfilesearch now.
Great. Version 1.30 is up to date
It has been not so simple.
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. :D

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

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

Re: zigbert and gettext -automate

#20 Post by shinobar »

L18L wrote:It has been not so simple.
gettext does not like messages starting with - (minus)
so I had to change the text,
Yeh.
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
Mostly it works. But some case, we need to modify the original...
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]

Post Reply