Open Source Training Seminar FreePBX Paid Support

Suggestion for internationalization of FreePBX in a... more sane way.

Today, all translation files (.po & .mo) are stored in WEBROOT/admin/modules/modulename/i18n/LANG-CODE/LC_MESSAGES/modulename.po{mo}

Which is:

1. Complicated - you need to dig a very deep directory tree every time you want to make a change, AND:
2. Inside the directory tree - so if someone wants to update the language, a version bump of the module should happen, AND:
3. Impossible to keep up on

Suggestion:

Store all translations in WEBROOT/admin/i18n/LANG-CODE/LC_MESSAGES/modulename.po{mo} AND link to those files from within the module; That way, you:

1. Can put only the languages that you want (every lang will be in a different dir, containing the lang for all modules), AND:
2. Easier to give translators to maintain - no need to give access to the whole module tree, just the relevant LANG-CODE directory, AND:
3. When someone wants to get a more up-to-date translation s/he can simply svn co that directory from trunk / version that he wants.

I've tested the symlinks idea with my own system, and it worked fine. Here's what I used:

for i in `find /var/www/html/admin/modules/ -type d -maxdepth 1`; do rm -rf $i/i18n ; ln -sf /var/www/html/admin/i18n/ $i/i18n ; done

The symlinks can be even more general, you can simply do:

From within a module:

ln -s ../../i18n/ ./i18n

So I would suggest the following, module admin should always do that linking when installing a new module, unless the module itself has already installed a ./i18n directory. Over time, we should get those out of all modules.

Next - we need a language module. The purpose of the language module would be to supply the following functionality. First, download new up updated languages. It can be responsible for housing all the i18n and dumping them under admin/i18n. Next, it should allow for languages to be enabled/disabled which simply takes them out of the pulldown list. It should also allow for the pulldown list to be removed from everypage if desired, and only set the language from that module. I think that is it. Now we can get language updates for every language and every module including core modules without updating core.

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads