fix destination:forward/backward taking precedence over destination:lang (proposed)

This commit is contained in:
sonora 2016-10-26 10:23:37 +02:00
parent 0e23abe1c4
commit 641901e289

View file

@ -138,7 +138,7 @@ public class RouteDataObject {
int[] kt = names.keys();
String destinationTag = (direction == true) ? "destination:forward" : "destination:backward";
if(!Algorithms.isEmpty(lang)) {
destinationTag = "destination:" + lang;
String destinationTagLang = "destination:lang:" + lang;
}
String destinationTagDefault = "destination";
String destinationDefault = null;
@ -149,6 +149,9 @@ public class RouteDataObject {
if(destinationTag.equals(region.routeEncodingRules.get(k).getTag())) {
return (transliterate) ? Junidecode.unidecode(names.get(k)) : names.get(k);
}
if(!Algorithms.isEmpty(lang) && destinationTagLang.equals(region.routeEncodingRules.get(k).getTag())) {
return (transliterate) ? Junidecode.unidecode(names.get(k)) : names.get(k);
}
if(destinationTagDefault.equals(region.routeEncodingRules.get(k).getTag())) {
destinationDefault = names.get(k);
}