Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

msei18n

Internationalization tool for Pascal programs by Martin Schreiber

View on Codeberg

Member rating

No ratings yet.

Sign in to rate this project.

README

MSEi18n

MSEi18n is a tool for generating multi-language resource modules for MSEgui projects (but also for Lazarus projects, and even for any Free Pascal program). It is also a translation editor, like Poedit.

The modules are libraries loaded at runtime as needed. All form data can be adapted to each language, not only texts, and the texts can be exported to a spreadsheet for translation by non-programmers.

Written by Martin Schreiber as part of MSEide+MSEgui (tools/i18n); this repository is a standalone version with fixes and additional demos.

Screenshot

Features

  • Sources: MSEgui forms (.mfm), Free Pascal resource strings (.rsj), resourcestring sections of Pascal units, C-syntax string resources.
  • Translation grid with one column per language, comments, "do not translate" flags and filters.
  • CSV import and export.
  • Make generates and compiles one library per language: lib<name>_<lang>.so on Linux, <name>_<lang>.dll on Windows.

Building

Requires Free Pascal and the MSEgui sources.

pascal
make MSEDIR=/path/to/msegui

On Windows, use make -f MakefileWin MSEDIR=C:\path\to\msegui. MSEi18n can also be built in MSEide by opening msei18n.prj and pressing F9.

Usage

  1. Settings > Configure MSEi18n: set ${MSEDIR} to the MSEgui directory, with a trailing slash, and ${COMPILER} to the compiler (e.g. fpc).
  2. New: create a translation project (.trp settings and .trd data files).
  3. Edit: add the files to translate with their Kind, and one row per language with its directory (which must exist).
  4. Translate, then Save.
  5. Make: build the language libraries.

In the application, add msei18nutils to the uses clause and load a language with the library base name, or go back to the original language with an empty string:

pascal
loadlangunit('demo_de');
loadlangunit('');

Resource strings are UTF-8 encoded: display them with utf8tostring(rs_goodbye).

Demos

The demos directory contains three projects with German and French translations: i18ndemo (from MSEgui), weather (the project of the tutorial) and button. The paths stored in the .trp files are absolute and must be adapted after cloning.

Documentation

License

GNU General Public License, version 2 or later. Copyright (c) 1999-2014 Martin Schreiber.