Page 1 of 1

Good way to create script supporting translations?

Posted: Thu Dec 20, 2012 6:58 am
by bizir
I'm creating an open-source cms and was just wondering that which is the best way to add localizations? I already decided to have them in files similar to lang.en.php. I would assume arrays, but in which form?

$lang['xyz'] = "Text goes here!";

Code: Select all

$lang['Text goes here!'] = "Translated text!";
Or should I create my custom parser and add localizations to a file, like this:

Code: Select all

"Text goes here!" = "Translated text!";
And then just parse it.
What would you suggest? I tried to search but no results for me.

Re: Good way to create script supporting translations?

Posted: Thu Dec 20, 2012 1:33 pm
by infograf768
I do not think posting such a question in Joomla forums will get any reply. ;)
We do not use .php files for language translations since 1.5 and switched to native php .ini parsing in 2.5.

Re: Good way to create script supporting translations?

Posted: Sat Jan 04, 2014 1:48 am
by lisablaker82
Oh, was planning to ask questions on the same line regarding translations. Thanks for the information infograf768. :)