Sign in Join

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

Mailing lists / lazarus / 1999-07

Language support

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Daniel

-> It's always hard and trickous to translate an application when the development tool is not provided with translation facilities. This problem can be solve with powerful tools (but it's worth 50,000$ for the easiest to use and deploy !) or by implementaing this translations in the application layers. This last solution must be apply to every project that need translation, so it's heavy.

Translation of an application has multiple goals to achieve :
1) translation of messages in "text" (or caption, or over) properties : All messages that are directly entered on object browser in IDE.
2) translation of messages that are in source code (such as strings used for error messages like "ShowMessage('File missing'))
3) Date, time, currency, number format.
4) Translated messages reusability, so that already translated messages could be used by al lot of application without translating them again (I think "Exit" will be encountered quiet a number of times in a lot of application :-).
5) Certainly, I'm not exhaustive. :-(

Q1: Is it plan to introduce translation facilities in Lazarus ?

Reply by email

Michael Van Canneyt
to Daniel
Daniel wrote 8 lines
-> It's always hard and trickous to translate an application when the development tool is not provided with translation facilities. This problem can be solve with powerful tools (but it's worth 50,000$ for the easiest to use and deploy !) or by implementaing this translations in the application layers. This last solution must be apply to every project that need translation, so it's heavy. Translation of an application has multiple goals to achieve : 1) translation of messages in "text" (or caption, or over) properties :

All messages that are directly entered on object browser in IDE.

2) translation of messages that are in source code

(such as strings used for error messages like "ShowMessage('File missing'))

Show quoted text 5 lines
3) Date, time, currency, number format. 4) Translated messages reusability, so that already translated messages could be used by al lot of application without translating them again (I think "Exit" will be encountered quiet a number of times in a lot of application :-). 5) Certainly, I'm not exhaustive. :-( Q1: Is it plan to introduce translation facilities in Lazarus ?
I have just implemented support for the Delphi 'resourcestring' section;

It works like in Delphi, only more powerful;
When compiling a program that contains resourcestrings, the compiler generates a table with the resourcestrings in it; the RTL contains routines for getting/setting the value of these resource strings.

The compiler also generates a file with all resourcestrings in your program: A .rst (from Resource String Table) file with lines of the form UnitName.ConstantName='The string'
(It can also generate such a file for each unit)

This file can then be converted to whatever you want: A resource dll on Windows
a MO file for GNU gettext on Linux (this is being worked on at the moment);

In principle it is then possible to design a unit, say NLS, that checks the OS language setting, and sets all resource strings to the correct values; This unit can be made with whatever system you like; you can even have multiple units that implement different systems.

It is imaginable that Lazarus has facilities for manipulating the .rst file, and providing some easy means of translation.

Concerning internationalization: the sysutils unit has all needed functionality for internationalizing your application; it works exactly like in Delpi:

Michael.

Reply by email