Miniscope v4 - localization with GNU gettext
Miniscope v4 user interface can be localized with GNU gettext Delphi and C++ Builder (dxgettext) tools. It allows to add or modify translation without changing source code and recompiling.
Miniscope is non-Unicode application. When testing translation (running program with other than English language selected) you may have to change "Regional and Language Options"/"Language for non-Unicode programs" to in order to correctly display characters outside basic ASCII set.
In order to start you have to install dxgettext package, preferably 1.2.2 version.
Use "Integrate with desktop environment" and "Modify path" options when installing.
Integration with Windows Explorer can be also fixed later using shortcut created in Start menu.
Second tool needed is translation files (.po) editor. In general any text editor, preferably with unicode support might be good, but I would recommend Poedit. It also creates more effective .mo file when saving text .po file.
Creating new translation
- extract template with strings that need to be translated from application
sources (or use default.po file if it is supplied with binary); check "Add likely ignores to ignore.po file" and
"Remove items from default domain present in ignore.po file" options
- create application subdirectory \locale\language code\LC_MESSAGES\ and copy default.po file here
- open copied default.po file with Poedit, translate; if you want to test partial translation then save file (corresponding .mo file will be generated, close miniscope first or there would be problem overwriting default.mo) and run miniscope
- optionally you can embed translations inside executable
Updating existing translation
It is very likely that translation file will become outdated when new release of application will arrive. In few steps you can update missing translation:
- extract strings that need to be translated from application sources (or use .po file if it is supplied with binary) - just like when creating new translation
- if you've extracted fresh default.po file then it would miss some meta-data (charset) and merge tool will be unable to use it; meta-data can be added by opening this file with Poedit and saving it not changing anything - it reports some error, but output file is fine and ready to merge
- go to default.po that needs to be updated (inside \locale\language code\LC_MESSAGES\ directory)
and merge it with new default.po template file
- open merged file with Poedit, update translations
- test translation, optionally embed translation file inside executable