Add relation names with translation #4227

This commit is contained in:
Victor Shcherb 2018-02-03 13:03:57 +01:00
parent 1d6c0a380a
commit 26b9a1fb63

View file

@ -274,7 +274,8 @@ public abstract class MapRenderingTypes {
String v = parser.getAttributeValue("", "nameTags"); String v = parser.getAttributeValue("", "nameTags");
if (v != null) { if (v != null) {
String[] names = v.split(","); 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++) { for (int i = 0; i < names.length; i++) {
String tagName = names[i]; String tagName = names[i];
if (rtype.namePrefix.length() > 0) { if (rtype.namePrefix.length() > 0) {
@ -282,7 +283,12 @@ public abstract class MapRenderingTypes {
} }
MapRulType mt = MapRulType.createText(tagName); MapRulType mt = MapRulType.createText(tagName);
mt = registerRuleType(mt); 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;
}
} }
} }
} }