Merge pull request #2436 from crazyserver/MOBILE-3456
MOBILE-3456 lang: Check parent lang from langnamemain
commit
c8c51a65cc
|
@ -120,8 +120,6 @@ function add_langs_to_config($langs, $config) {
|
|||
function get_langfolder($lang) {
|
||||
$folder = LANGPACKSFOLDER.'/'.str_replace('-', '_', $lang);
|
||||
if (!is_dir($folder) || !is_file($folder.'/langconfig.php')) {
|
||||
echo "Cannot translate $folder, folder not found";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -173,6 +171,8 @@ function reset_translations_strings() {
|
|||
function build_lang($lang, $keys) {
|
||||
$langfoldername = get_langfolder($lang);
|
||||
if (!$langfoldername) {
|
||||
echo "Cannot translate $lang, folder not found";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -185,12 +185,15 @@ function build_lang($lang, $keys) {
|
|||
$total = count($keys);
|
||||
$local = 0;
|
||||
|
||||
$string = get_translation_strings($langfoldername, 'langconfig');
|
||||
$parent = isset($string['parentlanguage']) ? $string['parentlanguage'] : "";
|
||||
$langparts = explode('-', $lang, 2);
|
||||
$parentname = $langparts[0] ?? "";
|
||||
$parent = "";
|
||||
|
||||
echo "Processing $lang";
|
||||
if ($parent != "" && $parent != $lang) {
|
||||
echo " ($parent)";
|
||||
// Check parent language exists.
|
||||
if ($parentname != $lang && get_langfolder($parentname)) {
|
||||
echo " ($parentname)";
|
||||
$parent = $parentname;
|
||||
}
|
||||
|
||||
$langFile = false;
|
||||
|
@ -247,6 +250,12 @@ function build_lang($lang, $keys) {
|
|||
$translations[$key] = html_entity_decode($text);
|
||||
}
|
||||
|
||||
if (!empty($parent)) {
|
||||
$translations['core.parentlanguage'] = $parent;
|
||||
} else if (isset($translations['core.parentlanguage'])) {
|
||||
unset($translations['core.parentlanguage']);
|
||||
}
|
||||
|
||||
// Sort and save.
|
||||
ksort($translations);
|
||||
file_put_contents(ASSETSPATH.$lang.'.json', str_replace('\/', '/', json_encode($translations, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)));
|
||||
|
@ -275,6 +284,8 @@ function progressbar($percentage) {
|
|||
function detect_lang($lang, $keys) {
|
||||
$langfoldername = get_langfolder($lang);
|
||||
if (!$langfoldername) {
|
||||
echo "Cannot translate $lang, folder not found";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1913,7 +1913,6 @@
|
|||
"core.openmodinbrowser": "Obre {{$a}} al navegador",
|
||||
"core.othergroups": "Altres grups",
|
||||
"core.pagea": "Pàgina {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Utilitzeu el botó de baix per pagar i inscriure-us.",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telèfon",
|
||||
|
|
|
@ -1909,7 +1909,6 @@
|
|||
"core.openmodinbrowser": "Otevřít {{$a}} v prohlížeči",
|
||||
"core.othergroups": "Další skupiny",
|
||||
"core.pagea": "Stránka {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Pomocí tlačítka níže můžete provést platbu a během několika minut se zapsat do kurzu!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefon",
|
||||
|
|
|
@ -1752,7 +1752,6 @@
|
|||
"core.openinbrowser": "Åben i browser",
|
||||
"core.othergroups": "Andre grupper",
|
||||
"core.pagea": "Side {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Brug knappen forneden til at betale og blive tilmeldt umiddelbart derefter.",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefon",
|
||||
|
|
|
@ -1841,7 +1841,6 @@
|
|||
"core.openinbrowser": "Ανοίξτε στον περιηγητή.",
|
||||
"core.othergroups": "Άλλες ομάδες",
|
||||
"core.pagea": "Σελίδα {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Χρησιμοποιήστε το παρακάτω πλήκτρο για να πληρώσετε και να εγγραφείτε μέσα σε λίγα λεπτά!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Τηλέφωνο",
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"core.listsep": ",",
|
||||
"core.login.loginsteps": "For full access to this site, you first need to create an account.",
|
||||
"core.notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
|
||||
"core.parentlanguage": "en",
|
||||
"core.paymentinstant": "Use the button below to pay and be enrolled within minutes!",
|
||||
"core.settings.license": "License",
|
||||
"core.strftimedate": "%B %d, %Y",
|
||||
|
|
|
@ -1913,7 +1913,6 @@
|
|||
"core.openmodinbrowser": "Open {{$a}} in browser",
|
||||
"core.othergroups": "Other groups",
|
||||
"core.pagea": "Page {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Use the button below to pay and be enrolled within minutes!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Phone",
|
||||
|
|
|
@ -1913,7 +1913,7 @@
|
|||
"core.openmodinbrowser": "Abrir {{$a}} en navegador",
|
||||
"core.othergroups": "Otros grupos",
|
||||
"core.pagea": "Página {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.parentlanguage": "es",
|
||||
"core.paymentinstant": "¡Utilice el botón de abajo para pagar y poder inscribirse en minutos!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Teléfono",
|
||||
|
|
|
@ -1913,7 +1913,6 @@
|
|||
"core.openmodinbrowser": "Abrir {{$a}} en el navegador",
|
||||
"core.othergroups": "Otros grupos",
|
||||
"core.pagea": "Página {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "¡Utilice el botón de abajo para pagar y poder matricularse en minutos!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Teléfono",
|
||||
|
|
|
@ -1875,7 +1875,6 @@
|
|||
"core.openinbrowser": "Ouvrir dans le navigateur",
|
||||
"core.othergroups": "Autres groupes",
|
||||
"core.pagea": "Page {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Le bouton ci-dessous vous permet de payer et de vous inscrire en quelques minutes !",
|
||||
"core.percentagenumber": "{{$a}} %",
|
||||
"core.phone": "Téléphone",
|
||||
|
|
|
@ -1521,7 +1521,6 @@
|
|||
"core.online": "Online",
|
||||
"core.othergroups": "Egyéb csoportok",
|
||||
"core.pagea": "{{$a}} oldal",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "A fizetéshez és a perceken belüli beiratkozáshoz használja az alábbi gombot!",
|
||||
"core.phone": "Telefon",
|
||||
"core.pictureof": "Kép",
|
||||
|
|
|
@ -1769,7 +1769,6 @@
|
|||
"core.openinbrowser": "Apri nel browser",
|
||||
"core.othergroups": "Altri gruppi",
|
||||
"core.pagea": "Pagina {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Utilizza il pulsante sottostante per pagare ed essere iscritto in pochi minuti!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefono",
|
||||
|
|
|
@ -1717,7 +1717,6 @@
|
|||
"core.openinbrowser": "ブラウザで開く",
|
||||
"core.othergroups": "他のグループ",
|
||||
"core.pagea": "ページ {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "下のボタンをお使いください。支払いおよび登録がすぐに完了します!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "電話",
|
||||
|
|
|
@ -1385,7 +1385,6 @@
|
|||
"core.openfullimage": "전체 크기 이미지를 보려면 여기를 클릭하십시오.",
|
||||
"core.openinbrowser": "브라우저에서 열기",
|
||||
"core.pagea": "페이지 {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "신속하게 등록금 지불 및 등록을 마치려면 아래의 버튼을 사용하시오!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "전화",
|
||||
|
|
|
@ -1634,7 +1634,6 @@
|
|||
"core.openinbrowser": "Atidaryti naršyklėje",
|
||||
"core.othergroups": "Kitos grupės",
|
||||
"core.pagea": "{{$a}} puslapis",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Naudokite toliau pateiktą mygtuką, kad sumokėtumėte ir būtumėte įregistruoti per kelias minutes.",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefonas",
|
||||
|
|
|
@ -1576,7 +1576,6 @@
|
|||
"core.online": "På nett",
|
||||
"core.othergroups": "Andre grupper",
|
||||
"core.pagea": "Side {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Bruk knappen under for å betale og melde deg på kurset.",
|
||||
"core.phone": "Telefon",
|
||||
"core.pictureof": "Bilde av {{$a}}",
|
||||
|
|
|
@ -1809,7 +1809,7 @@
|
|||
"core.openinbrowser": "Abrir no navegador",
|
||||
"core.othergroups": "Outros grupos",
|
||||
"core.pagea": "Página {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.parentlanguage": "pt",
|
||||
"core.paymentinstant": "Clique o botão abaixo para efetuar o pagamento e fazer a sua inscrição em poucos minutos!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Fone",
|
||||
|
|
|
@ -1913,7 +1913,6 @@
|
|||
"core.openmodinbrowser": "Abrir {{$a}} no navegador",
|
||||
"core.othergroups": "Outros grupos",
|
||||
"core.pagea": "Página {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Use o botão abaixo para pagar e completar a inscrição!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefone",
|
||||
|
|
|
@ -1841,7 +1841,6 @@
|
|||
"core.openinbrowser": "Odpri v brskalniku",
|
||||
"core.othergroups": "Ostale skupine",
|
||||
"core.pagea": "Stran {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "Uporabite spodnje gumbe za plačilo in vpis v nekaj minutah!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefon",
|
||||
|
|
|
@ -1700,7 +1700,6 @@
|
|||
"core.openinbrowser": "Отвори у веб читачу",
|
||||
"core.othergroups": "Друге групе",
|
||||
"core.pagea": "Страница {{$a}}",
|
||||
"core.parentlanguage": "en",
|
||||
"core.paymentinstant": "Употребите дугме испод како бисте извршили уплату и уписали курс у року од неколико минута!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Телефон",
|
||||
|
|
|
@ -1700,7 +1700,6 @@
|
|||
"core.openinbrowser": "Otvori u veb čitaču",
|
||||
"core.othergroups": "Druge grupe",
|
||||
"core.pagea": "Stranica {{$a}}",
|
||||
"core.parentlanguage": "en",
|
||||
"core.paymentinstant": "Upotrebite dugme ispod kako biste izvršili uplatu i upisali kurs u roku od nekoliko minuta!",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "Telefon",
|
||||
|
|
|
@ -1844,7 +1844,6 @@
|
|||
"core.openinbrowser": "在浏览器中打开",
|
||||
"core.othergroups": "其他小组",
|
||||
"core.pagea": "页 {{$a}}",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "点击下面的按钮便可以快速付费并加入课程!",
|
||||
"core.phone": "电话",
|
||||
"core.pictureof": "{{$a}}的头像",
|
||||
|
|
|
@ -1636,7 +1636,6 @@
|
|||
"core.openinbrowser": "以瀏覽器開啟",
|
||||
"core.othergroups": "其他群組",
|
||||
"core.pagea": "第 {{$a}} 頁",
|
||||
"core.parentlanguage": "",
|
||||
"core.paymentinstant": "使用以下按鈕立即付款及註冊。",
|
||||
"core.percentagenumber": "{{$a}}%",
|
||||
"core.phone": "電話",
|
||||
|
|
Loading…
Reference in New Issue