Skip to content

Commit fb047a6

Browse files
authored
Merge pull request #2439 from moodlehq/integration
Integration
2 parents 22266da + 6845834 commit fb047a6

File tree

40 files changed

+254
-109
lines changed

40 files changed

+254
-109
lines changed

config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget android-versionCode="39000" id="com.moodle.moodlemobile" ios-CFBundleVersion="3.9.0.0" version="3.9.0" versionCode="39000" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget android-versionCode="39000" id="com.moodle.moodlemobile" ios-CFBundleVersion="3.9.1.0" version="3.9.1" versionCode="39100" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>Moodle</name>
44
<description>Moodle official app</description>
55
<author email="[email protected]" href="http://moodle.com">Moodle Mobile team</author>
@@ -241,7 +241,7 @@
241241
<true />
242242
</edit-config>
243243
<edit-config file="*-Info.plist" mode="merge" target="CFBundleShortVersionString">
244-
<string>3.9.0</string>
244+
<string>3.9.1</string>
245245
</edit-config>
246246
<config-file parent="FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED" target="*-Info.plist">
247247
<string>YES</string>

desktop/assets/windows/AppXManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Identity Name="3312ADB7.MoodleDesktop"
77
ProcessorArchitecture="x64"
88
Publisher="CN=33CDCDF6-1EB5-4827-9897-ED25C91A32F6"
9-
Version="3.9.0.0" />
9+
Version="3.9.1.0" />
1010
<Properties>
1111
<DisplayName>Moodle Desktop</DisplayName>
1212
<PublisherDisplayName>Moodle Pty Ltd.</PublisherDisplayName>

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "moodlemobile",
3-
"version": "3.9.0",
3+
"version": "3.9.1",
44
"description": "The official app for Moodle.",
55
"author": {
66
"name": "Moodle Pty Ltd.",
@@ -253,7 +253,7 @@
253253
"category": "public.app-category.education",
254254
"icon": "resources/desktop/icon.icns",
255255
"target": "mas",
256-
"bundleVersion": "3.9.0",
256+
"bundleVersion": "3.9.1",
257257
"extendInfo": {
258258
"ElectronTeamID": "2NU57U5PAW"
259259
}

scripts/lang_functions.php

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ function add_langs_to_config($langs, $config) {
120120
function get_langfolder($lang) {
121121
$folder = LANGPACKSFOLDER.'/'.str_replace('-', '_', $lang);
122122
if (!is_dir($folder) || !is_file($folder.'/langconfig.php')) {
123-
echo "Cannot translate $folder, folder not found";
124-
125123
return false;
126124
}
127125

@@ -173,6 +171,8 @@ function reset_translations_strings() {
173171
function build_lang($lang, $keys) {
174172
$langfoldername = get_langfolder($lang);
175173
if (!$langfoldername) {
174+
echo "Cannot translate $lang, folder not found";
175+
176176
return false;
177177
}
178178

@@ -182,15 +182,18 @@ function build_lang($lang, $keys) {
182182
$override_langfolder = false;
183183
}
184184

185-
$total = count ($keys);
185+
$total = count($keys);
186186
$local = 0;
187187

188-
$string = get_translation_strings($langfoldername, 'langconfig');
189-
$parent = isset($string['parentlanguage']) ? $string['parentlanguage'] : "";
188+
$langparts = explode('-', $lang, 2);
189+
$parentname = $langparts[0] ?? "";
190+
$parent = "";
190191

191192
echo "Processing $lang";
192-
if ($parent != "" && $parent != $lang) {
193-
echo " ($parent)";
193+
// Check parent language exists.
194+
if ($parentname != $lang && get_langfolder($parentname)) {
195+
echo " ($parentname)";
196+
$parent = $parentname;
194197
}
195198

196199
$langFile = false;
@@ -247,6 +250,12 @@ function build_lang($lang, $keys) {
247250
$translations[$key] = html_entity_decode($text);
248251
}
249252

253+
if (!empty($parent)) {
254+
$translations['core.parentlanguage'] = $parent;
255+
} else if (isset($translations['core.parentlanguage'])) {
256+
unset($translations['core.parentlanguage']);
257+
}
258+
250259
// Sort and save.
251260
ksort($translations);
252261
file_put_contents(ASSETSPATH.$lang.'.json', str_replace('\/', '/', json_encode($translations, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)));
@@ -275,6 +284,8 @@ function progressbar($percentage) {
275284
function detect_lang($lang, $keys) {
276285
$langfoldername = get_langfolder($lang);
277286
if (!$langfoldername) {
287+
echo "Cannot translate $lang, folder not found";
288+
278289
return false;
279290
}
280291

src/assets/lang/ca.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,6 @@
19131913
"core.openmodinbrowser": "Obre {{$a}} al navegador",
19141914
"core.othergroups": "Altres grups",
19151915
"core.pagea": "Pàgina {{$a}}",
1916-
"core.parentlanguage": "",
19171916
"core.paymentinstant": "Utilitzeu el botó de baix per pagar i inscriure-us.",
19181917
"core.percentagenumber": "{{$a}}%",
19191918
"core.phone": "Telèfon",

src/assets/lang/cs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,6 @@
19091909
"core.openmodinbrowser": "Otevřít {{$a}} v prohlížeči",
19101910
"core.othergroups": "Další skupiny",
19111911
"core.pagea": "Stránka {{$a}}",
1912-
"core.parentlanguage": "",
19131912
"core.paymentinstant": "Pomocí tlačítka níže můžete provést platbu a během několika minut se zapsat do kurzu!",
19141913
"core.percentagenumber": "{{$a}}%",
19151914
"core.phone": "Telefon",

src/assets/lang/da.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,6 @@
17521752
"core.openinbrowser": "Åben i browser",
17531753
"core.othergroups": "Andre grupper",
17541754
"core.pagea": "Side {{$a}}",
1755-
"core.parentlanguage": "",
17561755
"core.paymentinstant": "Brug knappen forneden til at betale og blive tilmeldt umiddelbart derefter.",
17571756
"core.percentagenumber": "{{$a}}%",
17581757
"core.phone": "Telefon",

src/assets/lang/el.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,6 @@
18411841
"core.openinbrowser": "Ανοίξτε στον περιηγητή.",
18421842
"core.othergroups": "Άλλες ομάδες",
18431843
"core.pagea": "Σελίδα {{$a}}",
1844-
"core.parentlanguage": "",
18451844
"core.paymentinstant": "Χρησιμοποιήστε το παρακάτω πλήκτρο για να πληρώσετε και να εγγραφείτε μέσα σε λίγα λεπτά!",
18461845
"core.percentagenumber": "{{$a}}%",
18471846
"core.phone": "Τηλέφωνο",

src/assets/lang/en-us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"core.listsep": ",",
1515
"core.login.loginsteps": "For full access to this site, you first need to create an account.",
1616
"core.notenrolledprofile": "This profile is not available because this user is not enrolled in this course.",
17+
"core.parentlanguage": "en",
1718
"core.paymentinstant": "Use the button below to pay and be enrolled within minutes!",
1819
"core.settings.license": "License",
1920
"core.strftimedate": "%B %d, %Y",

src/assets/lang/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,7 @@
15571557
"core.errorsomedatanotdownloaded": "If you downloaded this activity, please notice that some data isn't downloaded during the download process for performance and data usage reasons.",
15581558
"core.errorsync": "An error occurred while synchronising. Please try again.",
15591559
"core.errorsyncblocked": "This {{$a}} cannot be synchronised right now because of an ongoing process. Please try again later. If the problem persists, try restarting the app.",
1560+
"core.errorurlschemeinvalidsite": "This site URL cannot be opened in this app.",
15601561
"core.explanationdigitalminor": "This information is required to determine if your age is over the digital age of consent. This is the age when an individual can consent to terms and conditions and their data being legally stored and processed.",
15611562
"core.favourites": "Starred",
15621563
"core.filename": "Filename",

0 commit comments

Comments
 (0)