[Gtk-sharp-list] Translations of a project, GetText and the
Gonzalo Paniagua Javier
14 May 2003 17:06:05 +0200
El mié, 14 de 05 de 2003 a las 16:16, Lee Mallabone escribió:
> On Wed, 2003-05-14 at 15:00, Gonzalo Paniagua Javier wrote:
> > I did some proof-of-concept stuff for i18n in nunit-gtk.
> > monoresgen supports .po files <-> resources conversion (in fact, one of
> > these days I will change nunit-gtk to use .po files).
> Does this mean you can embed .po files directly in an executable, or do they need to be converted with monoresgen first?
monoresgen is needed first.
monoresgen strings.txt strings.po
will convert the current nunit-gtk strings.txt to .po format (more or
monoresgen strings.po strings.resources
will convert from .po to a .NET resource file suitable to be embedded
and used by ResourceManager.
> How do you make use of the .po files - does the ResourceManager take care of that, or is this all currently specific to your nunit-gtk stuff?
Once they are converted into resource files, ResourceManager takes care
of the details.
For example, if the current UI culture is es-ES, it will look for a
satellite assembly (nunit-gtk.resources.dll). If it finds the assembly,
will look for strings.es-ES.resources in that one (note that "strings"
is configurable, you pass that name to ResourceManager) if not, it tries
nunit-gtk.exe assembly. If it fails, it will look for the parent culture
of that one, i.e. 'es' and, if it does not find it, it will end up in
the invariant culture, which will lookup the string in strings.resources
file (either in the satellite assembly or nunit-gtk).
> I suspect po file usage is an issue that should be well documented in the Gnome.NET section of the mono handbook.
Well, first I'd like to either make xgettext work with .cs files or make
some scripts (i have the one for .cs files) that create/merge/etc.. a
.po file from the source files (including glade).
I'd also like someone to add a patch to gettext to allow hooking up a
function that is called from gettext before trying to find a suitable
string. If the hook resolves it, return that one.
This way, we could 'plug' ResourceManager into gettext and have the best
of both worlds.
But well, this is just an idea that have to be further discussed.