Localization

From Free Pascal wiki
Revision as of 16:59, 25 June 2006 by Xhajt03 (talk | contribs) (New page describing localization)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Localization of compiler messages

FPC was created in a way allowing easy localization of compiler messages to different languages. Quite a few translations are already available, but taking into account the number of languages used around the world, there's always space for improving. ;-)

How to start

First of all, check which languages are already supported. In installed tree, the message files are stored in subdirectory called "msg". In SVN, these files are stored under /compiler/msg/.

Every file contains all message in a particular language and using particular character encoding or "code page" (note that different platforms use different ways of encoding characters). As of now, the compiler has no restrictions regarding how how the individual files are named, but the convention is that all files start with "error", followed with one or two letters identifying the particular language and then optionally followed with another letter used to distinguish the supported encoding (e.g. "w" for Windows, "i" for ISO character sets used for Unix platforms, or possibly "d" for the so called IBM or OEM codepages used with DOS and OS/2). All message files have an extension ".msg".

If you don't find message file for your language, or if you find that the existing one looks outdated, you can send an e-mail to fpc-devel mailing list stating that you are interested in providing translation to a new language. This e-mail is recommended to avoid having two people working on translation to the same language in parallel without knowing about each other. Once you're finished, you can send another e-mail to fpc-devel announcing so - you should be contacted by one of the FPC core team members shortly afterwards, he will provide you with instructions where to send the finished file (the mailing list has limits for maximum size of attachments) and then add the file to the SVN repository.

Source

The primary language is English, which means that errore.msg is always the most up to date message file. Although you could use a different language as your basis, it isn't recommended (you can still use some other language as a reference if a particular message in English isn't clear to you and you know some other language better, of course). In addition, it's recommended to always start with a latest revision of errore.msg from trunk branch in SVN repository rather than e.g. message file from some previous FPC release (which might be already several months old at that time).

If you cannot use SVN client for accessing our SVN repository for some reason, you can always use ViewCVS WWW interface as an alternative. Some hints for using this interface follow:

List of message files
You can see the existing message files and information about their most recent update (revision number and age) here. Clicking on the message file name provides you with the history of changes for this file. Clicking on its revision number shows the latest version and provides a link for downloading it.
Differences between two revisions
This link shows all changes performed in errore.msg between SVN revision 1 (roughly corresponding to FPC release 2.0.0) and revision 3940 (the latest SVN revision as of writing this text). Changing the revision numbers and/or file name in the link allows you to display changes for other revisions/files. As you can see, it's very useful to know the SVN revision number of errore.msg file used as basis for your translation (and preferably put it to comments on the top of the translated file together with your contact information) - when updating previously created message file, one can easily check changes in the English version since that revision and translate just the modified parts.

Localization of other resources

There are other texts related to FPC which can be translated to other languages:

  • RTL texts (especially units rtlconsts and sysconst)
  • Free Vision (strtxt.inc)
  • IDE (fpstre.inc)
  • Community portal
  • Possibly documentation (note that this is a huge task - FPC documentation is very extensive)
  • Localization of Lazarus