0

While developing and translating an application, it might be nice if gettext will use the catalogs found in the local po/ dir so it wouldn't be necessary to call make install each time.

Is there a way to do it?

One of the problems is the naming convention: gettext looks for the catalog files in an hierarchy that looks like /usr/share/locale/LL/LC_MESSAGES/package.mo (where LL is two-letter language code), while usually in the development tree the binary catalogs reside in po/LL.gmo.

Guy
  • 1,984
  • 1
  • 16
  • 19

1 Answers1

0

it might be nice if gettext will use the catalogs found in the local po/ dir so it wouldn't be necessary to call make install each time....Is there a way to do it?

If I am understanding your idea correctly, it sounds like gettext is able to do just that (i.e. change the translation path variable) if you follow the prescribed methods to set it up...

Translations should be stored in a path having a fixed structure. First of all, we’ll have a root folder named to your taste (for example “languages”). Inside it, we have to create a folder for every targeted language whose name must comply to the ISO 3166 standard. So, valid names for an Italian translation can be “it_IT” (Italian of Italy), “it_CH” (Italian of Switzerland), “en_US” (English of USA), and so on. Within the folder having the language code, we must have a folder named “LC_MESSAGES” where, finally, we’ll store the translation files.

From Here (there is a script example included in this link showing one method to perform this task)

Change "languages" in description above to "po", and that may do what you want?

ryyker
  • 22,849
  • 3
  • 43
  • 87
  • I think mimicking the hierarchy of the binary catalogs in the development sources will not be compatible with the automake macros that come with gettext and compile the `*.po` files into `*.mo` files. – Guy Oct 17 '14 at 06:51