From 123f17dca27d46f4b77074bcb94dbd8debc17af2 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Fri, 30 Aug 2024 12:07:24 +0300
Subject: [PATCH 1/6] Fix unclosed html tags
---
app/src/main/res/values-sw/strings.xml | 5 ++---
app/src/main/res/values/strings.xml | 30 +++++++++++++-------------
2 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/app/src/main/res/values-sw/strings.xml b/app/src/main/res/values-sw/strings.xml
index 049ebac057a..d4426d7b0b2 100644
--- a/app/src/main/res/values-sw/strings.xml
+++ b/app/src/main/res/values-sw/strings.xml
@@ -1,5 +1,4 @@
-
-
Policy Page
Privacy Policy
- this page for the latest version of this privacy policy.]]>
+ Please visit <a href="https://www.oppia.org/privacy-policy">this page</a> for the latest version of this privacy policy.
Terms of Service
- Terms of Service and Privacy Policy.]]>
- this page for the latest version of these terms.]]>
+ By using %s, you agree to our <br> Terms of Service and Privacy Policy.
+ Please visit <a href="https://www.oppia.org/terms">this page</a> for the latest version of these terms.
What is %s?
Who is an Administrator?
@@ -569,19 +569,19 @@
How do I update my Android OS?
I can\'t find my question here. What now?
- %1$s "O-pee-yah" (Finnish) - "to learn"
%1$s\'s mission is to help anyone learn anything they want in an effective and enjoyable way.
By creating a set of free, high-quality, demonstrably effective lessons with the help of educators from around the world, %1$s aims to provide students with quality education — regardless of where they are or what traditional resources they have access to.
As a student, you can begin your learning adventure by browsing the topics listed on the Home Page!
]]>
- An Administrator is the main user that manages profiles and settings for every profile on their account. They are most likely your parent, teacher, or guardian that created this profile for you.
Administrators have the ability to manage profiles, assign PINs, and change other settings under their account. Depending on your profile, Administrator permissions may be required for certain features such as changing your PIN, and more.
To see who your Administrator is, go to the Profile Chooser. The first profile listed and has "Administrator" written under their name is the Administrator.
]]>
- If it is your first time creating a profile and you do not have a PIN:- From the Profile Chooser, tap on Set up Multiple Profiles.
- Create a PIN and Save.
- Fill in all fields for the profile.
- (Optional) Upload a photo.
- Enter a name.
- (Optional) Assign a 3-digit PIN.
- Tap Create. This profile is added to your Profile Chooser!
If you have created a profile before and have a PIN:
- From the Profile Chooser, tap on Add Profile.
- Enter your PIN and tap Submit.
- Fill in all fields for the profile.
- (Optional) Upload a photo.
- Enter a name.
- (Optional) Assign a 3-digit PIN.
- Tap Create. This profile is added to your Profile Chooser!
Note: Only the Administrator is able to manage profiles.
]]>
- The %s app currently supports English, Brazilian Portuguese, Arabic, Swahili, and Nigerian Pidgin. Choose one of these languages in the menu, under Options. To request the app in your language, please contact us at admin@oppia.org.]]>
- - From your %s app home screen, tap the menu in the top left corner.
- Tap Share feedback.
- Follow the instructions to report the bug or share feedback.
]]>
- %1$s’s mission is to help learners gain necessary life skills. Math is an essential skill in everyday life. %1$s will be offering new lessons on science and other subjects soon!]]>
- Yes, %s will be offering new lessons on science and other subjects soon. Please check back for updates!]]>
- If the Exploration Player is not loading
Check to see if the app is up to date:
- Go to the Play Store and make sure the app is updated to its latest version
Check your internet connection:
- If your internet connection is slow, try re-connecting to your Wi-Fi network or connecting to a different network.
Ask the Administrator to check their device and internet connection:
- Get the Administrator to troubleshoot using the steps above
Let us know if you still have issues with loading:
- Report a problem by contacting us at admin@oppia.org.
]]>
- If your audio is not playing
Check to see if the app is up to date:
- Go to the Play Store and make sure the app is updated to its latest version
Check your internet connection:
- If your internet connection is slow, try re-connecting to your Wi-Fi network or connecting to a different network. Slow internet may cause the audio to load irregularly, making it difficult to play.
Ask the Administrator to check their device and internet connection:
- Get the Administrator to troubleshoot using the steps above
Let us know if you still have issues with loading:
- Report a problem by contacting us at admin@oppia.org.
]]>
- Once a profile is deleted:- The profile cannot be recovered.
- Profile information such as name, photos, and progress will be permanently deleted.
To delete a profile (excluding the Administrator):
- From the Administrator's Home Page, tap on the menu button on the top left.
- Tap on Administrator Controls.
- Tap on Edit Profiles.
- Tap on the Profile you would like to delete.
- At the bottom of the screen, tap Profile Deletion.
- Tap Delete to confirm deletion.
Note: Only the Administrator is able to manage profiles.
]]>
- - Open the Google Play Store app.
- Search for the %s app.
- Tap Update.
]]>
- - Tap your phone's Settings app.
- Tap System updates.
- Tap System updates and follow the instructions to update your Android operating system.
]]>
- If you cannot find your question or would like to report a bug, contact us at admin@oppia.org.]]>
+ <p>%1$s <i>"O-pee-yah"</i> (Finnish) - "to learn"</p><p><br></p><p>%1$s\'s mission is to help anyone learn anything they want in an effective and enjoyable way.</p><p><br></p><p>By creating a set of free, high-quality, demonstrably effective lessons with the help of educators from around the world, %1$s aims to provide students with quality education — regardless of where they are or what traditional resources they have access to.</p><p><br></p><p>As a student, you can begin your learning adventure by browsing the topics listed on the Home Page!</p>
+ <p>An Administrator is the main user that manages profiles and settings for every profile on their account. They are most likely your parent, teacher, or guardian that created this profile for you.</p><p><br></p><p>Administrators have the ability to manage profiles, assign PINs, and change other settings under their account. Depending on your profile, Administrator permissions may be required for certain features such as changing your PIN, and more.</p><p><br></p><p>To see who your Administrator is, go to the Profile Chooser. The first profile listed and has "Administrator" written under their name is the Administrator.</p>
+ <p>If it is your first time creating a profile and you do not have a PIN:<ol><li>From the Profile Chooser, tap on <strong>Set up Multiple Profiles</strong>.</li><li>Create a PIN and <strong>Save</strong>.</li><li>Fill in all fields for the profile.<ol><li>(Optional) Upload a photo.</li><li>Enter a name.</li><li>(Optional) Assign a 3-digit PIN.</li></ol></li><li>Tap <strong>Create</strong>. This profile is added to your Profile Chooser!</li></ol></p><p>If you have created a profile before and have a PIN:<ol><li>From the Profile Chooser, tap on <strong>Add Profile</strong>.</li><li>Enter your PIN and tap <strong>Submit</strong>.</li><li>Fill in all fields for the profile.<ol><li>(Optional) Upload a photo.</li><li>Enter a name.</li><li>(Optional) Assign a 3-digit PIN.</li></ol></li><li>Tap <strong>Create</strong>. This profile is added to your Profile Chooser!</li></ol></p><p><br></p><p>Note: Only the <u>Administrator</u> is able to manage profiles.</p>
+ <p>The %s app currently supports English, Brazilian Portuguese, Arabic, Swahili, and Nigerian Pidgin. Choose one of these languages in the menu, under Options. To request the app in your language, please contact us at <strong>admin@oppia.org</strong>.</p>
+ <p><ol><li>From your %s app home screen, tap the menu in the top left corner.</li><li>Tap <strong>Share feedback</strong>.</li><li>Follow the instructions to report the bug or share feedback.</li></ol></p>
+ <p>%1$s\'s mission is to help learners gain necessary life skills. Math is an essential skill in everyday life. %1$s will be offering new lessons on science and other subjects soon!</p>
+ <p>Yes, %s will be offering new lessons on science and other subjects soon. Please check back for updates!</p>
+ <p>If the Exploration Player is not loading</p><p><br></p><p>Check to see if the app is up to date:</p><ul><li>Go to the Play Store and make sure the app is updated to its latest version</li></ul><p><br></p><p>Check your internet connection:</p><ul><li>If your internet connection is slow, try re-connecting to your Wi-Fi network or connecting to a different network.</li></ul><p>Ask the Administrator to check their device and internet connection:</p><ul><li>Get the Administrator to troubleshoot using the steps above</li></ul><p><br></p><p>Let us know if you still have issues with loading:</p><ul><li>Report a problem by contacting us at admin@oppia.org.</li></ul>
+ <p>If your audio is not playing</p><p><br></p><p>Check to see if the app is up to date:</p><ul><li>Go to the Play Store and make sure the app is updated to its latest version</li></ul><p><br></p><p>Check your internet connection:</p><ul><li>If your internet connection is slow, try re-connecting to your Wi-Fi network or connecting to a different network. Slow internet may cause the audio to load irregularly, making it difficult to play.</li></ul><p><br></p><p>Ask the Administrator to check their device and internet connection:</p><ul><li>Get the Administrator to troubleshoot using the steps above</li></ul><p><br></p><p>Let us know if you still have issues with loading:</p><ul><li>Report a problem by contacting us at admin@oppia.org.</li></ul>
+ <p>Once a profile is deleted:</p><ol><li>The profile cannot be recovered.</li><li>Profile information such as name, photos, and progress will be permanently deleted.</li></ol><p>To delete a profile (excluding the <u>Administrator</u>):</p><ol><li>From the Administrator's Home Page, tap on the menu button on the top left.</li><li>Tap on <strong>Administrator Controls</strong>.</li><li>Tap on <strong>Edit Profiles</strong>.</li><li>Tap on the Profile you would like to delete.</li><li>At the bottom of the screen, tap <strong>Profile Deletion</strong>.</li><li>Tap <strong>Delete</strong> to confirm deletion.</li></ol><p><br></p><p>Note: Only the <u>Administrator</u> is able to manage profiles.</p>
+ <p><ol><li>Open the Google Play Store app.</li><li>Search for the %s app.</li><li>Tap Update.</li></ol></p>
+ <p><ol><li>Tap your phone\'s Settings app.</li><li>Tap System updates.</li><li>Tap System updates and follow the instructions to update your Android operating system.</li></ol></p>
+ <p>If you cannot find your question or would like to report a bug, contact us at <strong>admin@oppia.org.</strong></p>
Profile Edit Fragment Test Activity
Administrator Controls Fragment Test Activity
From 8ab6e835a05883aceaf441815be04249f6f91c75 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Fri, 30 Aug 2024 15:06:53 +0300
Subject: [PATCH 3/6] Remove CDATA
---
app/src/main/res/values/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e3b615e1f9f..af4ec2eb1c7 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -578,7 +578,7 @@
<p>Yes, %s will be offering new lessons on science and other subjects soon. Please check back for updates!</p>
<p>If the Exploration Player is not loading</p><p><br></p><p>Check to see if the app is up to date:</p><ul><li>Go to the Play Store and make sure the app is updated to its latest version</li></ul><p><br></p><p>Check your internet connection:</p><ul><li>If your internet connection is slow, try re-connecting to your Wi-Fi network or connecting to a different network.</li></ul><p>Ask the Administrator to check their device and internet connection:</p><ul><li>Get the Administrator to troubleshoot using the steps above</li></ul><p><br></p><p>Let us know if you still have issues with loading:</p><ul><li>Report a problem by contacting us at admin@oppia.org.</li></ul>
<p>If your audio is not playing</p><p><br></p><p>Check to see if the app is up to date:</p><ul><li>Go to the Play Store and make sure the app is updated to its latest version</li></ul><p><br></p><p>Check your internet connection:</p><ul><li>If your internet connection is slow, try re-connecting to your Wi-Fi network or connecting to a different network. Slow internet may cause the audio to load irregularly, making it difficult to play.</li></ul><p><br></p><p>Ask the Administrator to check their device and internet connection:</p><ul><li>Get the Administrator to troubleshoot using the steps above</li></ul><p><br></p><p>Let us know if you still have issues with loading:</p><ul><li>Report a problem by contacting us at admin@oppia.org.</li></ul>
- <p>Once a profile is deleted:</p><ol><li>The profile cannot be recovered.</li><li>Profile information such as name, photos, and progress will be permanently deleted.</li></ol><p>To delete a profile (excluding the <u>Administrator</u>):</p><ol><li>From the Administrator's Home Page, tap on the menu button on the top left.</li><li>Tap on <strong>Administrator Controls</strong>.</li><li>Tap on <strong>Edit Profiles</strong>.</li><li>Tap on the Profile you would like to delete.</li><li>At the bottom of the screen, tap <strong>Profile Deletion</strong>.</li><li>Tap <strong>Delete</strong> to confirm deletion.</li></ol><p><br></p><p>Note: Only the <u>Administrator</u> is able to manage profiles.</p>
+ <p>Once a profile is deleted:</p><ol><li>The profile cannot be recovered.</li><li>Profile information such as name, photos, and progress will be permanently deleted.</li></ol><p>To delete a profile (excluding the <u>Administrator</u>):</p><ol><li>From the Administrator\'s Home Page, tap on the menu button on the top left.</li><li>Tap on <strong>Administrator Controls</strong>.</li><li>Tap on <strong>Edit Profiles</strong>.</li><li>Tap on the Profile you would like to delete.</li><li>At the bottom of the screen, tap <strong>Profile Deletion</strong>.</li><li>Tap <strong>Delete</strong> to confirm deletion.</li></ol><p><br></p><p>Note: Only the <u>Administrator</u> is able to manage profiles.</p>
<p><ol><li>Open the Google Play Store app.</li><li>Search for the %s app.</li><li>Tap Update.</li></ol></p>
<p><ol><li>Tap your phone\'s Settings app.</li><li>Tap System updates.</li><li>Tap System updates and follow the instructions to update your Android operating system.</li></ol></p>
<p>If you cannot find your question or would like to report a bug, contact us at <strong>admin@oppia.org.</strong></p>
From 3d432c3db953eaa0624ca65661cfb4a73216ebe3 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Fri, 30 Aug 2024 15:09:45 +0300
Subject: [PATCH 4/6] Prohibit CDATA in xml files
---
.../file_content_validation_checks.textproto | 5 ++++
.../regex/RegexPatternValidationCheckTest.kt | 24 +++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/scripts/assets/file_content_validation_checks.textproto b/scripts/assets/file_content_validation_checks.textproto
index 9a9918f2f64..d4e3597a664 100644
--- a/scripts/assets/file_content_validation_checks.textproto
+++ b/scripts/assets/file_content_validation_checks.textproto
@@ -116,6 +116,11 @@ file_content_checks {
failure_message: "All plurals outside strings.xml must be marked as not translatable, or moved to strings.xml."
exempted_file_patterns: "app/src/main/res/values.*?/strings\\.xml"
}
+file_content_checks {
+ file_path_regex: "app/src/main/res/values/strings\\.xml"
+ prohibited_content_regex: "CDATA"
+ failure_message: "CDATA isn't handled by Translatewiki correctly. Use escaped HTML, instead."
+}
file_content_checks {
file_path_regex: ".+?\\.kt"
prohibited_content_regex: "android.text.BidiFormatter"
diff --git a/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt b/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
index 4e96123650e..5f47d4b81e1 100644
--- a/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
+++ b/scripts/src/javatests/org/oppia/android/scripts/regex/RegexPatternValidationCheckTest.kt
@@ -222,6 +222,8 @@ class RegexPatternValidationCheckTest {
private val referenceComputeIfAbsent =
"computeIfAbsent won't desugar and requires Java 8 support (SDK 24+). Suggest using an atomic" +
" Kotlin-specific solution, instead."
+ private val cdataShouldNotBeUsed =
+ "CDATA isn't handled by Translatewiki correctly. Use escaped HTML, instead."
private val wikiReferenceNote =
"Refer to https://github.com/oppia/oppia-android/wiki/Static-Analysis-Checks" +
"#regexpatternvalidation-check for more details on how to fix this."
@@ -2752,6 +2754,28 @@ class RegexPatternValidationCheckTest {
)
}
+ @Test
+ fun testFileContent_includesCdataContentInStringsXml_fileContentIsNotCorrect() {
+ val prohibitedContent =
+ """
+ Some nested HTML.]]>
+ """.trimIndent()
+ tempFolder.newFolder("testfiles", "app", "src", "main", "res", "values")
+ val stringFilePath = "app/src/main/res/values/strings.xml"
+ tempFolder.newFile("testfiles/$stringFilePath").writeText(prohibitedContent)
+
+ val exception = assertThrows() { runScript() }
+
+ assertThat(exception).hasMessageThat().contains(REGEX_CHECK_FAILED_OUTPUT_INDICATOR)
+ assertThat(outContent.toString().trim())
+ .isEqualTo(
+ """
+ $stringFilePath:1: $cdataShouldNotBeUsed
+ $wikiReferenceNote
+ """.trimIndent()
+ )
+ }
+
/** Runs the regex_pattern_validation_check. */
private fun runScript() {
main(File(tempFolder.root, "testfiles").absolutePath)
From ba19e371e31bb7058276b0cdd95a8a82d90aa352 Mon Sep 17 00:00:00 2001
From: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Date: Fri, 30 Aug 2024 15:20:11 +0300
Subject: [PATCH 5/6] Update strings.xml
---
app/src/main/res/values-sw/strings.xml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/src/main/res/values-sw/strings.xml b/app/src/main/res/values-sw/strings.xml
index d4426d7b0b2..17d2fd54cec 100644
--- a/app/src/main/res/values-sw/strings.xml
+++ b/app/src/main/res/values-sw/strings.xml
@@ -1,4 +1,5 @@
-
Terms of Service
- By using %s, you agree to our <br> Terms of Service and Privacy Policy.
+ By using %s, you agree to our <br> <oppia-noninteractive-policy link="tos">Terms of Service</oppia-noninteractive-policy> and <oppia-noninteractive-policy link="privacy">Privacy Policy</oppia-noninteractive-policy>.
Please visit <a href="https://www.oppia.org/terms">this page</a> for the latest version of these terms.
What is %s?