3) Check script file in Geany by using Find 'get' command
This will list all occurrences of 'gettext'. Check the spelling
carefully. I guarantee that there will be mistakes.

4) Run the script in a terminal (you can use ./script_name)
and read error messages. Script must be executable of course.
Line numbers reported by terminal won't be accurate
if you have a gtkdialog script.

5) When your script will run without complaint in the terminal, then
put it in a folder that holds executable apps (example /usr/bin/)

7) Launch MoManager from start menu or terminal (it is launched in terminal by typing
'poeditor'). At the top right of window there will be a list of scripts
that need a mo file. --> mo file is the final file of translations.
Tick 'edit with poedit' and click Create button. The procedure is
fairly straight forward but if you haven't prepared your script properly
you will have problems. If you do have problems it is
time to quit. Unfortunately MoManager creates files on your hard disk
that will cause subsequent problems even if you do correct your script.

...But here is the solution to these problems....

1)Trash the folder /tmp/momanager
2) Trash the mo file if it has been created in
/usr/share/locale/fr/LC_MESSAGES/ (assuming French is current
language) In fact you should remove the German,Spanish and other
translations of your script if they exist.
Note: You can check the time of creation if in doubt about who
created the mo file

3) Trash the pot file in /usr/share/doc/nls/script_name

You now have a fresh system that won't confuse MoManager.
Correct your script and run MoManager again.

Another tip ---> I've had problems when I add more gettext
entries to a script. This means that more translation entries are needed.

The method I used ---> make a pet package, holding just the script.
Be careful the correct files are inside!! No mo or pot files inside.
Save old mo files somewhere safe.

Now go through the 3 step procedure I wrote above to obtain a fresh installation.
Now install your script which is easy since
you made a pet package. Now run Momanager and it will
think the script has no tranlation yet and create a mo file from scratch.
It's fairly easy to fill in the entries again.

Alternatively you can put back a mo file (if it is correctly formed!!)
just before launching MoManager and poedit will look
like this (see image) The untranslated expressions will
be on top of list. A nice feature of poedit. Everything
should be straight forward. mo and pot files can be created and saved.

____________________________________________________Last edited by don570 on Sat 13 Apr 2013, 13:12; edited 3 times in total

The experiences described here are
not with "just translate"
but with changing the code in a script to enable translations

momanager was built to enable translations of puppy in one GUI.

-------

For people who want to try making a script "international" I suggest another approach (how I do it):

1- put in the 2 lines (TEXTDOMAIN and OUTPUT_CHARSET) into the script
2- start with "gettexting" 1 message (title or frame)
3- start your script to make sure it can run
4- start momanager and select the new item and translate that 1 message
5- (re)start your script, you should see that translated message
6- if not search the fault and/or ask!
7- have a break or stop for this day or finish
8- goto 2

When I gettexted 'pupmd5sum.sh I used a different method as you noted.

I worked entirely in English. By a miracle I was able to convert
to gettext and track down the errors fairly quickly but working with
MoManager is tough. I had a bad experience because I had typed in the
wrong script name(Shinobar had given pupmd5sum.sh a different name)
export TEXTDOMAIN=script_name

It took me some time to track down that error and then it took me
more time to realize that I needed to clean my installation of old
files created by MoManager . In other words I needed a 'fresh' installation.

What irks me about MoManager is that it takes 2 minutes at least for
it to launch on my machine, so if I have to do that each time
I do a conversion of a expression into English gettext I'll go nuts.

So I think the best method is to do just one translation of an expression
into French and check that everything is okay.

Then proceed to do a conversion of all the English gettext script expressions using Geany.

Then switch to French with country wizard and launch MoManager
to translate script to French. Hopefully MoManager will see the
previous mo file that was created and react appropriately i.e. create
a po file that poedit can open.

Sometimes when translating a script I need to see if it looks good on GUI and I make some small changes to translation. But MoManager updates long time so my solution is go to /tmp/momanager:

Code:

cd /tmp/momanager

and do this

Code:

cp jwmconfig2.mo /usr/share/locale/ru/LC_MESSAGES/

every time when I do small changes to translation. Then I run the translated application to see how it looks.
As I use Poedit mo-file is created when I press Save button. When translation is complete I use MoManager.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum