MOBILE-3320 lang: Fix lang overrides

main
Pau Ferrer Ocaña 2021-07-08 14:45:24 +02:00
parent 44f8f4a232
commit 0e84c43784
1 changed files with 7 additions and 3 deletions

View File

@ -385,16 +385,18 @@ function override_component_lang_files($keys, $translations) {
}
switch($type) {
case 'core':
case 'addon':
switch($component) {
case 'moodle':
$path .= 'lang.json';
$path .= 'core/lang.json';
break;
default:
$path .= $type.'/'.str_replace('_', '/', $component).'/lang.json';
$path .= 'core/features/'.str_replace('_', '/', $component).'/lang.json';
break;
}
break;
case 'addon':
$path .= 'addons/'.str_replace('_', '/', $component).'/lang.json';
break;
case 'assets':
$path .= $type.'/'.$component.'.json';
break;
@ -406,6 +408,8 @@ function override_component_lang_files($keys, $translations) {
if (is_file($path)) {
save_key($plainid, $value, $path);
} else {
echo "Cannot override: $path not found.\n";
}
}
}