From 26b9a1fb6360d24f459b6d1edf96cb18813347fe Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 3 Feb 2018 13:03:57 +0100 Subject: [PATCH] Add relation names with translation #4227 --- OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java b/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java index d20d7f79d4..533c13cc7d 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapRenderingTypes.java @@ -274,7 +274,8 @@ public abstract class MapRenderingTypes { String v = parser.getAttributeValue("", "nameTags"); if (v != null) { String[] names = v.split(","); - rtype.names = new MapRulType[names.length]; + rtype.names = new MapRulType[names.length * (langs.length + 1)]; + int j = 0; for (int i = 0; i < names.length; i++) { String tagName = names[i]; if (rtype.namePrefix.length() > 0) { @@ -282,7 +283,12 @@ public abstract class MapRenderingTypes { } MapRulType mt = MapRulType.createText(tagName); mt = registerRuleType(mt); - rtype.names[i] = mt; + rtype.names[j++] = mt; + for(String lng : langs) { + mt = MapRulType.createText(tagName + ":" + lng); + mt = registerRuleType(mt); + rtype.names[j++] = mt; + } } } }