From e060e2ff265ce35c92f1b969f6d7ad002d1a62ad Mon Sep 17 00:00:00 2001
From: RD Rama Devi <122200035+Rd4dev@users.noreply.github.com>
Date: Sat, 14 Oct 2023 20:33:15 +0530
Subject: [PATCH] Fixed #5182 - All warnings in "Internationalization" (#5183)
## Explanation
Fix #5182 [part of #5169]
Fixes All warnings in "Internationalization" caused by
- hardcoded text : Fixed by assigning `string resource` values
- padding/margins : Fixed by setting `padding end` values
## ScreenShot:
![Lint Issues Internationalization Before
After](https://github.com/oppia/oppia-android/assets/122200035/a2f04893-b670-499b-980b-5151097b47c0)
## Essential Checklist
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).
---------
Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
---
.../main/res/layout-land/profile_progress_header.xml | 1 +
.../administrator_controls_learner_analytics_view.xml | 2 +-
.../res/layout-sw600dp/profile_progress_header.xml | 1 +
.../layout/activity_input_interaction_view_test.xml | 6 +++---
app/src/main/res/layout/add_profile_activity.xml | 1 +
.../administrator_controls_learner_analytics_view.xml | 2 +-
.../res/layout/concept_card_fragment_test_activity.xml | 4 ++--
app/src/main/res/layout/exploration_test_activity.xml | 2 +-
app/src/main/res/layout/font_scale_test_activity.xml | 2 +-
app/src/main/res/layout/profile_progress_header.xml | 1 +
.../res/layout/spotlight_fragment_test_activity.xml | 2 +-
.../main/res/layout/state_fragment_test_activity.xml | 2 +-
app/src/main/res/values/strings.xml | 10 ++++++++++
13 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/app/src/main/res/layout-land/profile_progress_header.xml b/app/src/main/res/layout-land/profile_progress_header.xml
index dda7af7e0ef..994327f7beb 100644
--- a/app/src/main/res/layout-land/profile_progress_header.xml
+++ b/app/src/main/res/layout-land/profile_progress_header.xml
@@ -42,6 +42,7 @@
android:contentDescription="@string/edit_profile_picture_content_description"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="12dp"
+ android:paddingEnd="0dp"
android:paddingTop="12dp"
android:elevation="4dp"
app:layout_constraintBottom_toBottomOf="@+id/profile_edit_image"
diff --git a/app/src/main/res/layout-sw600dp/administrator_controls_learner_analytics_view.xml b/app/src/main/res/layout-sw600dp/administrator_controls_learner_analytics_view.xml
index a2f180b75b1..a9ba3c2c885 100644
--- a/app/src/main/res/layout-sw600dp/administrator_controls_learner_analytics_view.xml
+++ b/app/src/main/res/layout-sw600dp/administrator_controls_learner_analytics_view.xml
@@ -26,7 +26,7 @@
android:paddingTop="28dp"
android:paddingEnd="16dp"
android:paddingBottom="20dp"
- android:text="Learner Study Analytics"
+ android:text="@string/learner_analytics_label_text"
android:textColor="@color/component_color_shared_active_text_color"
app:layout_constraintBottom_toTopOf="@id/profile_and_device_id_text_view"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/app/src/main/res/layout-sw600dp/profile_progress_header.xml b/app/src/main/res/layout-sw600dp/profile_progress_header.xml
index eaf9b8db55c..9ca97de20d1 100644
--- a/app/src/main/res/layout-sw600dp/profile_progress_header.xml
+++ b/app/src/main/res/layout-sw600dp/profile_progress_header.xml
@@ -42,6 +42,7 @@
android:elevation="4dp"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="12dp"
+ android:paddingEnd="0dp"
android:paddingTop="12dp"
app:layout_constraintBottom_toBottomOf="@+id/profile_edit_image"
app:layout_constraintEnd_toEndOf="@+id/profile_edit_image"
diff --git a/app/src/main/res/layout/activity_input_interaction_view_test.xml b/app/src/main/res/layout/activity_input_interaction_view_test.xml
index 94fabcd6f7e..dba00bfb1e8 100644
--- a/app/src/main/res/layout/activity_input_interaction_view_test.xml
+++ b/app/src/main/res/layout/activity_input_interaction_view_test.xml
@@ -122,7 +122,7 @@
android:layout_margin="8dp"
android:background="@drawable/edit_text_background"
android:focusable="true"
- android:hint="Write the digit here."
+ android:hint="@string/test_number_input_interaction_hint"
android:textColor="@color/component_color_shared_primary_text_color"
android:textColorHint="@color/component_color_shared_edit_text_hint_color"
android:longClickable="false"
@@ -154,7 +154,7 @@
android:layout_margin="8dp"
android:background="@drawable/edit_text_background"
android:focusable="true"
- android:hint="Write here."
+ android:hint="@string/test_text_input_interaction_hint"
android:inputType="text"
android:longClickable="false"
android:maxLength="200"
@@ -181,7 +181,7 @@
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:onClick="getPendingAnswerErrorOnSubmitClick"
- android:text="Submit"
+ android:text="@string/submit_button_text"
android:textColor="@color/component_color_shared_secondary_4_text_color" />
diff --git a/app/src/main/res/layout/add_profile_activity.xml b/app/src/main/res/layout/add_profile_activity.xml
index 417092d77a1..a3c2adc51e9 100644
--- a/app/src/main/res/layout/add_profile_activity.xml
+++ b/app/src/main/res/layout/add_profile_activity.xml
@@ -67,6 +67,7 @@
android:contentDescription="@string/edit_profile_picture_content_description"
android:elevation="4dp"
android:paddingStart="12dp"
+ android:paddingEnd="0dp"
android:paddingTop="12dp"
app:layout_constraintBottom_toBottomOf="@+id/add_profile_activity_user_image_view"
app:layout_constraintEnd_toEndOf="@+id/add_profile_activity_user_image_view"
diff --git a/app/src/main/res/layout/administrator_controls_learner_analytics_view.xml b/app/src/main/res/layout/administrator_controls_learner_analytics_view.xml
index cef8061d1cc..2a761c6b17a 100644
--- a/app/src/main/res/layout/administrator_controls_learner_analytics_view.xml
+++ b/app/src/main/res/layout/administrator_controls_learner_analytics_view.xml
@@ -22,7 +22,7 @@
android:paddingTop="28dp"
android:paddingEnd="16dp"
android:paddingBottom="20dp"
- android:text="Learner Study Analytics"
+ android:text="@string/learner_analytics_label_text"
android:textColor="@color/component_color_shared_active_text_color"
app:layout_constraintBottom_toTopOf="@id/profile_and_device_id_text_view"
app:layout_constraintEnd_toEndOf="parent"
diff --git a/app/src/main/res/layout/concept_card_fragment_test_activity.xml b/app/src/main/res/layout/concept_card_fragment_test_activity.xml
index 4894aac319d..9f8586d5570 100644
--- a/app/src/main/res/layout/concept_card_fragment_test_activity.xml
+++ b/app/src/main/res/layout/concept_card_fragment_test_activity.xml
@@ -7,13 +7,13 @@
android:id="@+id/open_dialog_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Concept Card 1"
+ android:text="@string/concept_card_one_button_text"
android:textAllCaps="false"/>
diff --git a/app/src/main/res/layout/exploration_test_activity.xml b/app/src/main/res/layout/exploration_test_activity.xml
index d693b80a73c..19a0bc3a9c5 100644
--- a/app/src/main/res/layout/exploration_test_activity.xml
+++ b/app/src/main/res/layout/exploration_test_activity.xml
@@ -10,7 +10,7 @@
android:id="@+id/play_exploration_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Play exploration"
+ android:text="@string/play_exploration_button_text"
android:textAllCaps="false"/>
diff --git a/app/src/main/res/layout/profile_progress_header.xml b/app/src/main/res/layout/profile_progress_header.xml
index 00f32b61e2b..b00c0202333 100644
--- a/app/src/main/res/layout/profile_progress_header.xml
+++ b/app/src/main/res/layout/profile_progress_header.xml
@@ -44,6 +44,7 @@
android:elevation="4dp"
android:onClick="@{() -> viewModel.clickOnProfilePicture()}"
android:paddingStart="8dp"
+ android:paddingEnd="0dp"
android:paddingTop="8dp"
app:layout_constraintBottom_toBottomOf="@+id/profile_edit_image"
app:layout_constraintEnd_toEndOf="@+id/profile_edit_image"
diff --git a/app/src/main/res/layout/spotlight_fragment_test_activity.xml b/app/src/main/res/layout/spotlight_fragment_test_activity.xml
index 37125d9d9ee..371d51c0430 100644
--- a/app/src/main/res/layout/spotlight_fragment_test_activity.xml
+++ b/app/src/main/res/layout/spotlight_fragment_test_activity.xml
@@ -15,7 +15,7 @@
android:id="@+id/sample_spotlight_target"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="This is a sample text view"
+ android:text="@string/sample_text_view_text"
style="@style/TextViewStart"
android:layout_marginTop="80dp"
android:layout_marginStart="80dp"
diff --git a/app/src/main/res/layout/state_fragment_test_activity.xml b/app/src/main/res/layout/state_fragment_test_activity.xml
index 168334e4845..300bfc41478 100644
--- a/app/src/main/res/layout/state_fragment_test_activity.xml
+++ b/app/src/main/res/layout/state_fragment_test_activity.xml
@@ -31,7 +31,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
- android:text="Play exploration"
+ android:text="@string/play_exploration_button_text"
android:textAllCaps="false"
android:visibility="@{viewModel.hasExplorationStarted ? View.GONE : View.VISIBLE}" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 081bea57539..79ec1534ff1 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -5,6 +5,7 @@
My Downloads
Help
Exploration Player
+ Play exploration
Help
Close
Switch Profile
@@ -27,6 +28,8 @@
Streaming audio may use a lot of cellular data.
Don\'t show this message again
Concept Card
+ Concept Card 1
+ Concept Card 2
Revision Card
Leave to Topic Page?
Your progress will not be saved.
@@ -60,6 +63,7 @@
Navigate to the previous card
Navigate to the next card
Submit
+ Submit
Replay
Return To Topic
Previous Responses (%s)
@@ -68,6 +72,7 @@
(%s)
See More
See Less
+ This is a sample text view
FAQs
Featured Questions
Frequently Asked Questions
@@ -356,6 +361,8 @@
Required
Back Button
Next
+
+ Learner Study Analytics
General
Edit account
@@ -482,6 +489,8 @@
\u0020to\u0020
Enter a ratio in the form x:y.
Tap here to enter text.
+ Write the digit here.
+ Write here.
Smallest text size
Largest text size
Coming Soon
@@ -596,4 +605,5 @@
Profile Picture Image View
Lock Icon
Download Status
+ html Content