Page 1 of 1

Language overrides

Posted: Thu Dec 02, 2010 1:27 am
by Sk0pe
Hi There,

I have been playing with J! 1.6 (b14 atm) and so far all looks really really nice.

I have one question however, regarding overriding the default text with language files. One thing I have loved about J! is the layout overrides, but it has often frustrated me that language files are not treated is the same way.

I notice that in the J! 1.6 structure, there is a folder /language/overrides and I am trying to work out exactly how it functions. For example, I want to change the default text for mod_login, so I have copied /language/en-GB/en-GB.mod_login.ini into the override folder, and then made modifications. However these changes do not seem to have taken. I also created the folder /language/overrides/en-GB and put the modified language file in there, but it does not seem to be changing the text in the front end.

Can anyone explain how the language override structure is supposed to work? How can I make small changes like changing MOD_LOGIN_HINAME to be "Logged in as %s" instead of "Hi %s" ?



Re: Language overrides

Posted: Fri Dec 03, 2010 12:52 am
by rufuz
I did something like that just creating a file named en-GB.override.ini inside language/overrides folder. Put in it the whole strings you need to change. It should work.


Re: Language overrides

Posted: Fri Dec 03, 2010 1:33 am
by Sk0pe
I saw that in the language.php class file. I think it would be worthwhile allowing individual override files on a per-extension basis. It could be done in the JLanguage::loadLanguage() function fairly easily. Replace the override processing in JLanguage::__construct() with simply setting an override path. Then use that path in the loadLanguage() function to load and merge an extension specific override file after you have merged the default extension specific language file.

The issue with a single override file is that it makes automated processing of the language overrides difficult. Consider language overrides in a similar way to layout overrides. They are more than simply translation mechanisms - they also allow a change to the whole tone of the site, through formal, colloquial, or artificial language.

Re: Language overrides

Posted: Tue Apr 19, 2011 7:41 pm
by formfranska
Thank you rufuz! It works fine :-)