Hello again all. There's a do-plugins branch up at lp:~raof/do-plugins/plugins-i18n that makes plugins actually use the translations that we have for them.
For those people writing new plugins or modifying existing ones, here's
a simple guide to ensure your plugins will use translations.
1) Use the Mono.Addins namespace, rather than Mono.Unix. Like so:
"""
using Mono.Addins;
"""
2) All the strings that you want to be translatable need to be run
through AddinManager.CurrentLocalizer.GetString (). This *replaces*
Catalog.GetString ().
An example:
"""
AddinManager.CurrentLocalizer.GetString ("This message will be
translatable");
"""
or:
"""
AddinManager.CurrentLocalizer.GetPluralString ("{0} plugin enabled",
"{0} plugins enabled", numPlugins, numPlugins);
"""
3) Add a Localizer property to your Foo.addin.xml, such as
"""
<Localizer type="Gettext" catalog="gnome-do-plugins"
location="@expanded_datadir@/locale" />
"""
3a) If your plugin wants to use the existing gnome-do-plugins
translations, you'll want to add this to Foo.addin.xml.in and include
Foo/Resources/Foo.addin.xml to configure.ac
You're now done.
If your plugin isn't in the main gnome-do-plugins project, or you'd like
to maintain it separately, you can change the Localizer to load a
different set of translations; change the catalog if you produce
Foo.pot, or if you want to use a different translation mechanism you can
change type.
signature.asc
Description: This is a digitally signed message part
