Skip to content

Commit

Permalink
Fixed #5182 - All warnings in "Internationalization" (#5183)
Browse files Browse the repository at this point in the history
<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation
<!--
- Explain what your PR does. If this PR fixes an existing bug, please
include
- "Fixes #bugnum:" in the explanation so that GitHub can auto-close the
issue
  - when this PR is merged.
  -->
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
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [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)).

<!--
## For UI-specific PRs only
Delete these section if this PR does not include UI-related changes.
If your PR includes UI-related changes, then:
- Add screenshots for portrait/landscape for both a tablet & phone of
the before & after UI changes
- For the screenshots above, include both English and pseudo-localized
(RTL) screenshots (see [RTL
guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines))
- Add a video showing the full UX flow with a screen reader enabled (see
[accessibility
guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide))
- For PRs introducing new UI elements or color changes, both light and
dark mode screenshots must be included
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing
-->
<br>

---------

Co-authored-by: Adhiambo Peres <[email protected]>
  • Loading branch information
Rd4dev and adhiamboperes authored Oct 14, 2023
1 parent 1496445 commit e060e2f
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/src/main/res/layout-land/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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" />
</LinearLayout>
</ScrollView>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/add_profile_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

<Button
android:id="@+id/open_dialog_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Concept Card 2"
android:text="@string/concept_card_two_button_text"
android:textAllCaps="false" />
</LinearLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/exploration_test_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

<FrameLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/font_scale_test_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:text="html Content"
android:text="@string/font_scale_html_content_text"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="20sp" />
</FrameLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/profile_progress_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/state_fragment_test_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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}" />
</FrameLayout>
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<string name="menu_my_downloads">My Downloads</string>
<string name="menu_help">Help</string>
<string name="exploration_activity_title">Exploration Player</string>
<string name="play_exploration_button_text">Play exploration</string>
<string name="help_activity_title">Help</string>
<string name="bottom_sheet_options_menu_close">Close</string>
<string name="menu_switch_profile">Switch Profile</string>
Expand All @@ -27,6 +28,8 @@
<string name="cellular_data_alert_dialog_description">Streaming audio may use a lot of cellular data.</string>
<string name="cellular_data_alert_dialog_checkbox">Don\'t show this message again</string>
<string name="concept_card_toolbar_title">Concept Card</string>
<string name="concept_card_one_button_text">Concept Card 1</string>
<string name="concept_card_two_button_text">Concept Card 2</string>
<string name="revision_card_toolbar_title">Revision Card</string>
<string name="unsaved_exploration_dialog_title">Leave to Topic Page?</string>
<string name="unsaved_exploration_dialog_description">Your progress will not be saved.</string>
Expand Down Expand Up @@ -60,6 +63,7 @@
<string name="previous_state_description">Navigate to the previous card</string>
<string name="next_state_description">Navigate to the next card</string>
<string name="state_submit_button">Submit</string>
<string name="submit_button_text">Submit</string>
<string name="lesson_replay_button_text">Replay</string>
<string name="state_end_exploration_button">Return To Topic</string>
<string name="previous_responses_header">Previous Responses (%s)</string>
Expand All @@ -68,6 +72,7 @@
<string name="topic_download_text">(%s)</string>
<string name="see_more">See More</string>
<string name="see_less">See Less</string>
<string name="sample_text_view_text">This is a sample text view</string>
<string name="FAQs">FAQs</string>
<string name="featured_questions">Featured Questions</string>
<string name="frequently_asked_questions">Frequently Asked Questions</string>
Expand Down Expand Up @@ -356,6 +361,8 @@
<string name="add_profile_required">Required</string>
<string name="back_button">Back Button</string>
<string name="next">Next</string>
<!-- ProfileAndDeviceIDsActivity -->
<string name="learner_analytics_label_text">Learner Study Analytics</string>
<!-- AdministratorControlsFragment -->
<string name="administrator_controls_general_label">General</string>
<string name="administrator_controls_edit_account">Edit account</string>
Expand Down Expand Up @@ -482,6 +489,8 @@
<string name="ratio_content_description_separator" description="The separator that would be used to build the text that would be read out for ratio interaction.For e.g if the input is 1:2:3 the read out text would be 1 to 2 to 3">\u0020to\u0020</string>
<string name="ratio_default_hint_text" description="The default hint text for the ratio interaction if the placeholder text is not available.">Enter a ratio in the form x:y.</string>
<string name="text_input_default_hint_text">Tap here to enter text.</string>
<string name="test_number_input_interaction_hint">Write the digit here.</string>
<string name="test_text_input_interaction_hint">Write here.</string>
<string name="smallest_text_size_content_description">Smallest text size</string>
<string name="largest_text_size_content_description">Largest text size</string>
<string name="coming_soon">Coming Soon</string>
Expand Down Expand Up @@ -596,4 +605,5 @@
<string name="profile_picture_image_view_content_description">Profile Picture Image View</string>
<string name="lock_icon_content_description">Lock Icon</string>
<string name="download_status_image_content_description">Download Status</string>
<string name="font_scale_html_content_text">html Content</string>
</resources>

0 comments on commit e060e2f

Please sign in to comment.