Languages

The overall internationalization system is described in the Plugins i18n page.

Using Weather_routing_pi as an example

Notes from Crowdin Source Maintainers:

Pavel [nohal] "owns" OpenCPN Crowdin and both he and Dave [bcdcat] will of course maintain Crowdin. [Hakan] offers his help to relieve the pressure on Pavel and Dave. So he’ll of course do what he can whenever possible and needed.

What a plugin developer has to do is give us a message whenever the code is ready enough to update Crowdin, that’s the main issue. If potfiles.in and the xxx_pi.pot is also updated in source it’s very fine. But the message to any or all of is the main task.

Then we will try to watch Crowdin for updated translations but a forum note from translators is of course also appreciated.

Communications with Source Maintainers:

1. Plugin developer determines when to advise Hakan, Pavel & Dave when there are going to be no more new strings so that a *.POT file can be developed.
2. Hakan, Pavel or Dave develop the [plugin].pot file and post it to Crowdin announcing a deadline by which language updates must be ready.
3. Hakan, Pavel or Dave make a Pull Request to the plugin developer with the completed language *.PO files.
4. Plugin developer merges the Pull Request and then the languages become available when the plugin in is built the next time.

Crowdin Project OpenCPN - Translators are needed

Translators are needed. Please register and login, to help us translate.
[We need a description of how this is done in Crowdin in this section.]
1. Once you have logged into the Crowdin OpenCPN Project, you can select a language.
2. You will be presented with an outline of OpenCPN and each of the plugins that are available.
3. These sections show the % Completed. Clicking on a section, will allow you to add translations word by word or phrase by phrase.
4. When the translations have been completed for OpenCPN or one of the plugins, the developers then move the completed files into the "build" process to embed the translations into OpenCPN or the Plugins. This is not an instantaneous thing and requires communication and coordination with the translators. So translators should leave messages in the forum when they are done. We suggest using the Internationalization thread for leaving messages of this nature.

Basic Steps Required to create Language files

as described by Gerhard.

Create or Update the POTFILES.IN file

The first job is to make or update the POTFILES.IN which is simply a list of all source file names that have language strings. This file lives in the PO directory.

There appears to be no real difference between Windows and other operating systems for making po/mo files. You need the "gettext" command, make a search for gettext for Windows in Google. Also you need to know how the Terminal works, especially the path handling. The Compiling thread has instructions for installing gettext.

Then first make an ASCII file called POTFILES.in when not available already, which holds all source file names of your plugin line by line, but only those files which may contain language strings. These language strings are preceded with _(" , that is underscore, bracket open and quotation mark. e.g.: _("This is a text for translations.")

In the Terminal you use the gettext command like this:

gettext –from-code=iso-8859-1 –force-po –package-name=xyz_pi –package-version=1.0 –output=xyz_pi.pot –keyword=_ –width=80 –files-from=POTFILES.in

So the parameters for gettext are
–from-code= the kind of code
–force-po to force a po file
–package-name= the name of the plugin
–package-version= the version of the plugin
–output= the name of the resulting pot file
–keyword=_ as explained above
–with=80 the length
–files-from= POTFILES.in the list of files to be processed

If you think there are strings missing in the resulting pot file go to the plugin source files and look there for these strings. Perhaps they are preceded with _T(" or wxT(" and not with _("

Updating an Old PO File

If you have already an old po file you can merge it with your new pot file using the msgmerge command which is part of the gettext bundle. Use msgmerge –help in the Terminal window to see how it works.

Making an new PO File

Otherwise simply make a copy of your new pot file with the extension po to receive an empty po file for the translation work with Poedit.

Preparing for Crowdin Source Language File updates for Plugins

as described by Hakan

1. Update the "potfiles.in". See Gerhard’s description above.
2. Then produce a fresh " weather_routing_pi.pot " file.
3. With a new updated pot-file Hakan can update Crowdin in a minute, so that translators can complete the work.
So unless no one can update potfiles.in and produce a fresh " weather_routing_pi.pot " file

Use VS2013 to "Build only" the POT project for the Plugin

In VS2013 use "Build only" of the POT file project, but first be sure that potfiles.in is updated. Hakan needs the fresh pot file to update Crowd Source.

1. Open Visual Studio 2013
2. Open weather_routing_pi.sln located in the build directory of weather_routing_pi local git directory.
3. Find in Solution Explorer "weather_routing-pot-update" and expand it there should be cmake rules, etc.
4. Right click on "weather_routing-pot-update" and select the third down "Project only", then select "Build Only "weather_routing-pot-update".
5. Output window shows Build: 1 Succeeded 0 Failed
(Did the same with "weather_routing-po-update" which builds only the po files.)

You may Upload the [Plugin_pi].pot file to Hakan via the forum as attachment or via email.*
weather_routing_pi.pot (take off the pdf)
So I just uploaded the file to the forum thread here as an example and very soon afterwards Hakan reported that the files on Crowd Source were updated and ready for the Translators.

Next step will be to collect the *.PO files and compile them with the plugin.