diff options
author | Jochen Topf <jochen@topf.org> | 2012-01-25 09:39:03 +0100 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2012-01-25 09:39:03 +0100 |
commit | b8ffeb2230639bbb3ed05cb04ec13c08d1866c16 (patch) | |
tree | 96fe7139faeefca28860eb4565c526be1f2ebb16 | |
parent | d3699717c6c7df498d4efb82d88e071802553de3 (diff) | |
download | taginfo-b8ffeb2230639bbb3ed05cb04ec13c08d1866c16.tar taginfo-b8ffeb2230639bbb3ed05cb04ec13c08d1866c16.tar.gz |
Remove special case for I18N texts for Javascript
-rwxr-xr-x | web/taginfo.rb | 38 | ||||
-rw-r--r-- | web/viewsjs/texts.js.erb | 33 |
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 +%>; |