mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Nearby places icons localization bug fix (#1947)
* Changed the places icon selection from english text to QID
This commit is contained in:
parent
7b7d17a33b
commit
c8a8e5b714
2 changed files with 33 additions and 23 deletions
|
|
@ -103,12 +103,19 @@ public class NearbyPlaces {
|
|||
String point = fields[0];
|
||||
String wikiDataLink = Utils.stripLocalizedString(fields[1]);
|
||||
String name = Utils.stripLocalizedString(fields[2]);
|
||||
|
||||
//getting icon link here
|
||||
String identifier = Utils.stripLocalizedString(fields[3]);
|
||||
//getting the ID which is at the end of link
|
||||
identifier = identifier.split("/")[Utils.stripLocalizedString(fields[3]).split("/").length-1];
|
||||
//replaced the extra > char from fields
|
||||
identifier = identifier.replace(">","");
|
||||
|
||||
String type = Utils.stripLocalizedString(fields[4]);
|
||||
String icon = fields[5];
|
||||
String wikipediaSitelink = Utils.stripLocalizedString(fields[7]);
|
||||
String commonsSitelink = Utils.stripLocalizedString(fields[8]);
|
||||
String category = Utils.stripLocalizedString(fields[9]);
|
||||
|
||||
Timber.v("Name: " + name + ", type: " + type + ", category: " + category + ", wikipediaSitelink: " + wikipediaSitelink + ", commonsSitelink: " + commonsSitelink);
|
||||
|
||||
double latitude;
|
||||
|
|
@ -127,7 +134,7 @@ public class NearbyPlaces {
|
|||
|
||||
places.add(new Place(
|
||||
name,
|
||||
Place.Label.fromText(type), // list
|
||||
Place.Label.fromText(identifier), // list
|
||||
type, // details
|
||||
Uri.parse(icon),
|
||||
new LatLng(latitude, longitude, 0),
|
||||
|
|
|
|||
|
|
@ -121,27 +121,30 @@ public class Place {
|
|||
*/
|
||||
public enum Label {
|
||||
|
||||
BUILDING("building", R.drawable.round_icon_generic_building),
|
||||
HOUSE("house", R.drawable.round_icon_house),
|
||||
COTTAGE("cottage", R.drawable.round_icon_house),
|
||||
FARMHOUSE("farmhouse", R.drawable.round_icon_house),
|
||||
CHURCH("church", R.drawable.round_icon_church),
|
||||
RAILWAY_STATION("railway station", R.drawable.round_icon_railway_station),
|
||||
GATEHOUSE("gatehouse", R.drawable.round_icon_gatehouse),
|
||||
MILESTONE("milestone", R.drawable.round_icon_milestone),
|
||||
INN("inn", R.drawable.round_icon_house),
|
||||
CITY("city", R.drawable.round_icon_city),
|
||||
SECONDARY_SCHOOL("secondary school", R.drawable.round_icon_school),
|
||||
EDU("edu", R.drawable.round_icon_school),
|
||||
ISLE("isle", R.drawable.round_icon_island),
|
||||
MOUNTAIN("mountain", R.drawable.round_icon_mountain),
|
||||
AIRPORT("airport", R.drawable.round_icon_airport),
|
||||
BRIDGE("bridge", R.drawable.round_icon_bridge),
|
||||
ROAD("road", R.drawable.round_icon_road),
|
||||
FOREST("forest", R.drawable.round_icon_forest),
|
||||
PARK("park", R.drawable.round_icon_park),
|
||||
RIVER("river", R.drawable.round_icon_river),
|
||||
WATERFALL("waterfall", R.drawable.round_icon_waterfall),
|
||||
BUILDING("Q41176", R.drawable.round_icon_generic_building),
|
||||
HOUSE("Q3947", R.drawable.round_icon_house),
|
||||
COTTAGE("Q5783996", R.drawable.round_icon_house),
|
||||
FARMHOUSE("Q489357", R.drawable.round_icon_house),
|
||||
CHURCH("Q16970", R.drawable.round_icon_church), //changed from church to church building
|
||||
RAILWAY_STATION("Q55488", R.drawable.round_icon_railway_station),
|
||||
GATEHOUSE("Q277760", R.drawable.round_icon_gatehouse),
|
||||
MILESTONE("Q10145", R.drawable.round_icon_milestone),
|
||||
INN("Q256020", R.drawable.round_icon_house), //Q27686
|
||||
HOTEL("Q27686", R.drawable.round_icon_house),
|
||||
CITY("Q515", R.drawable.round_icon_city),
|
||||
UNIVERSITY("Q3918",R.drawable.round_icon_school), //added university
|
||||
SCHOOL("Q3914", R.drawable.round_icon_school), //changed from "secondary school" to school
|
||||
EDUCATION("Q8434", R.drawable.round_icon_school), //changed from edu to education, there is no id for "edu"
|
||||
ISLE("Q23442", R.drawable.round_icon_island),
|
||||
MOUNTAIN("Q8502", R.drawable.round_icon_mountain),
|
||||
AIRPORT("Q1248784", R.drawable.round_icon_airport),
|
||||
BRIDGE("Q12280", R.drawable.round_icon_bridge),
|
||||
ROAD("Q34442", R.drawable.round_icon_road),
|
||||
FOREST("Q4421", R.drawable.round_icon_forest),
|
||||
PARK("Q22698", R.drawable.round_icon_park),
|
||||
RIVER("Q4022", R.drawable.round_icon_river),
|
||||
WATERFALL("Q34038", R.drawable.round_icon_waterfall),
|
||||
TEMPLE("Q44539",R.drawable.round_icon_church),
|
||||
UNKNOWN("?", R.drawable.round_icon_unknown);
|
||||
|
||||
private static final Map<String, Label> TEXT_TO_DESCRIPTION
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue