[ticket/414] Add possibility to specify different vendor for module language

B3P-414
This commit is contained in:
Marc Alexander
2014-11-08 07:07:29 +01:00
parent 25a957ebf6
commit 8628755c07
2 changed files with 12 additions and 2 deletions

View File

@@ -191,7 +191,15 @@ class helper
{
if ($language_file = $module->get_language())
{
$this->user->add_lang_ext('board3/portal', 'modules/' . $language_file);
// Load language file from vendor if specified
if (is_array($language_file))
{
$this->user->add_lang_ext($language_file['vendor'], $language_file['file']);
}
else
{
$this->user->add_lang_ext('board3/portal', 'modules/' . $language_file);
}
}
}

View File

@@ -47,7 +47,9 @@ interface module_interface
* File must be in "board3/portal/language/{$user->lang}/portal/" or
* this should return false.
*
* @return string|bool Language file or false
* @return string|bool|array Language file, array of vendor and language file
* or false. Array has to match this format:
* array('vendor' => 'foo', 'file' => 'bar')
*/
public function get_language();