Welcome Guest, Not a member yet? Register   Sign In
[solved] Loading another language
#14

[eluser]osci[/eluser]
[quote author="Bradillac" date="1308271167"]Here is a really simple way to make a language file overwrite a previously loaded file with the same name:

Code:
$this->lang->load('email', 'en');    // Loads the English version.
$english_txt = lang('some_text');    // Some English text.

// Finds and unsets the filename in the "is_set" array.
unset($this->lang->is_loaded[array_search('email_lang.php', $this->lang->is_loaded)]);    

$this->lang->load('email', 'it');    // Loads the Italian version. All English will be overwritten.
$italian_txt = lang('some_text');    // Some Italian text.

There really needs to be an Unload or Clear function in the Lang Class.[/quote]

Much better implementation.


Messages In This Thread
[solved] Loading another language - by El Forum - 06-09-2011, 12:17 AM
[solved] Loading another language - by El Forum - 06-09-2011, 06:52 AM
[solved] Loading another language - by El Forum - 06-10-2011, 02:44 AM
[solved] Loading another language - by El Forum - 06-12-2011, 10:57 PM
[solved] Loading another language - by El Forum - 06-13-2011, 08:07 AM
[solved] Loading another language - by El Forum - 06-13-2011, 10:42 PM
[solved] Loading another language - by El Forum - 06-14-2011, 12:48 AM
[solved] Loading another language - by El Forum - 06-14-2011, 03:45 AM
[solved] Loading another language - by El Forum - 06-14-2011, 03:57 AM
[solved] Loading another language - by El Forum - 06-14-2011, 04:45 AM
[solved] Loading another language - by El Forum - 06-14-2011, 05:11 AM
[solved] Loading another language - by El Forum - 06-14-2011, 06:16 AM
[solved] Loading another language - by El Forum - 06-16-2011, 01:39 PM
[solved] Loading another language - by El Forum - 06-16-2011, 02:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB