Pcreole programmable application + nme (creole converter)

Word processors, spreadsheets, presentations, translation, etc.
Message
Author
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

pcreole

#31 Post by L18L »

I am thinking our trial and errors might serve as a good example for other users. :)

Back to subject.
If you run pcreole without arguments (LANGUAGE=de ./pcreole) you see all terms that are gettexted by you display nicely in German. (Not sure whether my German is nice but that is another question).

So you can continue to gettext every string that will show up in GUI.
There are some comments in de.po stuff for further discussion but
I don't want to slow down your further development of pcreole too much.

Edited: my programming experiences:
COBOL, Fortran, DATA (Philipps/Motorola Midi computer), TI99/4A Extended Basic, Sinclair QL ..., php, bash, BaCon
No C (except for internationalization)
Last edited by L18L on Wed 11 May 2011, 12:10, edited 2 times in total.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: pcreole

#32 Post by mcewanw »

L18L wrote: If you run pcreole without arguments (LANGUAGE=de ./pcreole) you see all terms that are gettexted by you display nicely in German.

There are some comments in de.po stuff for further discussion.
I see. Yes, that seems to work fine. Sorry, that I haven't replied before, but I have a lot going on here at the moment. However, I'll try and examine your de.po comments tomorrow, or the next day if I run out of time, and get back to you. All going well, once I'm sure I understand where to store the .po files and so on, I'll package this one up and upload it.

Further developments to pcreole will probably not come for a while, because I'm needing to use it for some website development work I'm doing. I would also like to amend Precord to use gettext, after which any contributions to the translation work for that would be useful.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: pcreole

#33 Post by mcewanw »

L18L wrote: There are some comments in de.po stuff for further discussion but
I don't want to slow down your further development of pcreole too much.

Code: Select all

#: Couldn't we just display the entered value ???
#: pcreole:597
msgid ""
"Save pcreole configuration file to target /path/filename entered in TMP_"
Your above suggestion is how I had things in earlier test versions of Pcreole. Unfortunately, gtkdialog keeps the old entry box (even after putting in a new entry) unless the dialog is refreshed. I didn't like doing that since it was too slow redrawing the dialog for me (and it needed more code anyway), hence I'm sticking with the generic message.

Code: Select all

#: Or "Click to unselect....." ???????????????
#: pcreole:803 pcreole:868 pcreole:933 pcreole:998 pcreole:1063 pcreole:1128
msgid "Click to select this command to run:"
Of course, clicking the checkbox is a really a toggle (select/deselect) action, but the existing english text is what I prefer.
----

During the original creation of Pcreole, I also considered taking chunks of any duplicated text and declaring them in variables at the start of the Program, but I decided against such refactoring (though I might, or might not, reconsider that later). Hence, I'm not using T_source etc for now.

I have now created a .pot file from what was pcreole-2.0.3 (with the three header lines you told me about L18L), made the de.po and altered that with your translations before making the .mo.

I have now put all the bits and pieces into the appropriate places in /usr/share hierarchy and am in the process of uploading a new pcreole-2.0.4. The main thing thing missing, which I particularly want to add in my next pcreole release will be some code changes to pcreole itself to allow internationalisation of the Help button textfile, various gtkdialog frame labels, and the gtkdialog title window text (all of which currently remain only in english). I'm working on that now.

@L18L: Note I would be happy if you could just provide me with any text and label translations for the moment rather than modify the program itself, since it is much easier for me just to add to your translation file after creating the original .pot file myself now. Once the code is more stable, I will invite others to contribute .po/.mo files for different languages based on the pcreole.pot I will supply with the main dotpet distribution. Thanks for all your invaluable help, which, on top of what I had already read in work by shinobar and from the web, and your link to Barry's related blog, got things going very quickly.
Last edited by mcewanw on Thu 12 May 2011, 02:50, edited 3 times in total.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Pcreole version 2.0.4 uploaded

#34 Post by mcewanw »

Now with partial internationalisation support (thanks to L18L, and, indirectly... shinobar, for help with that)

To add your own translation files (e.g. for different languages) please refer to the installed file: /usr/share/doc/pcreole/pcreole.txt

and to Barry's nice article on using gettext for internationalisation at:

http://bkhome.org/bacon/international.htm

Much of Barry's info being relevant not only for BACON
----

Changes:
Pcreole 2.0.4:
Added necessary header lines in code below to allow internationalisation with gettext to work (Thanks L18L for the information):

