Topic: Will extensions be multilingual?

I've checked some extensions of 1.3 Beta, and checked those codes inside files. Unfortunately, I found those extensions don't include multilingual sentences except English ones. Will this problem be solved in the future?

Welcome to my WoW guild site, the Eternal Reach.

You can also visit Chita, a site built by me, a feral paradise for feline animals.

Re: Will extensions be multilingual?

If the developer chooses to do so, they will be.

Re: Will extensions be multilingual?

And if they do they have to put in something like this:

if ( file_exists ( 'extensions/gallery/lang/'.$pun_user['language'].'/gallery.php' ) ) {
  require PUN_ROOT.'extensions/gallery/lang/'.$pun_user['language'].'/gallery.php';
} else {
  require PUN_ROOT.'extensions/gallery/lang/English/gallery.php';
}

Otherwise the extension will not work hmm

4 (edited by intedinmamma 2008-02-17 12:18)

Re: Will extensions be multilingual?

One solution is the one I came up with for Publish Topics:

if (!isset($lang_topic['Unpublish']))
        $lang_topic['Unpublish'] = 'Unpublish';

Doing it that way makes it possible to put translations in extensions. If someone makes a system for automatically keeping extensions updated then it won't be very hard to "push" translations of extensions.

Re: Will extensions be multilingual?

The way kierownik suggested is the way I would suggest extension authors allow for localization.

Re: Will extensions be multilingual?

similar to what kierownik said, with my extentions i added to the hook "co_common" (seems to be the first one found)

if (file_exists(PUN_ROOT.'extensions/<extension>/lang_'.$pun_user['language'].'.php'))
    require PUN_ROOT.'extensions/<extension>/lang_'.$pun_user['language'].'.php';
else
    require PUN_ROOT.'extensions/<extension>/lang_English.php';

also in the install block i add this

if (!file_exists(PUN_ROOT.'extensions/<extension>/lang_'.$pun_user['language'].'.php'))
    $notices[] = 'This Extension does not support your current language and will use the english one.';

replacing <extension> with your extension name of corse
With this scheme you don't have multiple folders with one file in them

Re: Will extensions be multilingual?

That is smart Gizzmo, thanks for sharing smile