]> git.openstreetmap.org Git - rails.git/commitdiff
Look for locale specific names
authorTom Hughes <tom@compton.nu>
Fri, 7 Nov 2014 15:19:30 +0000 (15:19 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 7 Nov 2014 15:19:30 +0000 (15:19 +0000)
app/assets/javascripts/index/query.js

index d5b9fb2c1bcd962f4263fc395b11e30ad10ddc65..12bb49efc97a4964ed45067918eeb42a75187228 100644 (file)
@@ -112,7 +112,14 @@ OSM.Query = function(map) {
   }
 
   function featureName(feature) {
-    var tags = feature.tags;
+    var tags = feature.tags,
+      locales = I18n.locales.get();
+
+    for (var i = 0; i < locales.length; i++) {
+      if (tags["name:" + locales[i]]) {
+        return tags["name:" + locales[i]];
+      }
+    }
 
     if (tags["name"]) {
       return tags["name"];