[Mono-devel-list] Why not to use gettext ()

Kornél Pál kornelpal at hotmail.com
Wed Jun 15 16:52:32 EDT 2005


> From: Miguel de Icaza
>> So I think none of these issues are critical.
>
> None are critical, but there is no compelling reason to use something
> different.

I resubjected the message to separate this topic form my Locale.cs
implementation that uses gettext () style resouce management.

My reasons against using English texts as identifiers:

1. Every modified character in English text has to be modified in all of the
other language files as well. This prevents distributing satellite
assemblies separately or using satellite assemblies that are not very up to
date.

As translations will probably done by a different set of people than the
code I can imagine that satellite assemblies will be released independently
from the code.

And this will result in English text being used altought the text is aready
translated but a single forgotten character was added to the English text.

While it an English text can be reworded or just corrected for a lot of
reasons it's very unlikely to modify any of the string resource identifiers.

2. Mono itself has a complete infrastructure for localization
(ResourceManager, ResourceSet, ...) designed for identifier based resource
files.

3. It is wasting of disk space as identifiers are stored in UTF-16 while
texts are stored in UTF-8. So it requires less disk space to use relative
short string identifiers than using whole sentences as identifiers.

Note that returning the identifier parameter as the text is faster when
using English messages because they are not looked up in a Hashtable but I
think this does not affect overall performance very much and Hashtables has
to be used for any other languages anyway.

Kornél




More information about the Mono-devel-list mailing list