Translation guide

szmCt Manual documentation | prev | next | TOC/Language | Contact to

szmCt is designed to be translated by the GNU gettext mechanism via wxWidgets. It is also designed so that HTML can be referenced from szmCt if available.

Currently, there is nothing in place to ease the translation process. Only for HTML files, tools/create_stub_for_new_language.py and tools/replace_html_footer.py are exists, that require knowledge of python programming.

In the example below, the target language code is xx, but it is not limited to two characters, and the form xx_yy@zzzz is commonly used. If the xx part corresponds to two ISO 639-1 characters, and if the yy part corresponds to two ISO 3166-1 alpha-2 characters, it will be subject to automatic selection when the OS is running in that language. If manual selection is assumed, there is no such restriction, and you can name folders freely, including non-English ones.

You may do the translation work in a separate directory, but you will not be able to refer directly to the location of the source text as noted in szmCt.po. Even in this case, you can still translate and output the .mo file.

It is a little confusing in poEdit, but if you right-click in the list of source language and translation, you will get a pop-up menu to refer to the translation source.

Where there are only proper nouns or symbols in a row, you can leave them untranslated. Untranslated portions will simply remain untranslated.

When one of the following tasks is completed, szmCt will automatically use the translation if the language used in the environment where szmCt was launched is xx. Otherwise, you will have to specify it manually from the menu.

When building from source code

  1. Let xx be the code for the target language. Duplicate i18n/szmCt.pot and rename it to i18n/xx.po.
  2. Translate using e.g. poEdit, just update xx.po, no need to convert to .mo files (as they are automatically generated during build).
  3. In CMakeLists.txt, immediately after the i18n/ja.po entry, either leave a space or create a new blank line and enter i18n/xx.po.
  4. If you have 3rdparty/wxWidgets/locale/xx.po, insert ${szmCt_abspath_to_wxWidgets_src}/locale/xx.po in CMakeLists.txt on the line after ${szmCt_abspath_to_wxWidgets_src}/locale/ja.po.
  5. If possible, prepare HTML and related files into doc/xx with the same structure and file name as doc/ja. It is also recommended to create a link from doc/index.html to doc/xx/index.html.

Build with the above and you will be able to use translations for xx.

To be placed around installed szmCt

Basically, this is only possible on Windows and macOS; on Linux, this would be very cumbersome even if possible, since you would need administrator privileges every time.

  1. Let xx be the code for the target language. Duplicate i18n/szmCt.pot and rename it to i18n/xx.po.
  2. Use poEdit or similar to translate i18n/xx.po and generate the file named i18n/xx.mo.
  3. Create a new xx folder in i18n used by szmCt.
  4. Duplicate xx.mo in the newly created folder and rename it to szmCt.mo. In other words, you should now have i18n/xx/szmCt.mo.
  5. If you have 3rdparty/wxWidgets/locale/xx.po, create xx.mo for it, duplicate it in the same way, and rename it to wxstd.mo this time.
  6. If possible, prepare HTML and related files into doc/xx with the same structure and file name as doc/ja. It is also recommended to create a link from doc/index.html to doc/xx/index.html.

Now you can use translations for xx from szmCt.