09-12-2017, 08:25 PM
Oh I'm sorry, I thought you wanted to use both languages side by side. In that case, you can do as you suggested and load either file. You can go through the language arrays to remove the string keys associated with each text line, but if you add a new line earlier in your array all your array keys will be off. I'd suggest keeping the keys as a string, since the end user will never see the anyway.
outputs:
outputs:
Code:
lang_en.php:
Code:
$lang = array_merge($lang, array(
Code:
"HELLO_WORLD" => "Hello world!"
Code:
));
Code:
echo lang('HELLO_WORLD);
Code:
Hello world!
Code:
lang_es.php:
Code:
$lang = array_merge($lang, array(
Code:
"HELLO_WORLD" => "¡Hola Mundo!"
Code:
));
Code:
echo lang('HELLO_WORLD);
Code:
¡Hola Mundo!