MOBILE-4081 lang: Improvements on script and import translations
This commit is contained in:
		
							parent
							
								
									5eb0bd2448
								
							
						
					
					
						commit
						6b2be863b5
					
				
							
								
								
									
										8
									
								
								.github/workflows/testing.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								.github/workflows/testing.yml
									
									
									
									
										vendored
									
									
								
							@ -23,15 +23,13 @@ jobs:
 | 
			
		||||
        fi
 | 
			
		||||
        gulp
 | 
			
		||||
        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`
 | 
			
		||||
        if [ $allcount -ne $langindexcount ]; then
 | 
			
		||||
          echo "Lang file has $langcount ($freemiumcount) while langindex $langindexcount"
 | 
			
		||||
        if [ $langcount -ne $langindexcount ]; then
 | 
			
		||||
          echo "Lang file has $langcount while langindex $langindexcount"
 | 
			
		||||
          exit 1
 | 
			
		||||
        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`
 | 
			
		||||
        found=0
 | 
			
		||||
        for i in $langkeys; do
 | 
			
		||||
 | 
			
		||||
@ -40,12 +40,14 @@ function exists_in_file {
 | 
			
		||||
 | 
			
		||||
    completeFile="$LANGPACKSFOLDER/en/$file.php"
 | 
			
		||||
    if [ -f "$completeFile" ]; then
 | 
			
		||||
        coincidence=`grep "string\[\'$id\'\]" $completeFile`
 | 
			
		||||
        if [ ! -z "$coincidence" ]; then
 | 
			
		||||
        foundInFile=`grep "string\[\'$id\'\]" $completeFile`
 | 
			
		||||
        if [ ! -z "$foundInFile" ]; then
 | 
			
		||||
            coincidence=1
 | 
			
		||||
            found=$file
 | 
			
		||||
            return
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
    coincidence=0
 | 
			
		||||
    found=0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -533,5 +533,9 @@ function generate_local_module_file($appindex, $translations) {
 | 
			
		||||
 | 
			
		||||
    $filecontents = substr_replace($filecontents, $lmsstring, $start, $end - $start);
 | 
			
		||||
 | 
			
		||||
    if (substr($filecontents, -2) != "\n\n") {
 | 
			
		||||
        $filecontents .= "\n";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    file_put_contents($filepath, $filecontents);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -24,4 +24,6 @@ else
 | 
			
		||||
    php -f moodle_to_json.php "$forceLang"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cp langindex.json ../../moodle-local_moodlemobileapp
 | 
			
		||||
 | 
			
		||||
print_ok 'All done!'
 | 
			
		||||
 | 
			
		||||
@ -1,11 +1,11 @@
 | 
			
		||||
{
 | 
			
		||||
    "all": "All",
 | 
			
		||||
    "allincludinghidden": "All (including archived)",
 | 
			
		||||
    "allincludinghidden": "All (including removed from view)",
 | 
			
		||||
    "browseallcourses": "Browse all courses",
 | 
			
		||||
    "card": "Card",
 | 
			
		||||
    "favourites": "Starred",
 | 
			
		||||
    "future": "Future",
 | 
			
		||||
    "hiddencourses": "Archived",
 | 
			
		||||
    "hiddencourses": "Removed from view",
 | 
			
		||||
    "inprogress": "In progress",
 | 
			
		||||
    "lastaccessed": "Last accessed",
 | 
			
		||||
    "list": "List",
 | 
			
		||||
 | 
			
		||||
@ -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.",
 | 
			
		||||
    "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.",
 | 
			
		||||
    "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.",
 | 
			
		||||
    "currentattempt": "This is attempt {{$a}}.",
 | 
			
		||||
    "currentattemptof": "This is attempt {{$a.attemptnumber}} ( {{$a.maxattempts}} attempts allowed ).",
 | 
			
		||||
 | 
			
		||||
@ -5,8 +5,8 @@
 | 
			
		||||
    "approve": "Approve",
 | 
			
		||||
    "approved": "Approved",
 | 
			
		||||
    "ascending": "Ascending",
 | 
			
		||||
    "authorfirstname": "Author first name",
 | 
			
		||||
    "authorlastname": "Author surname",
 | 
			
		||||
    "authorfirstname": "First name",
 | 
			
		||||
    "authorlastname": "Last name",
 | 
			
		||||
    "confirmdeleterecord": "Are you sure you want to delete this entry?",
 | 
			
		||||
    "descending": "Descending",
 | 
			
		||||
    "disapprove": "Undo approval",
 | 
			
		||||
@ -22,16 +22,16 @@
 | 
			
		||||
    "foundrecords": "Found records: {{$a.num}}/{{$a.max}} (<a href=\"{{$a.reseturl}}\">Reset filters</a>)",
 | 
			
		||||
    "gettinglocation": "Getting location",
 | 
			
		||||
    "latlongboth": "Both latitude and longitude are required.",
 | 
			
		||||
    "locationpermissiondenied": "Permission to access your location has been denied.",
 | 
			
		||||
    "locationnotenabled": "Location is not enabled",
 | 
			
		||||
    "locationpermissiondenied": "Permission to access your location has been denied.",
 | 
			
		||||
    "menuchoose": "Choose...",
 | 
			
		||||
    "modulenameplural": "Databases",
 | 
			
		||||
    "more": "More",
 | 
			
		||||
    "mylocation": "My location",
 | 
			
		||||
    "noaccess": "You do not have access to this page",
 | 
			
		||||
    "nomatch": "No matching entries found!",
 | 
			
		||||
    "norecords": "No entries in database",
 | 
			
		||||
    "notapproved": "Entry is not approved yet.",
 | 
			
		||||
    "norecords": "No entries yet",
 | 
			
		||||
    "notapproved": "Pending approval",
 | 
			
		||||
    "notopenyet": "Sorry, this activity is not available until {{$a}}",
 | 
			
		||||
    "numrecords": "{{$a}} entries",
 | 
			
		||||
    "other": "Other",
 | 
			
		||||
@ -47,4 +47,4 @@
 | 
			
		||||
    "timeadded": "Time added",
 | 
			
		||||
    "timemodified": "Time modified",
 | 
			
		||||
    "usedate": "Include in search."
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@ Feature: Users can manage entries in database activities
 | 
			
		||||
 | 
			
		||||
  Scenario: Create entry
 | 
			
		||||
    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
 | 
			
		||||
    And I set the following fields to these values in the app:
 | 
			
		||||
      | 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
 | 
			
		||||
    And I press "Delete" 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)
 | 
			
		||||
    Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@ Feature: Users can store entries in database activities when offline and sync wh
 | 
			
		||||
  Scenario: Create entry (offline)
 | 
			
		||||
    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 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
 | 
			
		||||
    And I set the following fields to these values in the app:
 | 
			
		||||
      | 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)
 | 
			
		||||
    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 set the following fields to these values in the app:
 | 
			
		||||
      | 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
 | 
			
		||||
    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 set the following fields to these values in the app:
 | 
			
		||||
      | URL | https://moodle.org/ |
 | 
			
		||||
 | 
			
		||||
@ -22,7 +22,7 @@
 | 
			
		||||
    "favourite": "Starred course",
 | 
			
		||||
    "filtermycourses": "Filter my courses",
 | 
			
		||||
    "frontpage": "Site home",
 | 
			
		||||
    "hidecourse": "Archive",
 | 
			
		||||
    "hidecourse": "Remove from view",
 | 
			
		||||
    "ignore": "Ignore",
 | 
			
		||||
    "mycourses": "My courses",
 | 
			
		||||
    "mymoodle": "Dashboard",
 | 
			
		||||
@ -41,7 +41,7 @@
 | 
			
		||||
    "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.",
 | 
			
		||||
    "selfenrolment": "Self enrolment",
 | 
			
		||||
    "show": "Unarchive",
 | 
			
		||||
    "show": "Restore to view",
 | 
			
		||||
    "showonlyenrolled": "Show only my courses",
 | 
			
		||||
    "therearecourses": "There are {{$a}} courses",
 | 
			
		||||
    "totalcoursesearchresults": "Total courses: {{$a}}"
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
    "auth_email": "Email-based self-registration",
 | 
			
		||||
    "authenticating": "Authenticating",
 | 
			
		||||
    "cancel": "Cancel",
 | 
			
		||||
    "changepassword": "Change your password",
 | 
			
		||||
    "changepassword": "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.",
 | 
			
		||||
    "changepasswordreconnectinstructions": "If you didn't change your password correctly, you'll be asked to do it again.",
 | 
			
		||||
 | 
			
		||||
@ -95,18 +95,18 @@ Feature: Test basic usage of login in app
 | 
			
		||||
    Given I force a password change for user "student1"
 | 
			
		||||
    When I enter the app
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
    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"
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
    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
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
    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"
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
    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
 | 
			
		||||
    Then I should find "Acceptance test site" in the app
 | 
			
		||||
 | 
			
		||||
@ -181,7 +181,7 @@
 | 
			
		||||
    "mod_glossary": "Glossary",
 | 
			
		||||
    "mod_h5pactivity": "H5P",
 | 
			
		||||
    "mod_imscp": "IMS content package",
 | 
			
		||||
    "mod_label": "Label",
 | 
			
		||||
    "mod_label": "Text and media",
 | 
			
		||||
    "mod_lesson": "Lesson",
 | 
			
		||||
    "mod_lti": "External tool",
 | 
			
		||||
    "mod_page": "Page",
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user