From 64882ca27c7703e25106d599e66ed94b9f9d05a7 Mon Sep 17 00:00:00 2001 From: yuvraj-coder1 Date: Wed, 26 Feb 2025 15:07:07 +0530 Subject: [PATCH 1/3] fix: the description language set to bug by default when uploading image in nearby --- .../main/java/fr/free/nrw/commons/nearby/model/ResultTuple.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/free/nrw/commons/nearby/model/ResultTuple.kt b/app/src/main/java/fr/free/nrw/commons/nearby/model/ResultTuple.kt index 0340082ad..7bfd5856c 100644 --- a/app/src/main/java/fr/free/nrw/commons/nearby/model/ResultTuple.kt +++ b/app/src/main/java/fr/free/nrw/commons/nearby/model/ResultTuple.kt @@ -1,6 +1,7 @@ package fr.free.nrw.commons.nearby.model import com.google.gson.annotations.SerializedName +import java.util.Locale class ResultTuple { @SerializedName("xml:lang") @@ -15,7 +16,7 @@ class ResultTuple { } constructor() { - language = "bug" // Basa Ugi language - TODO Respect the `Default description language` setting. + language = Locale.getDefault().language type = "" value = "" } From 6e090c8d7a4e1f1e1b0dec574a67653662f93322 Mon Sep 17 00:00:00 2001 From: Jason-Whitmore Date: Mon, 31 Mar 2025 01:49:06 -0700 Subject: [PATCH 2/3] ExploreMapFragment.java: fix marker labels in Explore map fragment to display the username (#6260) Before this change, the labels that would appear on the marker when tapped did not include the author or username. Instead, it displayed "Unknown". After this change, the labels now display the author name. If the author name is not available, the username will be displayed. If both are unavailable, the default value of "Unknown" will be displayed. To improve the readability of the text, any HTML text is removed from the username/author. --- .../explore/map/ExploreMapFragment.java | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java b/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java index 1b1659182..f5657dd1b 100644 --- a/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java +++ b/app/src/main/java/fr/free/nrw/commons/explore/map/ExploreMapFragment.java @@ -708,8 +708,17 @@ public class ExploreMapFragment extends CommonsDaggerSupportFragment GeoPoint point = new GeoPoint( nearbyBaseMarker.getPlace().location.getLatitude(), nearbyBaseMarker.getPlace().location.getLongitude()); - OverlayItem item = new OverlayItem(nearbyBaseMarker.getPlace().name, null, - point); + + Media markerMedia = this.getMediaFromImageURL(nearbyBaseMarker.getPlace().pic); + String authorUser = null; + if (markerMedia != null) { + authorUser = markerMedia.getAuthorOrUser(); + // HTML text is sometimes part of the author string and needs to be removed + authorUser = Html.fromHtml(authorUser, Html.FROM_HTML_MODE_LEGACY).toString(); + } + + OverlayItem item = new OverlayItem(nearbyBaseMarker.getPlace().name, + authorUser, point); item.setMarker(d); items.add(item); ItemizedOverlayWithFocus overlay = new ItemizedOverlayWithFocus(items, @@ -740,6 +749,26 @@ public class ExploreMapFragment extends CommonsDaggerSupportFragment } } + /** + * Retrieves the specific Media object from the mediaList field. + * @param url The specific Media's image URL. + * @return The Media object that matches the URL or null if it could not be found. + */ + private Media getMediaFromImageURL(String url) { + if (mediaList == null || url == null) { + return null; + } + + for (int i = 0; i < mediaList.size(); i++) { + if (mediaList.get(i) != null && mediaList.get(i).getImageUrl() != null + && mediaList.get(i).getImageUrl().equals(url)) { + return mediaList.get(i); + } + } + + return null; + } + /** * Removes a marker from the map based on the specified NearbyBaseMarker. * From fdfd7781e94071b350db06d17cd01bb001d18ff7 Mon Sep 17 00:00:00 2001 From: "translatewiki.net" Date: Mon, 31 Mar 2025 14:01:52 +0200 Subject: [PATCH 3/3] Localisation updates from https://translatewiki.net. --- app/src/main/res/values-fr/strings.xml | 6 ++++++ app/src/main/res/values-zgh/strings.xml | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5aeda5299..179bef168 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -853,8 +853,14 @@ Autres wikis Utilisations du fichier + SingleWebViewActivity + Compte + Faire disparaître le compte + Avertissement de disparition du compte + La disparition est un <b>dernier recours</b> et ne devrait être <b>utilisée que quand vous voulez arrêter d’éditer pour toujours</b> et aussi pour cacher autant que possible vos associations passées.<br/><br/>La suppression de compte sur Wikimedia Commons se fait en changeant le nom de votre compte de sorte que les autres ne peuvent pas identifier vos contributions, lors d’un processus appelé disparition du compte. <b>La disparition ne garantit pas l’anonymat complet ni ne supprime les contributions de vos projets</b>. Légende Légende copiée dans le presse-papier + Félicitations, toutes les images dans cet album ont été soit téléchargées soit marquées comme non téléchargeables. Afficher dans Explorer Afficher à proximité diff --git a/app/src/main/res/values-zgh/strings.xml b/app/src/main/res/values-zgh/strings.xml index 27080b999..b3615cefc 100644 --- a/app/src/main/res/values-zgh/strings.xml +++ b/app/src/main/res/values-zgh/strings.xml @@ -1,5 +1,6 @@ @@ -79,7 +80,7 @@ ⵉⴼⵔⵙ ⵉⵙⵉⴹⵏⵏ ⵜⵉⵙⵖⴰⵍ - ⴰⵏⵙⵙⵎⵔⵙ + ⴰⵏⵙⵎⵔⴰⵙ ⵙⵙⵉⴹⵏ ⴰⵙⴳⵯⵙⴰⵏ ⴰⵏⵎⵍⴰⵙⵙ