aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xweb/taginfo.rb38
-rw-r--r--web/viewsjs/texts.js.erb33
2 files changed, 34 insertions, 37 deletions
diff --git a/web/taginfo.rb b/web/taginfo.rb
index 384eb81..93ec312 100755
--- a/web/taginfo.rb
+++ b/web/taginfo.rb
@@ -112,7 +112,7 @@ class Taginfo < Sinatra::Base
javascript 'jquery.tipsy'
# javascript 'flexigrid-minified'
javascript 'flexigrid'
- javascript 'lang/' + r18n.locale.code
+ javascript r18n.locale.code + '/texts'
javascript 'taginfo'
# set to immediate expire on normal pages
@@ -175,42 +175,6 @@ class Taginfo < Sinatra::Base
erb :"#{js}.js", :layout => false, :content_type => 'text/javascript', :views => 'viewsjs'
end
- get '/js/lang/:lang.js' do
- expires next_update
- trans = R18n::I18n.new(params[:lang], 'i18n')
- return 'var texts = ' + {
- :flexigrid => {
- :pagetext => trans.t.flexigrid.pagetext,
- :pagestat => trans.t.flexigrid.pagestat,
- :outof => trans.t.flexigrid.outof,
- :findtext => trans.t.flexigrid.findtext,
- :procmsg => trans.t.flexigrid.procmsg,
- :nomsg => trans.t.flexigrid.nomsg,
- :errormsg => trans.t.flexigrid.errormsg,
- },
- :misc => {
- :values_less_than_one_percent => trans.t.misc.values_less_than_one_percent,
- :empty_string => trans.t.misc.empty_string,
- :all => trans.t.misc.all,
- },
- :osm => {
- :key => trans.t.osm.key,
- :keys => trans.t.osm.keys,
- :value => trans.t.osm.value,
- :values => trans.t.osm.values,
- :tag => trans.t.osm.tag,
- :tags => trans.t.osm.tags,
- :node => trans.t.osm.node,
- :nodes => trans.t.osm.nodes,
- :way => trans.t.osm.way,
- :ways => trans.t.osm.ways,
- :relation => trans.t.osm.relation,
- :relations => trans.t.osm.relations,
- :all => trans.t.osm.all
- },
- }.to_json + ";\n"
- end
-
#--------------------------------------------------------------------------
load 'lib/api/db.rb'
diff --git a/web/viewsjs/texts.js.erb b/web/viewsjs/texts.js.erb
new file mode 100644
index 0000000..a123485
--- /dev/null
+++ b/web/viewsjs/texts.js.erb
@@ -0,0 +1,33 @@
+var texts = <%=
+ {
+ :flexigrid => {
+ :pagetext => @trans.t.flexigrid.pagetext,
+ :pagestat => @trans.t.flexigrid.pagestat,
+ :outof => @trans.t.flexigrid.outof,
+ :findtext => @trans.t.flexigrid.findtext,
+ :procmsg => @trans.t.flexigrid.procmsg,
+ :nomsg => @trans.t.flexigrid.nomsg,
+ :errormsg => @trans.t.flexigrid.errormsg,
+ },
+ :misc => {
+ :values_less_than_one_percent => @trans.t.misc.values_less_than_one_percent,
+ :empty_string => @trans.t.misc.empty_string,
+ :all => @trans.t.misc.all,
+ },
+ :osm => {
+ :key => @trans.t.osm.key,
+ :keys => @trans.t.osm.keys,
+ :value => @trans.t.osm.value,
+ :values => @trans.t.osm.values,
+ :tag => @trans.t.osm.tag,
+ :tags => @trans.t.osm.tags,
+ :node => @trans.t.osm.node,
+ :nodes => @trans.t.osm.nodes,
+ :way => @trans.t.osm.way,
+ :ways => @trans.t.osm.ways,
+ :relation => @trans.t.osm.relation,
+ :relations => @trans.t.osm.relations,
+ :all => @trans.t.osm.all
+ },
+ }.to_json
+%>;