The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make additional $user variables?
#5
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.

Code:
lang_en.php:
Code:
$lang = array_merge($lang, array(
Code:
"HELLO_WORLD" => "Hello world!"
Code:
));

Code:
echo lang('HELLO_WORLD);
outputs:
Code:
Hello world!


Code:
lang_es.php:
Code:
$lang = array_merge($lang, array(
Code:
"HELLO_WORLD" => "¡Hola Mundo!"
Code:
));

Code:
echo lang('HELLO_WORLD);
outputs:
Code:
¡Hola Mundo!
  Reply


Messages In This Thread
Make additional $user variables? - by Katronix - 09-12-2017, 05:33 PM
Make additional $user variables? - by Katronix - 09-12-2017, 06:40 PM
Make additional $user variables? - by karsen - 09-12-2017, 07:28 PM
Make additional $user variables? - by Katronix - 09-12-2017, 07:49 PM
Make additional $user variables? - by karsen - 09-12-2017, 08:25 PM
Make additional $user variables? - by Katronix - 09-12-2017, 10:21 PM
Make additional $user variables? - by Brandin - 09-13-2017, 09:32 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)