]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/embed.js.erb
Fallback to english locale when looking for community index templates
[rails.git] / app / assets / javascripts / embed.js.erb
index c92be45155133a245a90699d912d69d5b24fe4c0..9a0ec07d31d85855c06a02d0179d29f7a298d207 100644 (file)
@@ -5,13 +5,13 @@
 //= require i18n
 //= require i18n/embed
 
-window.onload = function () {
-  if (navigator.languages) {
-    I18n.locale = navigator.languages[0];
-  } else if (navigator.language) {
-    I18n.locale = navigator.language;
-  }
+if (navigator.languages) {
+  I18n.locale = navigator.languages[0];
+} else if (navigator.language) {
+  I18n.locale = navigator.language;
+}
 
+window.onload = function () {
   var query = (window.location.search || '?').slice(1),
       args  = {};
 
@@ -75,7 +75,7 @@ window.onload = function () {
 L.Control.OSMReportAProblem = L.Control.Attribution.extend({
   options: {
     position: 'bottomright',
-    prefix: '<a href="http://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">'+I18n.t('javascripts.embed.report_problem')+'</a>'
+    prefix: '<a href="https://www.openstreetmap.org/fixthemap?lat={x}&lon={y}&zoom={z}" target="_blank">'+I18n.t('javascripts.embed.report_problem')+'</a>'
   },
 
   onAdd: function (map) {