diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelGpx.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelGpx.java index 9f3e8cf3596..0cab715be72 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelGpx.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelGpx.java @@ -77,9 +77,13 @@ public GpxTrackAnalysis getAnalysis() { @Override public WptPt createWptPt(@NonNull Amenity amenity, @Nullable String lang) { WptPt wptPt = new WptPt(); + wptPt.setName(amenity.getName()); wptPt.setLat(amenity.getLocation().getLatitude()); wptPt.setLon(amenity.getLocation().getLongitude()); - wptPt.setName(amenity.getName()); + + Map wptPtExtensions = wptPt.getExtensionsToWrite(); + amenity.getNamesMap(true).forEach((key, value) -> wptPtExtensions.put("name:" + key, value)); + for (String obfTag : amenity.getAdditionalInfoKeys()) { String value = amenity.getAdditionalInfo(obfTag); if (!Algorithms.isEmpty(value)) { @@ -96,12 +100,13 @@ public WptPt createWptPt(@NonNull Amenity amenity, @Nullable String lang) { } else if (WPT_EXTRA_TAGS.equals(obfTag)) { Gson gson = new Gson(); Type type = new TypeToken>() {}.getType(); - wptPt.getExtensionsToWrite().putAll(gson.fromJson(value, type)); + wptPtExtensions.putAll(gson.fromJson(value, type)); } else if (!doNotSaveWptTags.contains(obfTag)) { - wptPt.getExtensionsToWrite().put(obfTag, value); + wptPtExtensions.put(obfTag, value); } } } + return wptPt; } diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java index 39b01ab0b4c..a52544ebb4c 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/data/TravelObfHelper.java @@ -1154,7 +1154,14 @@ public boolean publish(Amenity amenity) { if (amenity.isRouteTrack()) { if (!isAlreadyProcessed) { isAlreadyProcessed = true; - reconstructGpxTagsFromAmenityType(amenity, gpxFileExtensions); + reconstructActivityFromAmenity(amenity, gpxFileExtensions); + amenity.getNamesMap(true).forEach((lang, value) -> + { + if (!"ref".equals(lang) && !"sym".equals(lang)) { + gpxFileExtensions.put("name:" + lang, value); + } + } + ); for (String tag : amenity.getAdditionalInfoKeys()) { String value = amenity.getAdditionalInfo(tag); if (tag.startsWith(OBF_POINTS_GROUPS_PREFIX)) { @@ -1192,7 +1199,7 @@ public boolean isCancelled() { }; } - private void reconstructGpxTagsFromAmenityType(Amenity amenity, Map gpxFileExtensions) { + private void reconstructActivityFromAmenity(Amenity amenity, Map gpxFileExtensions) { if (amenity.isRouteTrack() && amenity.getSubType() != null) { String subType = amenity.getSubType(); if (subType.startsWith(ROUTES_PREFIX)) {