Cruisers & Sailing Forums (
-   OpenCPN (
-   -   OpenCPN Internationalization ( i18n ) (

bdbcat 16-12-2009 20:22

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

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)


cvs -z3 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


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

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:

{wherever opencpn executable lives}/lang
Set your system locale to the desired language_region. Run opencpn as usual. Admire your work. :popcorn:

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


idpnd 17-12-2009 03:12

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

idpnd 17-12-2009 08:19

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

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

$LANG=de_DE.UTF-8 opencpn

Does not bring up the translated version :banghead:

cagney 17-12-2009 08:38


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


idpnd 17-12-2009 10:11

Nope.. thanks for the hint though ;)

bdbcat 17-12-2009 10:51


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

idpnd 17-12-2009 11:02

I sent it to your yahoo address earlier, perhaps it's in the spam folder?

cagney 17-12-2009 11:44

Just starting to read some "friendly manuals":D

If you start opencpn from the command line in $HOME, I would try to stick the .mo file in $HOME.

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

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


bdbcat 17-12-2009 13:51


Got 'em from the spam bucket. Thanks

bdbcat 17-12-2009 20:27


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

Try moving the .mo to


This works for me.

However, if I test by setting

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.


idpnd 18-12-2009 03:04

Thanks Dave! Got it working via


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


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 ;)

grietick 20-12-2009 04:33

The frenchies are here! :whistling:

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

(but my english is not so good.... sorry:D )

idpnd 20-12-2009 05:06

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.

grietick 20-12-2009 05:51


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

( i have downloaded the poedit! )

idpnd 20-12-2009 06:08

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

All times are GMT -7. The time now is 21:35.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.