Code: Select all

export TEXTDOMAIN=pcreole
export TEXTDOMAINDIR=/usr/share/locale
export OUTPUT_CHARSET=UTF-8
Created a new pcreole.pot, used the translation work of L18L with that to create de.po and pcreole.mo files, and put these in their appropriate places in the /usr/share directory hierarchy.

TO DO:
More on Internationalisation. In particular:
Add gettext routine and translation(s) for
the main Pcreole helpfile: $HOME/.pcreole/pcreolehelp.txt
Gtkdialog window titles and frame labels etc...
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#35 Post by mcewanw »

In my "being-tested" pcreole version 2.0.5 I now have gettext used on all the frame labels and the gtkdialog title windows... coming soon. Just the Help button text to deal with. Pcreole is, I feel, a bit slower to load with all these gettext calls, but that's the price of supporting the world's languages I suppose... :-)
github mcewanw

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

Re: pcreole

#36 Post by L18L »

mcewanw wrote:Once the code is more stable, I will invite others to contribute .po/.mo files for different languages based on the pcreole.pot I will supply with the main dotpet distribution.
Okay, that's the way to go.

And I am now going to download 2.0.4 :)
Proceed, proceed: wee'l begin these rights,

As we do trust, they'l end in true delights.
Shakespeare
now available as etext see http://murga-linux.com/puppy/viewtopic.php?p=521993

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Pcreole 2.0.5 uploaded

#37 Post by mcewanw »

Recent Changes:
Pcreole 2.0.5:
Finished the 2.0.4 TODOs!

Internationalisation support now complete I think (including the Help button text ready for translation)! Hopefully people will now upload their own tarred up translation files(po and mo files from the included pcreole.pot).

Please do that, and I'll later include these in a single separate dotpet along with the main pcreol dotpet on the first post of this thread.

You'll find pcreole.pot (once you install pcreole) in directory:

/usr/share/doc/pcreole/nls

I'm assuming you know how to create the .po and .mo files from pcreole.pot. If not refer to near to the top of the first post of this thread for some links about doing that.

@L18L: I have included a de.po and associated .mo in the pcreole dotpet, but the translation in there remains incomplete (just needs you or someone else fluent in German to fill in the missing de.po translations etc). For now, it just uses the strings you have translated so far, and I'd be grateful if you'd also add to that and upload the new de.po and associated mo in a tar file for everyone to use. Thanks in advance. Note that the included de.po does contain the pcreole main help text, but currently in english awaiting a translator! :-)
github mcewanw

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

Re: Pcreole 2.0.5 uploaded

#38 Post by L18L »

mcewanw wrote:You'll find pcreole.pot (once you install pcreole) in directory:

/usr/share/doc/pcreole/nls
Found it.
May a suggest a better location for this?

/usr/share/doc/nls/pcreole
There is a chance that other interested translators will find it independent of this thread.

Updated translation is coming soon...

Edited:
en.po is superredundant:
gettext uses the strings in the script if no pcreole.mo exists.
gettext uses msgid if msgstr is ""

Translation of HELP text ! I have just changed some words to see if that works. Seems to work...........

That is your trick. Where did you learn it from?

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Pcreole 2.0.5 uploaded

#39 Post by mcewanw »

L18L wrote: /usr/share/doc/pcreole/nls
Found it.
May a suggest a better location for this?

/usr/share/doc/nls/pcreole
There is a chance that other interested translators will find it independent of this thread.

Updated translation is coming soon...

Edited:
en.po is superredundant:
gettext uses the strings in the script if no pcreole.mo exists.
gettext uses msgid if msgstr is ""

Translation of HELP text ! I have just changed some words to see if that works. Seems to work...........

That is your trick. Where did you learn it from?[/quote]

Yes, I take your point about location of the pot file. I kept to the system used by ffconvert at the moment. As pcreole develops I may want to add other stuff in the /usr/share/doc/pcreole hierarchy so for now I'll leave things as they are.

Yes en.po is "almost" redundant, (I could cut much f it) but not completely so because of the way I'm doing the helptext file. I didn't learn the "trick" from anywhere, it just came to me as a way to handle the helptext file without having to add make many changes or add the english version in Pcreole itself.

Looking forward to your translation which I'll post as a dotpet addition in first post. To keep the install size small I'll probably keep any and all translation (po, mo addons) as separate dotpets. Then a user will only have to install the language file they need or want.
github mcewanw

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

Re: Pcreole 2.0.5 uploaded

