diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/i18n/de.yml | 11 | ||||
-rw-r--r-- | web/i18n/en.yml | 67 | ||||
-rw-r--r-- | web/lib/reports.rb | 2 | ||||
-rw-r--r-- | web/lib/ui/reports.rb | 6 | ||||
-rwxr-xr-x | web/taginfo.rb | 22 | ||||
-rw-r--r-- | web/views/download.erb | 16 | ||||
-rw-r--r-- | web/views/layout.erb | 8 | ||||
-rw-r--r-- | web/views/reports/index.erb | 11 | ||||
-rw-r--r-- | web/views/reports/wiki_pages_about_non_existing_keys.erb (renamed from web/views/reports/wiki_pages_about_non-existing_keys.erb) | 0 | ||||
-rw-r--r-- | web/views/sources/index.erb | 19 |
10 files changed, 108 insertions, 54 deletions
diff --git a/web/i18n/de.yml b/web/i18n/de.yml index 2ba0174..379434e 100644 --- a/web/i18n/de.yml +++ b/web/i18n/de.yml @@ -14,13 +14,18 @@ osm: user: User users: Users -buttons: +taginfo: sources: Datenquellen download: Download about: Über Taginfo wiki: Wiki reports: Reports + keys: Keys + tags: Tags + +buttons: show_all_keys: Alle Keys anzeigen + reports: Reports data_from: Daten vom @@ -37,3 +42,7 @@ map: Karte maps: Karten key_combinations: Kombinationen +ui: + empty: + no_description_in_wiki: Keine Beschreibung im Wiki vorhanden + diff --git a/web/i18n/en.yml b/web/i18n/en.yml index 5d37362..0a963e3 100644 --- a/web/i18n/en.yml +++ b/web/i18n/en.yml @@ -15,13 +15,59 @@ osm: user: User users: Users -buttons: +taginfo: + source: Source sources: Sources download: Download about: About wiki: Wiki reports: Reports + keys: Keys + tags: Tags + +buttons: show_all_keys: Show all keys + reports: Reports + +pages: + sources: + index: + intro: | + <p>Taginfo takes data about OSM tags from several sources and brings them + together for easy browsing and discovery.</p> + <p>Note that Taginfo only displays this data. If you want to change it, you + have to go back to the source.</p> + data_until: Data until + last_update_run: Last update run + data_until_explanation: All edits until this time will be in the data, later edits might be. + utc: All times in UTC. + info: | + <p>All times in UTC.</p> + <p>Updates are currently done manually about once a week until they have proven + to work reliably. It is planned to switch to daily updates as soon as + possible.</p> + download: + index: + intro: | + <p>Here you can download the databases used by Taginfo. All the data is stored + in <img src="/img/link-extern.gif" alt=""/><a class="extlink" + href="http://www.sqlite.org/">Sqlite</a> databases. The database files are then + packed with <img src="/img/link-extern.gif" alt=""/><a class="extlink" + href="http://www.bzip.org/">bzip2</a>.</p> + <p>If you don't want to download these databases, but need automated access to + the data, you can also use the <a href="/about">API</a>. + file: File + packed: Packed + unpacked: Unpacked + description: Description + reports: + index: + intro: | + <p class="text">Reports show the data from different perspectives. + They often bring together data from several sources in interesting ways. Some + of the reports can help with finding certain kinds of errors, such as popular + keys without wiki pages.</p> + data_sources: Data<br/>Sources data_from: Data from @@ -38,6 +84,11 @@ map: Map maps: Maps key_combinations: Combinations +ui: + empty: + no_description_in_wiki: No description in wiki + unknown: Unknown + source: master: description: Aggregate statistics and miscellaneous data needed for the Taginfo user interface. @@ -52,3 +103,17 @@ source: merkaartor: description: Configuration data from the Merkaartor OSM editor. +reports: + characters_in_keys: + name: Characters in Keys + frequently_used_keys_without_wiki_page: + name: Frequently Used Keys Without Wiki Page + key_lengths: + name: Key Lengths + language_comparison_table_for_keys_in_the_wiki: + name: Language Comparison Table for Keys in the Wiki + languages: + name: Languages + wiki_pages_about_non_existing_keys: + name: Wiki Pages About Non-Existing Keys + diff --git a/web/lib/reports.rb b/web/lib/reports.rb index 0895359..dbb0182 100644 --- a/web/lib/reports.rb +++ b/web/lib/reports.rb @@ -25,7 +25,7 @@ class Report end def name - @title.gsub(/ /, '_').downcase + @title.gsub(/[\s-]/, '_').downcase end def url diff --git a/web/lib/ui/reports.rb b/web/lib/ui/reports.rb index d16877f..b35a19a 100644 --- a/web/lib/ui/reports.rb +++ b/web/lib/ui/reports.rb @@ -2,7 +2,7 @@ class Taginfo < Sinatra::Base get! '/reports' do - @title = 'Reports' + @title = t.taginfo.reports @breadcrumbs << @title erb :'reports/index' end @@ -10,8 +10,8 @@ class Taginfo < Sinatra::Base Report.each do |report| get report.url do @title = report.title - @breadcrumbs << [ 'Reports', '/reports' ] - @breadcrumbs << report.title + @breadcrumbs << [ t.taginfo.reports, '/reports' ] + @breadcrumbs << t.reports[report.name].name erb ('reports/' + report.name).to_sym end end diff --git a/web/taginfo.rb b/web/taginfo.rb index 2b88ee6..f4d7a1d 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -49,7 +49,6 @@ TAGCLOUD_NUMBER_OF_TAGS = 200 db = SQL::Database.new('../../data') -# XXX update this to use new sources table db.select('SELECT * FROM sources ORDER BY no').execute().each do |source| Source.new source['id'], source['name'], source['data_until'], source['update_start'], source['update_end'], source['visible'] == '1' end @@ -103,7 +102,7 @@ class Taginfo < Sinatra::Base @db = SQL::Database.new('../../data') - @data_until = @db.select("SELECT min(data_until) FROM master_meta").get_first_value().sub(/:..$/, '') + @data_until = @db.select("SELECT min(data_until) FROM sources").get_first_value().sub(/:..$/, '') @breadcrumbs = [] end @@ -128,18 +127,17 @@ class Taginfo < Sinatra::Base erb :index end - %w(about contact download keys).each do |page| + %w(about download keys).each do |page| get '/' + page do - @title = page.capitalize + @title = t.taginfo[page] @breadcrumbs << @title erb page.to_sym end end get! '/sources' do - @title = 'Sources' + @title = t.taginfo.sources @breadcrumbs << @title - @sources = @db.select('SELECT * FROM master_meta ORDER BY source_name').execute() erb :'sources/index' end @@ -157,8 +155,8 @@ class Taginfo < Sinatra::Base @key_json = @key.to_json @key_pp = pp_key(@key) - @title = [@key_html, 'Keys'] - @breadcrumbs << ['Keys', '/keys'] + @title = [@key_html, t.osm.keys] + @breadcrumbs << [t.osm.keys, '/keys'] @breadcrumbs << @key_html @filter_type = get_filter() @@ -168,7 +166,7 @@ class Taginfo < Sinatra::Base @count_all_values = @db.select("SELECT count_#{@filter_type} FROM db.keys").condition('key = ?', @key).get_first_value().to_i @desc = h(@db.select("SELECT description FROM wiki.wikipages WHERE lang='en' AND key=? AND value IS NULL", @key).get_first_value()) - @desc = '<i>no description in wiki</i>' if @desc == '' + @desc = "<i>#{ t.ui.empty.no_description_in_wiki }</i>" if @desc == '' @prevalent_values = @db.select("SELECT value, count_#{@filter_type} AS count FROM tags"). condition('key=?', @key). @@ -227,8 +225,8 @@ class Taginfo < Sinatra::Base @value_json = @value.to_json @value_pp = pp_value(@value) - @title = [@key_html + '=' + @value_html, 'Tags'] - @breadcrumbs << ['Keys', '/keys'] + @title = [@key_html + '=' + @value_html, t.taginfo.tags] + @breadcrumbs << [t.taginfo.keys, '/keys'] @breadcrumbs << [@key_html, '/keys/' + @key_uri] @breadcrumbs << ( @value.length > 30 ? escape_html(@value[0,20] + '...') : @value_html) @@ -239,7 +237,7 @@ class Taginfo < Sinatra::Base @count_all = @db.select('SELECT count_all FROM db.tags').condition('key = ? AND value = ?', @key, @value).get_first_value().to_i @desc = h(@db.select("SELECT description FROM wiki.wikipages WHERE lang='en' AND key=? AND value=?", @key, @value).get_first_value()) - @desc = '<i>no description in wiki</i>' if @desc == '' + @desc = "<i>#{ t.ui.empty.no_description_in_wiki }</i>" if @desc == '' erb :tag end diff --git a/web/views/download.erb b/web/views/download.erb index 3fc873f..ad35d94 100644 --- a/web/views/download.erb +++ b/web/views/download.erb @@ -1,17 +1,10 @@ -<h1>Download</h1> +<h1><%= t.taginfo.download %></h1> -<p>Here you can download the databases used by Taginfo. All the data is stored -in <img src="/img/link-extern.gif" alt=""/><a class="extlink" -href="http://www.sqlite.org/">Sqlite</a> databases. The database files are then -packed with <img src="/img/link-extern.gif" alt=""/><a class="extlink" -href="http://www.bzip.org/">bzip2</a>.</p> - -<p>If you don't want to download these databases, but need automated access to -the data, you can also use the <a href="/about">API</a>. +<%= t.pages.download.index.intro %> <table class="list"> <tr> - <th></th><th></th><th>File</th><th>Packed</th><th>Unpacked</th><th>Description</th><th></th> + <th></th><th></th><th><%= t.pages.download.index.file %></th><th><%= t.pages.download.index.packed %></th><th><%= t.pages.download.index.unpacked %></th><th><%= t.pages.download.index.description %></th><th></th> </tr> <% Source.visible.each do |source| %> <tr><td class="border"></td> @@ -24,7 +17,8 @@ the data, you can also use the <a href="/about">API</a>. <tr><td class="border"></td> <td style="text-align: center;"><img src="/img/taginfo.32.png" alt="Taginfo" width="32" height="16"/></td> <td><a href="/download/taginfo-master.db.bz2">taginfo-master.db.bz2</a></td> - <td style="text-align: right;"><%= File.size("../../download/taginfo-master.db.bz2").to_bytes rescue '<i>unknown</i>' %></td><td style="text-align: right;"><%= File.size("../../data/taginfo-master.db").to_bytes rescue '<i>unknown</i>' %></td> + <td style="text-align: right;"><%= File.size("../../download/taginfo-master.db.bz2").to_bytes rescue "<i>#{ t.ui.empty.unknown }</i>" %></td> + <td style="text-align: right;"><%= File.size("../../data/taginfo-master.db").to_bytes rescue "<i>#{ t.ui.empty.unknown }</i>" %></td> <td><%= t.source.master.description %></td> <td class="border"></td></tr> <tr><th colspan="7"/></tr> diff --git a/web/views/layout.erb b/web/views/layout.erb index ebbe352..35b008d 100644 --- a/web/views/layout.erb +++ b/web/views/layout.erb @@ -31,10 +31,10 @@ </div> </div> <div id="date"> - <%= t.data_from %>: <%= @data_until %> UTC <span class="button"><a href="/sources"><%= t.buttons.sources %></a></span> - <span class="button"><a href="/download"><%= t.buttons.download %></a></span> - <span class="button"><a href="/about"><%= t.buttons.about %></a></span> - <span class="button"><img src="/img/link-extern.gif" alt="" width="14" height="10"/><a href="http://wiki.openstreetmap.org/wiki/Taginfo"><%= t.buttons.wiki %></a></span> + <%= t.data_from %>: <%= @data_until %> UTC <span class="button"><a href="/sources"><%= t.taginfo.sources %></a></span> + <span class="button"><a href="/download"><%= t.taginfo.download %></a></span> + <span class="button"><a href="/about"><%= t.taginfo.about %></a></span> + <span class="button"><img src="/img/link-extern.gif" alt="" width="14" height="10"/><a href="http://wiki.openstreetmap.org/wiki/Taginfo"><%= t.taginfo.wiki %></a></span> </div> <div id="main"> <%= yield %> diff --git a/web/views/reports/index.erb b/web/views/reports/index.erb index 4af5c7d..fb1363e 100644 --- a/web/views/reports/index.erb +++ b/web/views/reports/index.erb @@ -1,18 +1,15 @@ -<h1>Reports</h1> +<h1><%= t.taginfo.reports %></h1> -<p class="text">Reports show the data from different perspectives. -They often bring together data from several sources in interesting ways. Some -of the reports can help with finding certain kinds of errors, such as popular -keys without wiki pages.</p> +<%= t.pages.reports.index.intro %> <table class="reports"> - <tr><th class="source" colspan="<%= Source.visible.size %>"/>Data<br/>Sources</th><th></th></tr> + <tr><th class="source" colspan="<%= Source.visible.size %>"/><%= t.pages.reports.index.data_sources %></th><th></th></tr> <% Report.each do |report| %> <tr> <% Source.visible.each do |source| %> <td class="source"><%= source.link_img if report.uses_source? source.id %></td> <% end %> - <td><a href="<%= report.url %>"><%= report.title %></a></td> + <td><a href="<%= report.url %>"><%= t.reports[report.name].name %></a></td> </tr> <% end %> <tr><th class="last" colspan="<%= Source.visible.size %>"/></th><th></th></tr> diff --git a/web/views/reports/wiki_pages_about_non-existing_keys.erb b/web/views/reports/wiki_pages_about_non_existing_keys.erb index 72b2197..72b2197 100644 --- a/web/views/reports/wiki_pages_about_non-existing_keys.erb +++ b/web/views/reports/wiki_pages_about_non_existing_keys.erb diff --git a/web/views/sources/index.erb b/web/views/sources/index.erb index e5493cc..2430b7a 100644 --- a/web/views/sources/index.erb +++ b/web/views/sources/index.erb @@ -1,14 +1,10 @@ -<h1>Sources</h1> +<h1><%= t.taginfo.sources %></h1> -<p>Taginfo takes data about OSM tags from several sources and brings them -together for easy browsing and discovery.</p> - -<p>Note that Taginfo only displays this data. If you want to change it, you -have to go back to the source.</p> +<%= t.pages.sources.index.intro %> <table class="list"> <tr> - <th></th><th>Source</th><th>Data until*</th><th>Last update run</th><th></th> + <th></th><th><%= t.taginfo.source %></th><th><%= t.pages.sources.index.data_until %>*</th><th><%= t.pages.sources.index.last_update_run %></th><th></th> </tr> <% Source.visible.each do |source| %> <tr> @@ -22,11 +18,6 @@ have to go back to the source.</p> <tr><th colspan="5"/></tr> </table> -<p style="font-size: 80%">* All edits until this time will be in the data, later edits might be.</p> - -<p>All times in UTC.</p> - -<p>Updates are currently done manually about once a week until they have proven -to work reliably. It is planned to switch to daily updates as soon as -possible.</p> +<p style="font-size: 80%">* <%= t.pages.sources.index.data_until_explanation %></p> +<%= t.pages.sources.index.info %> |