0

It is my understanding that only one single catalogue can be loaded (one .mo file), as per Translation Workflow Overview ยง5.

The Python example in Finding Message Catalogs at Runtime seems to support this with the assertion that

[a]lthough find() shows the complete list of catalogs, only the first one in the sequence is actually loaded for message lookups.

Likewise, the old Mono.Unix.Catalog does not seem to be able to load more than one .mo file at a time.

When I have one catalogue per library and build my application, presumably I have to use msgcat to merge the .po files of libraries and application into one .po file and then translate that merged file into one .mo file.

... But merging .po files with different Project-Id-Version (which is of course different per artifact) results in a #, fuzzy meta entry with meta information of all so-merged .po files, so apparently this is not the intended way.

Another hint is that e.g. Poedit keeps generating .mo files the moment I just open a .po file, so apparently its use case is to use the partial .mo files themselves somehow.

What is the expected way to present catalogue files for multiple artifacts to a gettext implementation?

  • Merged .po?
  • Merged .mo?
  • Something else entirely?

How to generate it from one .po file per language per artifact?

Gtk-Sharp seems to manage this - it has its own .mo files, yet I can still load my own catalogue normally and somehow the application has access to both.

Unfortunately there does not seem to be any documentation for this. All I can find, whether for gettext or Poedit always talks about having one single .po file (per language) for everything. But not, how to achieve that.

Zsar
  • 537

1 Answers1

0

gettexts own facilities allow loading arbitrary catalogues and in the application discriminating between them by their 'Domain', that is by their file name.

E.g. in C# one can use the GNU.Gettext.GettextResourceManager to load and use different catalogues like this:

(given Library.mo and Application.mo)

var library_catalogue = new GettextResourceManager("Library");
var application_catalogue = new GettextResourceManager("Application");
string library_msgstr = library_catalogue.GetString("a msgid present in both .mo files");
string application_msgstr = application_catalogue.GetString("a msgid present in both .mo files");

Looking at the repository, it seems that these three languages currently have bindings provided by gettext itself:

According to the manual many more language bindings alledgedly exist, but they are not placed with the three listed above.

Zsar
  • 537