Some of our JavaScript files have UI messages but we don't want to

make them dynamic.

So I'm creating a globally scoped JavaScript array called rails_i18n
which holds some of these messages. It's loaded in <head> before any
of the JavaScript files so it should always be available.
This commit is contained in:
Ævar Arnfjörð Bjarmason 2009-10-02 20:19:28 +00:00
parent d0f2288797
commit b0e1560875
3 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,4 @@
/*
* Called as the user scrolls/zooms around to aniplate hrefs of the
* view tab and various other links
@ -61,7 +62,7 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj
node.href = setArgs("/edit", args);
node.style.fontStyle = 'normal';
} else {
node.href = 'javascript:alert("zoom in to edit map");';
node.href = 'javascript:alert(rails_i18n["layouts.edit_zoom_alert"]);';
node.style.fontStyle = 'italic';
}
}
@ -86,7 +87,7 @@ function updatelinks(lon,lat,zoom,layers,minlon,minlat,maxlon,maxlat,objtype,obj
node.href = setArgs("/history", args);
node.style.fontStyle = 'normal';
} else {
node.href = 'javascript:alert("zoom in to see editing history");';
node.href = 'javascript:alert(rails_i18n["layouts.history_zoom_alert"]);';
node.style.fontStyle = 'italic';
}
}