]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/id_iframe.html.erb
Update iD, set locale
[rails.git] / app / views / site / id_iframe.html.erb
index b4cfaf46109479c124046f3ad67272101be56c99..8565cb9ea9f84c87fe0bea5f359940443cc3daa5 100644 (file)
       'Please upgrade your browser or use Potlatch 2 to edit the map.';
     document.getElementById('id-container').className = 'unsupported';
   } else {
+    <% locale = request.compatible_language_from(ID::LOCALES) || "en" %>
+
     var id = iD()
       .embed(true)
       .assetPath("/assets/iD/") <%# Can't use asset_path('iD/') in production. %>
+      .locale("<%= locale %>", "<%= asset_path("iD/locales/#{locale}.json") %>")
       .preauth({
         <% token = @user.access_token(ID_KEY) %>
         url: "<%= request.protocol + request.host_with_port %>",