MyBB Community Forums

Full Version: class MyLanguage
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It would be nice to get more options from current loaded language in the $lang variable.

Afaik I miss:

$lang->rtl
$lang->htmllang
$lang->charset
$lang->name
If you want to know the background of the request:

My little extension stores the content in files. Later I want to make it multilanguage based on current selected language. But the folder names can be changed as they want.

So I think a store like 'en_pageX.html' is better than 'english_pageX.html'.
You could try to include the language information file. That's not that nice but it's working. Example:
<?php
require "./global.php";
require "./inc/languages/".$mybb->settings['bblanguage'].".php";

echo $langinfo['name'];
echo $langinfo['author'];
echo $langinfo['website'];
echo $langinfo['version'];
echo $langinfo['admin'];
echo $langinfo['rtl'];
echo $langinfo['htmllang'];
echo $langinfo['charset'];
?>
Yes ... but as suggestion it would be great to get such values by default classes Cool

I don't checked the settings first. So I think it is easyer to use:

$lang->language instead of $mybb->settings['bblanguage']
I think if this is done, the 'info' variables need to be distinguished from the 'language phrases' variables.

eg. info variables
$lang->_rtl
$lang->_charset

phrase variables
$lang->username
$lang->error_x
Oh now I found that they are already in $lang->settings[] array.
k, so we can dismiss this suggestion then right?
yes - delete or close Smile