Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 16-12-2009, 19:22   #1
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,384
OpenCPN Internationalization ( i18n )

Hello Team...

We have some volunteers and some skeleton programming effort done to support internationalization of the text strings in opencpn.

The purpose of this thread is to educate potential translators, coordinate the effort, and discuss the issue in general.

So, here is my proposal:

Translation Workflow.

1. Each Beta and Production release of opencpn will include a .pot (message template) file called
Code:
opencpn.pot.
This file is in a Uniform standard format and generated by xgettext run against the current opencpn source tree.

This file may be retrieved from the sourceforge cvs tree by the following command (from linux)

Code:
cvs -z3 -d:pserver:anonymous@opencpn.cvs.sourceforge.net:/cvsroot/opencpn checkout -P opencpn/po/opencpn.pot
2. Those wishing to supply translations for opencpn messages (translators) should do the following:

copy the opencpn.pot file to another file whose name follows a standard format.

For example, a French translator will do this:
$cp opencpn.pot opencpn_fr_FR.po

UK English translator will do something like:
$cp opencpn.pot opencpn_en_GB.po

etc.

3. Translators will edit the copied file, supplying translations for the indicated strings. You may use any text editor, or you may use poedit, whcih is a nice wxWidgets GUI application built just for this purpose.

For example, here is a piece of opencpn.pot

#: src/chart1.cpp:910
msgid "Cannot create opencpn home directory"
msgstr ""

Translator's job is to fill in the entry msgstr"" with a translated string. Easy, if you know both languages well.

4. Last step is to compile the .po file into a .mo file. This may be done from within poedit, or you may use the linux CLI utility msgfmt for the job.

5. Send the resulting .po and .mo files to me by email, and I will integrate them into the build and next release of opencpn.

6. You may test the .mo file locally by copying it into the directory:
Code:
{wherever opencpn executable lives}/lang
Set your system locale to the desired language_region. Run opencpn as usual. Admire your work.

7. When we make a new release, your work up to this point will not be lost. We plan to merge the existing .po files with a new .pot master file, creating new .po files which will be available for CVS checkout, edit, and update.


This is a new process for me, so there will doubtless be hiccups as we bring it online. I welcome comments/shortcuts/clarifications from others who may have done this work before.

Lets give this a try and iron out the wrinkles as we find them.....

Dave
bdbcat is offline   Reply With Quote
Old 17-12-2009, 02:12   #2
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Lightbulb

Wonderful! I use EN locale, find instructions on ad-hoc changes to locale here!

...and reserve your working language so as to avoid duplication..

I'll have German
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 17-12-2009, 07:19   #3
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Ok, I've translated and compiled an .mo file using poedit (readily available on ubuntu repositories, and excellent btw). However,

{wherever opencpn executable lives}/lang

$ which opencpn
/usr/local/bin/opencpn

However, copying opencpn_de_DE.mo to /usr/local/bin/lang does NOT help.

$LANG=de_DE.UTF-8 opencpn

Does not bring up the translated version
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 17-12-2009, 07:38   #4
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
idpnd

Try to put the lang directory in "/usr/local/share/opencpn", where a lot of other OpenCPN data-directories are.
Nothing to loose!

Thomas
cagney is offline   Reply With Quote
Old 17-12-2009, 09:11   #5
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Nope.. thanks for the hint though
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 17-12-2009, 09:51   #6
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,384
idpnd....

Not surprised at this. Lots of this code is untested with real .mo files.

Will you please send me your .po and .mo for testing here?

email in Help->Authors

We'll get it....
Thanks
Dave
bdbcat is offline   Reply With Quote
Old 17-12-2009, 10:02   #7
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
I sent it to your yahoo address earlier, perhaps it's in the spam folder?
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 17-12-2009, 10:44   #8
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Just starting to read some "friendly manuals"