#40 Post by L18L »

mcewanw wrote:...
I kept to the system used by ffconvert at the moment. As pcreole develops I may want to add other stuff in the /usr/share/doc/pcreole hierarchy so for now I'll leave things as they are.

Yes en.po is "almost" redundant, (I could cut much f it) but not completely so because of the way I'm doing the helptext file. I didn't learn the "trick" from anywhere, it just came to me as a way to handle the helptext file without having to add make many changes or add the english version in Pcreole itself.

Looking forward to your translation which I'll post as a dotpet addition in first post. To keep the install size small I'll probably keep any and all translation (po, mo addons) as separate dotpets. Then a user will only have to install the language file they need or want.
Rethinking about location...
/usr/share/doc/nls seems to be specific to multilingual wary
and
/usr/share/doc/pcreole seems to be standard with unix/linux
so leave things as they are. :)

helptext English
So /usr/share/locale/en/LC_MESSAGES/pcreole.mo has to be included in the standard pcreole.pet (you could delete line 19 to 307 to get smaller files)

German translation is attached.
It does not claim to be perfect so anyone who can improve it is invited to contribute a better translation.
I think it is just the pcreole.mo which have to be included into pcreole_NLS.pet
Installing by PPM one can use "trim the fat" to get just the languages that one wishes to get.

Edit
download 5 times now
I replace the attachment now having correct location for de.po (see next post) soory, that was my fault :oops:
Attachments
pcreole-german.tar.gz
/usr/share/doc/pcreole/nls/de.po
/usr/share/locale/de/LC_MESSAGES/pcreole.mo
(11.34 KiB) Downloaded 472 times
Last edited by L18L on Sat 21 May 2011, 08:09, edited 2 times in total.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#41 Post by mcewanw »

@Li1L: I repackaged your translation files into a separate dotpet which is now available in the second post of this thread along with an invitation for further translations from anyone able to help with that. Note that, in the dotpet, I moved your de.po file to /usr/share/doc/pcreole/nls/ from the location you had it inside your tar.gz (/usr/share/doc/nls). I'd be obliged if you would modify your tar.gz accordingly or delete that one.

Thanks greatly for all your efforts and for your translation, which will be very useful I'm sure.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Pcreole version 2.0.6 uploaded

#42 Post by mcewanw »

Changes very minor (no new functionality). As detailed in first post of this thread.

However, L18L has now completed and generously provided a full German translation for the pcreole interface and Help text. Refer to second post of this thread for the dotpet to add that. Invitations for further translations and some help links on doing that are provided there.

Pcreole should work on most any Puppy Linux from Puppy 2 series upwards at least. I'd be grateful for quick confirmations of which distributions it has been successfully run on since I only have dialup Internet and can only test it on what I have (Wary 5.0 and Puppy 4.3.1 and Puppy 2.17)
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Pcreole version 3.0.0 also uploaded today

#43 Post by mcewanw »

Pcreole version 3.0.0 also uploaded today

I didn't find the small interface option provided in Pcreole 2.0.x useful for my purposes. Pcreole 3.0.0 is identical in funtionality to 2.0.6 (including it working with the L18L provided German interface translation dotpet). However, the shrink window "small gui" has been re-designed to a form which is useful to myself at least. You have the choice...

An advantage of choosing to use the "shrinked gui" in either 2.0.6 and 3.0.0 is that Pcreole will start faster in that mode (albeit with less configuration options being immediately compared to either of these versions' Config/Large "GUI mode").

The shrinked "GUI mode" of either also uses less screen real-estate than the full Config/Large GUI of course.

Whichever version you prefer, Pcreole has been designed to be usable on any screen resolution of width 640 pixels and above.
github mcewanw

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

Re: Pcreole version 3.0.0 also uploaded today

#44 Post by L18L »

mcewanw wrote:...
The shrinked "GUI mode" of either also uses less screen real-estate than the full Config/Large GUI of course.

Whichever version you prefer, Pcreole has been designed to be usable on any screen resolution of width 640 pixels and above.
Here is how the new shrinked GUI looks, localized: :)
Image

BTW:
- corrected my mistake three posts above
- missing Sections B, C, ... in help
- opening a thread in Localization Project might be helpful ?

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Pcreole version 3.0.0 also uploaded today

#45 Post by mcewanw »

L18L wrote: - opening a thread in Localization Project might be helpful ?
Done: http://www.murga-linux.com/puppy/viewtopic.php?p=525522
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Pcreole version 3.0.1 uploaded

