Compare commits

..

3 commits

Author SHA1 Message Date
yuvraj-coder1
bb3ef131bc
Merge 64882ca27c into fdfd7781e9 2025-04-02 15:20:55 +05:30
translatewiki.net
fdfd7781e9
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-03-31 14:01:52 +02:00
Jason-Whitmore
6e090c8d7a
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.
2025-03-31 17:49:06 +09:00
3 changed files with 39 additions and 3 deletions

View file

@ -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.
*

View file

@ -853,8 +853,14 @@
<string name="usages_on_other_wikis_heading">Autres wikis</string>
<string name="bullet_point"></string>
<string name="file_usages_container_heading">Utilisations du fichier</string>
<string name="title_activity_single_web_view">SingleWebViewActivity</string>
<string name="account">Compte</string>
<string name="vanish_account">Faire disparaître le compte</string>
<string name="account_vanish_request_confirm_title">Avertissement de disparition du compte</string>
<string name="account_vanish_request_confirm">La disparition est un &lt;b&gt;dernier recours&lt;/b&gt; et ne devrait être &lt;b&gt;utilisée que quand vous voulez arrêter déditer pour toujours&lt;/b&gt; et aussi pour cacher autant que possible vos associations passées.&lt;br/&gt;&lt;br/&gt;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 dun processus appelé disparition du compte. &lt;b&gt;La disparition ne garantit pas lanonymat complet ni ne supprime les contributions de vos projets&lt;/b&gt;.</string>
<string name="caption">Légende</string>
<string name="caption_copied_to_clipboard">Légende copiée dans le presse-papier</string>
<string name="congratulations_all_pictures_in_this_album_have_been_either_uploaded_or_marked_as_not_for_upload">Félicitations, toutes les images dans cet album ont été soit téléchargées soit marquées comme non téléchargeables.</string>
<string name="show_in_explore">Afficher dans Explorer</string>
<string name="show_in_nearby">Afficher à proximité</string>
</resources>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Authors:
* AguzulH
* Brahim-essaidi
* Hakim1bal
-->
@ -79,7 +80,7 @@
<string name="Profile">ⵉⴼⵔⵙ</string>
<string name="statistics">ⵉⵙⵉⴹⵏⵏ</string>
<string name="title_app_shortcut_setting">ⵜⵉⵙⵖⴰⵍ</string>
<string name="leaderboard_column_user">ⴰⵏⵙⵎⵔⵙ</string>
<string name="leaderboard_column_user">ⴰⵏⵙⵎⵔ</string>
<string name="leaderboard_column_count">ⵙⵙⵉⴹⵏ</string>
<string name="leaderboard_yearly">ⴰⵙⴳⵯⵙⴰⵏ</string>
<string name="leaderboard_weekly">ⴰⵏⵎⵍⴰⵙⵙ</string>