If you start opencpn from the command line in $HOME, I would try to stick the .mo file in $HOME.
Quote:
Add a catalog for use with the current locale: it is searched for in standard places (current directory first, then the system one)
Out on a limb

Also worth trying to swap "./lang" for "lang" in "/opencpn/src/chart1.cpp"

Thomas
cagney is offline   Reply With Quote
Old 17-12-2009, 12:51   #9
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,384
idpnd...

Got 'em from the spam bucket. Thanks
Dave
bdbcat is offline   Reply With Quote
Old 17-12-2009, 19:27   #10
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,384
idpnd....

This stuff is very hard to pin down.....

Try moving the .mo to

/usr/local/share/locale/de/LC_MESSAGES

This works for me.

However, if I test by setting
LANG=de_DE

I get an error dialog saying "Cannot set locale to ."

Very strange, this. But, the translated subset of opencpn messages come out all right anyway.

Dave
bdbcat is offline   Reply With Quote
Old 18-12-2009, 02:04   #11
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Thanks Dave! Got it working via

Quote:
/usr/local/share/locale/de/LC_MESSAGES.
To temporarily change the locale environ string, use the following command to launch opencpn from the command line (as prescribed on the ubuntu wiki above):

Quote:
LANG=de_DE.UTF-8 opencpn
That worked for me.

There appears to be still quite a lot missing (toolbox - headings, vector chart settings, status bar content).

I should think we can leave the items with EN descriptors as is, I feel they are understood by most users and easier for novices than purely graphical icons.

Where are the Frenchies/Italians (Marco?)/Spaniards/etc? I may have a go at Brazilian Portuguese even
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 20-12-2009, 03:33   #12
Registered User
 
grietick's Avatar

Join Date: Dec 2009
Location: on board
Boat: Beneteau EVASION 37 DL
Posts: 8
The frenchies are here!

if you explain me how i can do it, i do it with pleasure!

(but my english is not so good.... sorry )
__________________
"I live aboard a Troll, but i'm not a Troll ! "
grietick is offline   Reply With Quote
Old 20-12-2009, 04:06   #13
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Mon francais est terrible grietick mon ami

Are you on windows or linux?

1) Get the most recent source code and modify the .pot file as described above (rename to opencpn_fr_FR.po)

2 ) Download the suitable version of poedit here if you're on windows or mac, otherwise you can download it using apt on debian/ubuntu "apt-get poedit"

3) When you save the file, it generates a .mo file which you can use with the beta version of opencpn.

Note that not all strings are currently included, and further work will be required in due course.
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Old 20-12-2009, 04:51   #14
Registered User
 
grietick's Avatar

Join Date: Dec 2009
Location: on board
Boat: Beneteau EVASION 37 DL
Posts: 8
Windows!

where can i have the most recent source code, please?

( i have downloaded the poedit! )
__________________
"I live aboard a Troll, but i'm not a Troll ! "
grietick is offline   Reply With Quote
Old 20-12-2009, 05:08   #15
Registered User
 
idpnd's Avatar

Join Date: Sep 2007
Location: Almería, ES
Boat: Chiquita 46 - Libertalia
Posts: 1,558
Find the sourcecode here, make sure you choose the .tar.bz2 file. You may have to download additional software to unpack the code.

Next locate the .pot file under /po/ as described above, rename it to opencpn_fr_FR.po. After editing the file, you get a .po and an .mo file, which are to be sent back to dave for incorporating into the next beta I guess. I can also test them for you here (not sure how to test them on windows).
__________________
sv Libertalia
idpnd is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenCPN 2.3.0 dlymn OpenCPN 3 29-06-2011 01:44
Help with OpenCPN moggie OpenCPN 4 15-02-2011 16:18
Help with OpenCPN moggie Marine Electronics 1 10-02-2011 06:26
OpenCPN bdbcat OpenCPN 1343 19-09-2009 15:59

Advertise Here


All times are GMT -7. The time now is 01:08.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.