X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dae3dcf87edcfc0648cd0b93b069b0eee67d3ab7..4afedb07a26f8e9da05697b4e26ff52ef1fe55fb:/app/assets/javascripts/application.js 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; + } });