Gettext - finding translations for imported common module
| From: | Gerry Reno | Date: | Fri, 05 Nov 2010 17:01:22 +0000 |
| Subject: | Gettext - finding translations for imported common module | ||
| Groups: | php.i18n | ||
| Request: | Send a blank email to php-i18n+get-1417@lists.php.net to get a copy of this message | ||
I am using PHP 5.2.4 and gettext.
I have a common module that I import (require) into other modules.
But when I do this pages (at a different level in site tree) do not show the translations for this module.
/siteroot
/siteroot/lib/common.php
/siteroot/lib/locale/[LANG]/LC_MESSAGES/message.po #COMMON MODULE TRANSLATIONS ARE IN HERE
/siteroot/index.php #require("lib/common.php") #NO COMMON MODULE TRANSLATION OCCURS
/siteroot/locale/[LANG]/LC_MESSAGES/message.po
/siteroot/page2/index.php #require("../lib/common.php") #NO COMMON MODULE TRANSLATION OCCURS
/siteroot/page2/locale/[LANG]/LC_MESSAGES/message.po
Right now all the regular translations work fine but the imported module is not translated even though I have the translations for it under the /siteroot/lib directory.
If I put the common module translation into each po file under each /siteroot/pageN directory then the common module translations work but this requires tons of duplication.
Is there a way to bind an alternate root or domain so that gettext can find both the local translations and the library translations for the imported common modules?