Fix depicts and categories pickers for RTL languages (#6503)

This fixes the layouts to work in both left to right (LTR)
and right to left (RTL) languages.

Also replace two hard-coded strings in the depicts picker
with proper string resources.

Fixes #6502.
This commit is contained in:
Amir E. Aharoni 2025-10-14 04:54:54 -04:00 committed by GitHub
parent 0c244f369c
commit a1c5974e93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 14 deletions

View file

@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/category_layout" android:id="@+id/category_layout"
android:layoutDirection="locale"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -10,26 +11,31 @@
android:id="@+id/upload_category_checkbox" android:id="@+id/upload_category_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minWidth="48dp"
android:minHeight="48dp"
android:checkMark="?android:attr/textCheckMark" android:checkMark="?android:attr/textCheckMark"
android:checked="false" android:checked="false"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="@dimen/tiny_gap" android:padding="@dimen/tiny_gap"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/category_image" app:layout_constraintEnd_toStartOf="@+id/category_image"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView <com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/category_image" android:id="@+id/category_image"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:paddingEnd="@dimen/tiny_gap" android:layout_marginStart="@dimen/tiny_gap"
android:layout_marginEnd="@dimen/tiny_gap"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/upload_category_checkbox" app:layout_constraintStart_toEndOf="@+id/upload_category_checkbox"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/text_container"
app:placeholderImage="@drawable/commons" /> app:placeholderImage="@drawable/commons" />
<LinearLayout <LinearLayout
android:id="@+id/text_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"

View file

@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/depicts_layout" android:id="@+id/depicts_layout"
android:layoutDirection="locale"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
@ -9,26 +10,31 @@
android:id="@+id/depict_checkbox" android:id="@+id/depict_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minWidth="48dp"
android:minHeight="48dp"
android:checkMark="?android:attr/textCheckMark" android:checkMark="?android:attr/textCheckMark"
android:checked="false" android:checked="false"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="@dimen/tiny_gap" android:padding="@dimen/tiny_gap"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/depicted_image" app:layout_constraintEnd_toStartOf="@+id/depicted_image"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView <com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/depicted_image" android:id="@+id/depicted_image"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:paddingRight="@dimen/tiny_gap" android:layout_marginStart="@dimen/tiny_gap"
android:layout_marginEnd="@dimen/tiny_gap"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/depict_checkbox" app:layout_constraintStart_toEndOf="@+id/depict_checkbox"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toStartOf="@+id/text_container"
app:placeholderImage="@drawable/ic_wikidata_logo_24dp" /> app:placeholderImage="@drawable/ic_wikidata_logo_24dp" />
<LinearLayout <LinearLayout
android:id="@+id/text_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
@ -41,14 +47,14 @@
android:id="@+id/depicts_label" android:id="@+id/depicts_label"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Label" android:text="@string/depicts_label"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Description" /> android:text="@string/depicts_description" />
</LinearLayout> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -17,7 +17,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/half_standard_height" android:layout_height="@dimen/half_standard_height"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -25,7 +24,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/half_standard_height" android:layout_height="@dimen/half_standard_height"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="@dimen/normal_text" android:textSize="@dimen/normal_text"
android:textStyle="bold" android:textStyle="bold"
@ -77,7 +75,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/tiny_gap" android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:indeterminate="true" android:indeterminate="true"
android:indeterminateOnly="true" android:indeterminateOnly="true"

View file

@ -22,7 +22,6 @@
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap" android:layout_marginRight="@dimen/standard_gap"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -30,7 +29,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/half_standard_height" android:layout_height="@dimen/half_standard_height"
android:layout_marginEnd="@dimen/standard_gap" android:layout_marginEnd="@dimen/standard_gap"
android:layout_marginRight="@dimen/standard_gap"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="@dimen/normal_text" android:textSize="@dimen/normal_text"
android:textStyle="bold" android:textStyle="bold"
@ -99,7 +97,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/tiny_gap" android:layout_marginEnd="@dimen/tiny_gap"
android:layout_marginRight="@dimen/tiny_gap"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:indeterminate="true" android:indeterminate="true"
android:indeterminateOnly="true" android:indeterminateOnly="true"

View file

@ -468,6 +468,8 @@
<string name="map_attribution">{{Optional}}\n&lt;code&gt;&amp;amp;#169;&lt;/code&gt; is the copyright symbol (©).</string> <string name="map_attribution">{{Optional}}\n&lt;code&gt;&amp;amp;#169;&lt;/code&gt; is the copyright symbol (©).</string>
<string name="categories_tooltip">{{Doc-commons-app-depicts}}</string> <string name="categories_tooltip">{{Doc-commons-app-depicts}}</string>
<string name="depicts_step_title">{{Doc-commons-app-depicts}}</string> <string name="depicts_step_title">{{Doc-commons-app-depicts}}</string>
<string name="depicts_label">Label</string>
<string name="depicts_description">Description</string>
<string name="pan_and_zoom_to_adjust">Panning means moving the map left/right/up/down, typically by touching the screen with one finger and moving it.\n\nZooming means making the map\'s scale bigger or smaller, typically by pinching with two fingers.\n\nExample in other app:\nhttps://igss.schneider-electric.com/features/pan-and-zoom-in-definition/</string> <string name="pan_and_zoom_to_adjust">Panning means moving the map left/right/up/down, typically by touching the screen with one finger and moving it.\n\nZooming means making the map\'s scale bigger or smaller, typically by pinching with two fingers.\n\nExample in other app:\nhttps://igss.schneider-electric.com/features/pan-and-zoom-in-definition/</string>
<string name="location_picker_image_view_shadow">A description of a visual element, location picker image shadow. Used for accesibility usually.</string> <string name="location_picker_image_view_shadow">A description of a visual element, location picker image shadow. Used for accesibility usually.</string>
<string name="label">{{Identical|Label}}</string> <string name="label">{{Identical|Label}}</string>

View file

@ -710,6 +710,8 @@ Upload your first media by tapping on the add button.</string>
<string name="categories_tooltip">Please select the appropriate categories. Unlike depictions, categories are only in English.</string> <string name="categories_tooltip">Please select the appropriate categories. Unlike depictions, categories are only in English.</string>
<string name="license_tooltip">Commons makes your pictures reusable and adapted by everyone. Do you want to waive all rights? Do you want to be attributed? Do you want adaptations to use the same license?</string> <string name="license_tooltip">Commons makes your pictures reusable and adapted by everyone. Do you want to waive all rights? Do you want to be attributed? Do you want adaptations to use the same license?</string>
<string name="depicts_step_title">Depicts</string> <string name="depicts_step_title">Depicts</string>
<string name="depicts_label">Label</string>
<string name="depicts_description">Description</string>
<string name="license_step_title">Media License</string> <string name="license_step_title">Media License</string>
<string name="media_detail_step_title">Media Details</string> <string name="media_detail_step_title">Media Details</string>
<string name="menu_view_category_page">View category page</string> <string name="menu_view_category_page">View category page</string>