X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9a9b045372a6f48420a9a6dacfde52c34ab7abce..4afedb07a26f8e9da05697b4e26ff52ef1fe55fb:/app/assets/javascripts/application.js?ds=sidebyside diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 5064d115b..7d5b99f60 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -115,4 +115,24 @@ $(document).ready(function () { $("nav.primary li a").on("click", function() { $("header").toggleClass("closed"); }); + + var application_data = $("head").data(); + + I18n.default_locale = OSM.DEFAULT_LOCALE; + I18n.locale = application_data.locale; + I18n.fallbacks = true; + + OSM.preferred_editor = application_data.preferredEditor; + + if (application_data.user) { + OSM.user = application_data.user; + + if (application_data.userHome) { + OSM.home = application_data.userHome; + } + } + + if (application_data.location) { + OSM.location = application_data.location; + } });