Welcome Guest, Not a member yet? Register   Sign In
Multilanguage Support Needed
#2

[eluser]adamfairholm[/eluser]
Nico,

I think it would be unnecessary to check to see if all the language elements are loaded for the view. My approach would be to change up the 2 functions of the core Language library.

The first thing to do would be to change the load language file function. Right now it basically loads the array, and then merges that language file array into the master language array. In CI 2.0, it happens on line 110:

Code:
$this->language = array_merge($this->language, $lang);

You could extend the Lang.php core library to put that into a multi-dimensional array for the language. So it could change to:

Code:
$this->language[$idiom] = array_merge($this->language[$idiom], $lang);

Then, change the function to load the default language as well, and put that into another node on the class language array. A check to see if the default language and the user language would be good.

There are other considerations in that function, but that's the main change I think.

Then you've got the "line" function. Right now, it doesn't return an error if there is no language array node that you are looking for. It just returns false. You could change it to have a few different levels of fallback:

- If the line comes back as false, meaning that line doesn't exist, then check the default language.

- If it isn't loaded, load that node then.

Yes it means double language loading, but right now that's all I can come up with. Of course, putting the new functions in a MY_Lang.php file would be a better route than changing the core files.

For the language choosing though, have you thought of going with a language subdomain? Like en.wikipedia.org.

Adam


Messages In This Thread
Multilanguage Support Needed - by El Forum - 06-22-2010, 05:06 PM
Multilanguage Support Needed - by El Forum - 06-22-2010, 05:31 PM
Multilanguage Support Needed - by El Forum - 06-23-2010, 02:58 AM
Multilanguage Support Needed - by El Forum - 06-23-2010, 08:17 AM
Multilanguage Support Needed - by El Forum - 06-23-2010, 12:28 PM
Multilanguage Support Needed - by El Forum - 06-23-2010, 12:32 PM
Multilanguage Support Needed - by El Forum - 06-24-2010, 08:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB