MOBILE-4081 lang: Improvements on script and import translations

main
Pau Ferrer Ocaña 2022-11-03 10:44:54 +01:00
parent 5eb0bd2448
commit 6b2be863b5
13 changed files with 38 additions and 32 deletions

View File

@ -23,15 +23,13 @@ jobs:
fi fi
gulp gulp
langcount=`jq -r '. | length' src/assets/lang/en.json` langcount=`jq -r '. | length' src/assets/lang/en.json`
freemiumcount=`jq 'keys' src/assets/lang/en.json | grep "freemium\." | wc -l | xargs`
allcount=$(($langcount - $freemiumcount))
langindexcount=`jq -r '. | length' scripts/langindex.json` langindexcount=`jq -r '. | length' scripts/langindex.json`
if [ $allcount -ne $langindexcount ]; then if [ $langcount -ne $langindexcount ]; then
echo "Lang file has $langcount ($freemiumcount) while langindex $langindexcount" echo "Lang file has $langcount while langindex $langindexcount"
exit 1 exit 1
fi fi
langkeys=`jq -r 'keys[]' src/assets/lang/en.json | grep -v "freemium\."` langkeys=`jq -r 'keys[]' src/assets/lang/en.json`
langindex=`jq -r 'keys[]' scripts/langindex.json` langindex=`jq -r 'keys[]' scripts/langindex.json`
found=0 found=0
for i in $langkeys; do for i in $langkeys; do

View File

@ -40,12 +40,14 @@ function exists_in_file {
completeFile="$LANGPACKSFOLDER/en/$file.php" completeFile="$LANGPACKSFOLDER/en/$file.php"
if [ -f "$completeFile" ]; then if [ -f "$completeFile" ]; then
coincidence=`grep "string\[\'$id\'\]" $completeFile` foundInFile=`grep "string\[\'$id\'\]" $completeFile`
if [ ! -z "$coincidence" ]; then if [ ! -z "$foundInFile" ]; then
coincidence=1
found=$file found=$file
return return
fi fi
fi fi
coincidence=0
found=0 found=0
} }

View File

@ -533,5 +533,9 @@ function generate_local_module_file($appindex, $translations) {
$filecontents = substr_replace($filecontents, $lmsstring, $start, $end - $start); $filecontents = substr_replace($filecontents, $lmsstring, $start, $end - $start);
if (substr($filecontents, -2) != "\n\n") {
$filecontents .= "\n";
}
file_put_contents($filepath, $filecontents); file_put_contents($filepath, $filecontents);
} }

View File

@ -24,4 +24,6 @@ else
php -f moodle_to_json.php "$forceLang" php -f moodle_to_json.php "$forceLang"
fi fi
cp langindex.json ../../moodle-local_moodlemobileapp
print_ok 'All done!' print_ok 'All done!'

View File

@ -1,11 +1,11 @@
{ {
"all": "All", "all": "All",
"allincludinghidden": "All (including archived)", "allincludinghidden": "All (including removed from view)",
"browseallcourses": "Browse all courses", "browseallcourses": "Browse all courses",
"card": "Card", "card": "Card",
"favourites": "Starred", "favourites": "Starred",
"future": "Future", "future": "Future",
"hiddencourses": "Archived", "hiddencourses": "Removed from view",
"inprogress": "In progress", "inprogress": "In progress",
"lastaccessed": "Last accessed", "lastaccessed": "Last accessed",
"list": "List", "list": "List",

View File

@ -20,7 +20,7 @@
"cannoteditduetostatementsubmission": "You can't add or edit a submission in the app because the submission statement could not be retrieved from the site.", "cannoteditduetostatementsubmission": "You can't add or edit a submission in the app because the submission statement could not be retrieved from the site.",
"cannotgradefromapp": "Certain grading methods are not yet supported by the app and cannot be modified.", "cannotgradefromapp": "Certain grading methods are not yet supported by the app and cannot be modified.",
"cannotsubmitduetostatementsubmission": "You can't make a submission in the app because the submission statement could not be retrieved from the site.", "cannotsubmitduetostatementsubmission": "You can't make a submission in the app because the submission statement could not be retrieved from the site.",
"confirmstart": "Your submission will have a time limit of {{$a}}. When you start, the timer will begin to count down and cannot be paused. You must finish your submission before it expires. Are you sure you wish to start now?", "confirmstart": "You have {{$a}} to complete this assignment. When you begin, the timer will start to count down and can't be paused.",
"confirmsubmission": "Are you sure you want to submit your work for grading? You will not be able to make any more changes.", "confirmsubmission": "Are you sure you want to submit your work for grading? You will not be able to make any more changes.",
"currentattempt": "This is attempt {{$a}}.", "currentattempt": "This is attempt {{$a}}.",
"currentattemptof": "This is attempt {{$a.attemptnumber}} ( {{$a.maxattempts}} attempts allowed ).", "currentattemptof": "This is attempt {{$a.attemptnumber}} ( {{$a.maxattempts}} attempts allowed ).",

View File

@ -5,8 +5,8 @@
"approve": "Approve", "approve": "Approve",
"approved": "Approved", "approved": "Approved",
"ascending": "Ascending", "ascending": "Ascending",
"authorfirstname": "Author first name", "authorfirstname": "First name",
"authorlastname": "Author surname", "authorlastname": "Last name",
"confirmdeleterecord": "Are you sure you want to delete this entry?", "confirmdeleterecord": "Are you sure you want to delete this entry?",
"descending": "Descending", "descending": "Descending",
"disapprove": "Undo approval", "disapprove": "Undo approval",
@ -22,16 +22,16 @@
"foundrecords": "Found records: {{$a.num}}/{{$a.max}} (<a href=\"{{$a.reseturl}}\">Reset filters</a>)", "foundrecords": "Found records: {{$a.num}}/{{$a.max}} (<a href=\"{{$a.reseturl}}\">Reset filters</a>)",
"gettinglocation": "Getting location", "gettinglocation": "Getting location",
"latlongboth": "Both latitude and longitude are required.", "latlongboth": "Both latitude and longitude are required.",
"locationpermissiondenied": "Permission to access your location has been denied.",
"locationnotenabled": "Location is not enabled", "locationnotenabled": "Location is not enabled",
"locationpermissiondenied": "Permission to access your location has been denied.",
"menuchoose": "Choose...", "menuchoose": "Choose...",
"modulenameplural": "Databases", "modulenameplural": "Databases",
"more": "More", "more": "More",
"mylocation": "My location", "mylocation": "My location",
"noaccess": "You do not have access to this page", "noaccess": "You do not have access to this page",
"nomatch": "No matching entries found!", "nomatch": "No matching entries found!",
"norecords": "No entries in database", "norecords": "No entries yet",
"notapproved": "Entry is not approved yet.", "notapproved": "Pending approval",
"notopenyet": "Sorry, this activity is not available until {{$a}}", "notopenyet": "Sorry, this activity is not available until {{$a}}",
"numrecords": "{{$a}} entries", "numrecords": "{{$a}} entries",
"other": "Other", "other": "Other",
@ -47,4 +47,4 @@
"timeadded": "Time added", "timeadded": "Time added",
"timemodified": "Time modified", "timemodified": "Time modified",
"usedate": "Include in search." "usedate": "Include in search."
} }

View File

@ -28,7 +28,7 @@ Feature: Users can manage entries in database activities
Scenario: Create entry Scenario: Create entry
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
Then I should find "No entries in database" in the app Then I should find "No entries yet" in the app
When I press "Add entries" in the app When I press "Add entries" in the app
And I set the following fields to these values in the app: And I set the following fields to these values in the app:
| URL | https://moodle.org/ | | URL | https://moodle.org/ |
@ -142,7 +142,7 @@ Feature: Users can manage entries in database activities
Then I should find "Are you sure you want to delete this entry?" in the app Then I should find "Are you sure you want to delete this entry?" in the app
And I press "Delete" in the app And I press "Delete" in the app
And I should not find "Moodle Cloud" in the app And I should not find "Moodle Cloud" in the app
And I should find "No entries in database" in the app And I should find "No entries yet" in the app
Scenario: Delete entry (teacher) & Update entry (teacher) Scenario: Delete entry (teacher) & Update entry (teacher)
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app

View File

@ -29,7 +29,7 @@ Feature: Users can store entries in database activities when offline and sync wh
Scenario: Create entry (offline) Scenario: Create entry (offline)
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I switch network connection to offline And I switch network connection to offline
And I should find "No entries in database" in the app And I should find "No entries yet" in the app
When I press "Add entries" in the app When I press "Add entries" in the app
And I set the following fields to these values in the app: And I set the following fields to these values in the app:
| URL | https://moodle.org/ | | URL | https://moodle.org/ |
@ -47,7 +47,7 @@ Feature: Users can store entries in database activities when offline and sync wh
Scenario: Update entry (offline) & Delete entry (offline) Scenario: Update entry (offline) & Delete entry (offline)
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I should find "No entries in database" in the app And I should find "No entries yet" in the app
And I press "Add entries" in the app And I press "Add entries" in the app
And I set the following fields to these values in the app: And I set the following fields to these values in the app:
| URL | https://moodle.org/ | | URL | https://moodle.org/ |
@ -97,7 +97,7 @@ Feature: Users can store entries in database activities when offline and sync wh
Scenario: Students can undo deleting entries to a database in the app while offline Scenario: Students can undo deleting entries to a database in the app while offline
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I should find "No entries in database" in the app And I should find "No entries yet" in the app
And I press "Add entries" in the app And I press "Add entries" in the app
And I set the following fields to these values in the app: And I set the following fields to these values in the app:
| URL | https://moodle.org/ | | URL | https://moodle.org/ |

View File

