diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index 0fe739c9be..7e1ebf2f9f 100644 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -712,6 +712,10 @@ $app->before( } } + $translator->addLoader('xlf', new Symfony\Component\Translation\Loader\XliffFileLoader()); + $translator->addResource('xlf', api_get_path(SYS_PATH).'vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/translations/validators.sr_Latn.xlf', 'sr_Latn', 'validators'); + + /*$translator->addLoader('mofile', new MoFileLoader()); $filePath = api_get_path(SYS_PATH).'main/locale/'.$locale.'.mo'; if (!file_exists($filePath)) { @@ -720,6 +724,10 @@ $app->before( $translator->addResource('mofile', $filePath, $locale);*/ return $translator; } + + + + })); // Check if we are inside a Chamilo course tool diff --git a/main/inc/lib/internationalization_internal.lib.php b/main/inc/lib/internationalization_internal.lib.php index 3fe82fdc43..18c29ec93d 100755 --- a/main/inc/lib/internationalization_internal.lib.php +++ b/main/inc/lib/internationalization_internal.lib.php @@ -185,8 +185,9 @@ function _api_get_person_name_convention($language, $type) { $language = api_purify_language_id($language); if (!isset($conventions)) { $file = dirname(__FILE__).'/internationalization_database/name_order_conventions.php'; + if (file_exists($file)) { - $conventions = include ($file); + $conventions = include $file; } else { $conventions = array('english' => array('format' => 'title first_name last_name', 'sort_by' => 'first_name')); }