#46 Post by mcewanw »

Changes

3.0.1. Small gui now "remembers" SD_, SF_, TD_, and TF_ values on QUIT

Hopefully this will be the "stable" version for a while now ... Sorry in advance if any new bugs are discovered ... :-)
github mcewanw

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

Re: Pcreole version 3.0.1 uploaded

#47 Post by L18L »

mcewanw wrote: ... Sorry in advance if any new bugs are discovered ... :-)
in wary5.11.57 fresh frugal install running as fido. :)

pcreole 3.01 downloaded and installed
Help button wrote:In created .po translate helptxt msgstr to target lang
/usr/share/locale/en/LC_MESSAGES/pcreole missing :wink:

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Pcreole version 3.0.1 uploaded

#48 Post by mcewanw »

L18L wrote: in wary5.11.57 fresh frugal install running as fido. :)

pcreole 3.01 downloaded and installed
Help button wrote:In created .po translate helptxt msgstr to target lang
/usr/share/locale/en/LC_MESSAGES/pcreole missing :wink:
Hmmm... But pcreole.mo is in the dotpet int he correct location okay. And it all works fine on Wary 5.0. But you are using wary5.11.57 with fido. Could you try changing the permissions on the en file pcreole.mo - temporarily to read, write and execute for everyone to see if it is then found? (how about the de pcreole.mo Help?) Might need to check permissions on the directories it is in too - should be a minimum of read and execute for containing directories I think.

If it is a permissions problem, we need to determine if it is a problem needing fixed in wary5.11.57 or in pcreole... If permissions are wrong on the containing directories (which seems unlikely) that would be a wary5.11.57 bug I think; otherwise I need to know the minimum permissions to put on the file itself. Currently I do have it as Read for Everyone (the World of Others), Write for Root user only, but no-one to execute it. I would have thought that was correct, but perhaps execute permission is required for everyone?? And why does it say "pcreole" missing, rather than "pcreole.mo" missing?
github mcewanw

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

Re: Pcreole version 3.0.1 uploaded

#49 Post by L18L »

mcewanw wrote:...
And why does it say "pcreole" missing, rather than "pcreole.mo" missing?
That was me saying pcreole missing, should have been /usr/share/locale/en/LC_MESSAGES/pcreole.mo missing :?:
Sorry, my quickshot was wrong.
It is not missing. :oops:
And permissions are OK.

But reproducing what has been happening I am able now to explain.

installed preole without German NLS
pcreole started showing the texts in English like expected
Help showing
In created .po translate helptxt msgstr to target lang
That was not expected by me but now it is clear.

gettext worked:
my LANG is de
no /usr/share/locale/de/LC_MESSAGES/pcreole.mo found
so gettext returned the msgid In created .po translate helptxt msgstr to target lang

May way to show the help:
LANGUAGE=en pcreole :arrow: everything like expected
or
LANGUAGE=de:en pcreole :arrow: everything like expected
gettext tries de and if not found uses en for each single msgid

Anyway, what can be a concluded from all of this?
Every new user (except the LOCALE=en...) could stumble into the same trap
This trap is caused by your creative use of gettext for the help.

How to avoid the trap?
- use gettext just in the intended way or
- create a workaround

workaround:
create a code snippet which is setting LANGUAGE to <user's langcode><colon>en
and put it at the beginning of pcreole script.

Here a quick and dirty one:

Code: Select all

LANGUAGE="`echo ${LANG:0:2}`:en"
8)

Why dirty?
Working correctly just for 2-letters codes
Not for Portuguese of Brazil (pt_BR) and Chineses :oops:

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Pcreole version 3.0.1 uploaded

#50 Post by mcewanw »

L18L wrote: This trap is caused by your creative use of gettext for the help.

How to avoid the trap?
- use gettext just in the intended way or
- create a workaround

workaround:
create a code snippet which is setting LANGUAGE to <user's langcode><colon>en
and put it at the beginning of pcreole script.
Oh... Now I see what you mean. Hmmm... I don't really want to clog up the main pcreole script with the whole help text in english - since that also swells the sizes of all the .po and resulting .mo files, but I'll think about it or maybe adopt your suggested workaround or something like it as a compromise... As things stand it certainly encourages users to make new translation files... :-)

Of course copying the en pcreole.mo into the relevant locale location would also bring back the English version of the help button text.
github mcewanw

Post Reply