FIX: Allow both 3.0 and 3.1 syntax for i18n

This commit is contained in:
Sam Minnee 2013-05-06 18:46:03 +12:00
parent 9daff5f2d0
commit 2ab36ff777

View File

@ -1464,7 +1464,8 @@ class Translatable extends DataExtension implements PermissionProvider {
foreach ($langlist as $langCode) {
if($langCode && isset($allCodes[$langCode])) {
if(is_array($allCodes[$langCode])) {
$returnMap[$langCode] = $allCodes[$langCode]['name'];
if(isset($allCodes[$langCode]['name'])) $returnMap[$langCode] = $allCodes[$langCode]['name'];
else $returnMap[$langCode] = $allCodes[$langCode][0];
} else {
$returnMap[$langCode] = $allCodes[$langCode];
}