Merged in bugfix/PMCORE-3629-A (pull request #8348)

PMCORE-3629 [27048 27072] Default language other than default English causing The language 'fr-FR' doesn\\'t exist!

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Roly Gutierrez
2022-01-17 15:28:32 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 4 additions and 1 deletions

View File

@@ -198,6 +198,9 @@ class Users extends BaseUsers
if (empty($aFields['USR_DEFAULT_LANG'])) {
$aFields['USR_DEFAULT_LANG'] = 'en';
}
//sometimes the USR_DEFAULT_LANG value is made up, it is formatted in order to find the value.
$explode = explode('-', $aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG'] = strtolower($explode[0]);
$translations = new Language();
$translation = $translations->loadByCode($aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG_NAME'] = $translation['LANGUAGE_NAME'];

View File

@@ -132,7 +132,7 @@ try {
$data = [['LAN_ID' => '', 'LAN_NAME' => '- ' . G::LoadTranslation('ID_NONE') . ' -']];
foreach ($languages as $lang) {
$data[] = [
'LAN_ID' => $lang['LOCALE'],
'LAN_ID' => strtolower($lang['LAN_ID']),
'LAN_NAME' => $lang['LANGUAGE']
];
}