Enebale I18n for embedded maps
authorTom Hughes <tom@compton.nu>
Wed, 9 Mar 2016 19:26:31 +0000 (19:26 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 9 Mar 2016 19:26:31 +0000 (19:26 +0000)
app/assets/javascripts/embed.js.erb

index 5f8b253188240801a303cc62d7afa1000fe6bf82..256b47146b70f430108b0da9b190731c054c078d 100644 (file)
@@ -1,7 +1,14 @@
 //= require leaflet
 //= require leaflet.osm
+//= require i18n/translations
 
 window.onload = function () {
+  if (navigator.languages) {
+    I18n.locale = navigator.languages[0];
+  } else if (navigator.language) {
+    I18n.locale = navigator.language;
+  }
+
   var query = (window.location.search || '?').substr(1),
       args  = {};