@ -22,7 +22,7 @@
"favourite": "Starred course", "favourite": "Starred course",
"filtermycourses": "Filter my courses", "filtermycourses": "Filter my courses",
"frontpage": "Site home", "frontpage": "Site home",
"hidecourse": "Archive", "hidecourse": "Remove from view",
"ignore": "Ignore", "ignore": "Ignore",
"mycourses": "My courses", "mycourses": "My courses",
"mymoodle": "Dashboard", "mymoodle": "Dashboard",
@ -41,7 +41,7 @@
"searchcourses": "Search courses", "searchcourses": "Search courses",
"searchcoursesadvice": "You can use the search courses button to find courses to access as a guest or enrol yourself in courses that allow it.", "searchcoursesadvice": "You can use the search courses button to find courses to access as a guest or enrol yourself in courses that allow it.",
"selfenrolment": "Self enrolment", "selfenrolment": "Self enrolment",
"show": "Unarchive", "show": "Restore to view",
"showonlyenrolled": "Show only my courses", "showonlyenrolled": "Show only my courses",
"therearecourses": "There are {{$a}} courses", "therearecourses": "There are {{$a}} courses",
"totalcoursesearchresults": "Total courses: {{$a}}" "totalcoursesearchresults": "Total courses: {{$a}}"

View File

@ -4,7 +4,7 @@
"auth_email": "Email-based self-registration", "auth_email": "Email-based self-registration",
"authenticating": "Authenticating", "authenticating": "Authenticating",
"cancel": "Cancel", "cancel": "Cancel",
"changepassword": "Change your password", "changepassword": "Change password",
"changepasswordbutton": "Change password", "changepasswordbutton": "Change password",
"changepasswordhelp": "If you have problems changing your password, please contact your site administrator. \"Site Administrators\" are the people who manages the Moodle at your school/university/company or learning organisation. If you don't know how to contact them, please contact your teachers/trainers.", "changepasswordhelp": "If you have problems changing your password, please contact your site administrator. \"Site Administrators\" are the people who manages the Moodle at your school/university/company or learning organisation. If you don't know how to contact them, please contact your teachers/trainers.",
"changepasswordreconnectinstructions": "If you didn't change your password correctly, you'll be asked to do it again.", "changepasswordreconnectinstructions": "If you didn't change your password correctly, you'll be asked to do it again.",

View File

@ -95,18 +95,18 @@ Feature: Test basic usage of login in app
Given I force a password change for user "student1" Given I force a password change for user "student1"
When I enter the app When I enter the app
And I log in as "student1" And I log in as "student1"
Then I should find "Change your password" in the app Then I should find "Change password" in the app
And I should find "You must change your password to proceed." in the app And I should find "You must change your password to proceed." in the app
When I press "Change password" in the app When I press "Change password" "ion-button" in the app
Then the app should have opened a browser tab with url "webserver" Then the app should have opened a browser tab with url "webserver"
When I close the browser tab opened by the app When I close the browser tab opened by the app
Then I should find "If you didn't change your password correctly, you'll be asked to do it again." in the app Then I should find "If you didn't change your password correctly, you'll be asked to do it again." in the app
But I should not find "Change your password" in the app But I should not find "Change password" in the app
When I press "Reconnect" in the app When I press "Reconnect" in the app
Then I should find "Change your password" in the app Then I should find "Change password" in the app
But I should not find "Reconnect" in the app But I should not find "Reconnect" in the app
When I press "Switch account" in the app When I press "Switch account" in the app
@ -114,10 +114,10 @@ Feature: Test basic usage of login in app
And I should find "david student" in the app And I should find "david student" in the app
When I press "david student" in the app When I press "david student" in the app
Then I should find "Change your password" in the app Then I should find "Change password" in the app
But I should not find "Reconnect" in the app But I should not find "Reconnect" in the app
When I press "Change password" in the app When I press "Change password" "ion-button" in the app
Then the app should have opened a browser tab with url "webserver" Then the app should have opened a browser tab with url "webserver"
When I switch to the browser tab opened by the app When I switch to the browser tab opened by the app
@ -135,7 +135,7 @@ Feature: Test basic usage of login in app
When I close the browser tab opened by the app When I close the browser tab opened by the app
Then I should find "If you didn't change your password correctly, you'll be asked to do it again." in the app Then I should find "If you didn't change your password correctly, you'll be asked to do it again." in the app
But I should not find "Change your password" in the app But I should not find "Change password" in the app
When I press "Reconnect" in the app When I press "Reconnect" in the app
Then I should find "Acceptance test site" in the app Then I should find "Acceptance test site" in the app

View File

@ -181,7 +181,7 @@
"mod_glossary": "Glossary", "mod_glossary": "Glossary",
"mod_h5pactivity": "H5P", "mod_h5pactivity": "H5P",
"mod_imscp": "IMS content package", "mod_imscp": "IMS content package",
"mod_label": "Label", "mod_label": "Text and media",
"mod_lesson": "Lesson", "mod_lesson": "Lesson",
"mod_lti": "External tool", "mod_lti": "External tool",
"mod_page": "Page", "mod_page": "Page",