Developing i18n locations

From KnowledgeTree Document Management Made Simple

Jump to: navigation, search

KnowledgeTree allows for plugins to have their own translations for their pages and actions.

$oPlugin->registeri18n('myplugin', 'i18n');
  • The first parameter is the name of the gettext domain. This affects the file that is looked for by the gettext library. In this case, myplugin.mo is the file for which it will look.
  • The second parameter is the location that will be bound to the domain. Like all locations when registering in plugins, this is relative to the plugin's location if a relative path is given.

In this case, if the plugin is in /plugins/myplugin/MyPlugin.php, and the locale is en_ZA, gettext will use the file /plugins/myplugin/i18n/en_ZA/LC_MESSAGES/myplugin.mo, if it exists.

Personal tools