From 7ee6c8a6bf106b24787ae2352c9456911e1e8a56 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Sun, 18 May 2014 20:23:24 +0200 Subject: Make database statistics report fully translatable. --- web/i18n/de.yml | 16 +++++++++++++++ web/i18n/en.yml | 16 +++++++++++++++ web/public/css/taginfo.css | 5 +++++ web/views/reports/database_statistics.erb | 34 +++++++++++++++---------------- 4 files changed, 54 insertions(+), 17 deletions(-) diff --git a/web/i18n/de.yml b/web/i18n/de.yml index 9dc457e..b7658f9 100644 --- a/web/i18n/de.yml +++ b/web/i18n/de.yml @@ -392,6 +392,22 @@ reports: vielen Fällen sind sie aber das Ergebnis eines Fehlers.

database_statistics: name: Datenbank-Statistik + objects_in_db: Anzahl Objekte in der Datenbank + tags_in_db: Anzahl Tags in der Datenbank + distinct_keys: Anzahl unterschiedlicher Keys + distinct_tags: Anzahl unterschiedlicher Tags + nodes_in_db: Anzahl Nodes in der Datenbank + nodes_with_tags_in_db: Anzahl Nodes mit mindestens einem Tag + nodes_with_tags_in_db_percent: Anteil der Nodes mit mindestens einem Tag + tags_on_nodes: Anzahl Tags an Nodes + avg_tags_per_tagged_node: Durchschnittliche Anzahl Tags pro Node + ways_in_db: Anzahl Ways in der Datenbank + closed_ways_in_db: Anzahl geschlossener Ways + tags_on_ways: Anzahl Tags an Ways + avg_tags_per_way: Durchschnittliche Anzahl Tags pro Way + relations_in_db: Anzahl Relations in der Datenbank + tags_on_relations: Anzahl Tags an Relations + avg_tags_per_relation: Durchschnittliche Anzahl Tags pro Relation frequently_used_keys_without_wiki_page: name: Häufig benutzte Keys ohne Wiki-Seite intro: | diff --git a/web/i18n/en.yml b/web/i18n/en.yml index 9692b79..ac1563b 100644 --- a/web/i18n/en.yml +++ b/web/i18n/en.yml @@ -389,6 +389,22 @@ reports: in many cases they are just results of some error.

database_statistics: name: Database statistics + objects_in_db: Number of objects in the database + tags_in_db: Number of tags in the database + distinct_keys: Number of distinct keys + distinct_tags: Number of distinct tags + nodes_in_db: Number of nodes in the database + nodes_with_tags_in_db: Number of nodes with at least one tag + nodes_with_tags_in_db_percent: Percentage of nodes with at least one tag + tags_on_nodes: Number of tags on nodes + avg_tags_per_tagged_node: Average number of tags per tagged node + ways_in_db: Number of ways in the database + closed_ways_in_db: Number of closed ways + tags_on_ways: Number of tags on ways + avg_tags_per_way: Average number of tags per way + relations_in_db: Number of relations in the database + tags_on_relations: Number of tags on relations + avg_tags_per_relation: Average number of tags per relation frequently_used_keys_without_wiki_page: name: Frequently used keys without wiki page intro: | diff --git a/web/public/css/taginfo.css b/web/public/css/taginfo.css index f9a46e3..e207eb1 100644 --- a/web/public/css/taginfo.css +++ b/web/public/css/taginfo.css @@ -294,6 +294,10 @@ table.boxes td.box { border-radius: 4px; } +table.boxes td.box table { + width: 100%; +} + /* ========== */ div#tabs h2, div.box h2 { @@ -329,6 +333,7 @@ span.lang { td.number { text-align: right; + width: 8em; } span.char { diff --git a/web/views/reports/database_statistics.erb b/web/views/reports/database_statistics.erb index 6c101c6..232a37d 100644 --- a/web/views/reports/database_statistics.erb +++ b/web/views/reports/database_statistics.erb @@ -1,6 +1,6 @@

<%= h(t.reports.database_statistics.name) %>

- +
@@ -11,14 +11,14 @@ @@ -31,26 +31,26 @@ -- cgit v1.2.3

<%= h(t.osm.objects) %>

- - + +
There are <%= @db.stats('objects').to_s_with_ts %> objects in the database
with together <%= @db.stats('object_tags').to_s_with_ts %> tags
<%= t.reports.database_statistics.objects_in_db %>:<%= @db.stats('objects').to_s_with_ts %>
<%= t.reports.database_statistics.tags_in_db %>:<%= @db.stats('object_tags').to_s_with_ts %>
- - + +
There are <%= @db.stats('num_keys').to_s_with_ts %> different keys
and <%= @db.stats('num_tags').to_s_with_ts %> different tags
<%= t.reports.database_statistics.distinct_keys %>:<%= @db.stats('num_keys').to_s_with_ts %>
<%= t.reports.database_statistics.distinct_tags %>:<%= @db.stats('num_tags').to_s_with_ts %>
- - - - - + + + + +
There are <%= @db.stats('nodes').to_s_with_ts %> nodes
of which <%= @db.stats('nodes_with_tags').to_s_with_ts %> have at least one tag
(thats <%= (10000.0 * @db.stats('nodes_with_tags') / @db.stats('nodes')).to_i.to_f / 100 %> %)
with together <%= @db.stats('node_tags').to_s_with_ts %> tags
(or about <%= ( 100.0 * @db.stats('node_tags') / @db.stats('nodes_with_tags')).to_i.to_f / 100 %> tags per tagged node)
<%= t.reports.database_statistics.nodes_in_db %>:<%= @db.stats('nodes').to_s_with_ts %>
<%= t.reports.database_statistics.nodes_with_tags_in_db %>:<%= @db.stats('nodes_with_tags').to_s_with_ts %>
<%= t.reports.database_statistics.nodes_with_tags_in_db_percent %>:<%= (10000.0 * @db.stats('nodes_with_tags') / @db.stats('nodes')).to_i.to_f / 100 %>%
<%= t.reports.database_statistics.tags_on_nodes %>:<%= @db.stats('node_tags').to_s_with_ts %>
<%= t.reports.database_statistics.avg_tags_per_tagged_node %>:<%= ( 100.0 * @db.stats('node_tags') / @db.stats('nodes_with_tags')).to_i.to_f / 100 %>
- - - - + + + +
There are <%= @db.stats('ways').to_s_with_ts %> ways
(of which <%= @db.stats('closed_ways').to_s_with_ts %> are closed)
with together <%= @db.stats('way_tags').to_s_with_ts %> tags
(or about <%= ( 100.0 * @db.stats('way_tags') / @db.stats('ways')).to_i.to_f / 100 %> tags per way)
<%= t.reports.database_statistics.ways_in_db %>:<%= @db.stats('ways').to_s_with_ts %>
<%= t.reports.database_statistics.closed_ways_in_db %>:<%= @db.stats('closed_ways').to_s_with_ts %>
<%= t.reports.database_statistics.tags_on_ways %>:<%= @db.stats('way_tags').to_s_with_ts %>
<%= t.reports.database_statistics.avg_tags_per_way %>:<%= ( 100.0 * @db.stats('way_tags') / @db.stats('ways')).to_i.to_f / 100 %>
- - - + + +
There are <%= @db.stats('relations').to_s_with_ts %> relations
with together <%= @db.stats('relation_tags').to_s_with_ts %> tags
(or about <%= ( 100.0 * @db.stats('relation_tags') / @db.stats('relations')).to_i.to_f / 100 %> tags per relation)
<%= t.reports.database_statistics.relations_in_db %>:<%= @db.stats('relations').to_s_with_ts %>
<%= t.reports.database_statistics.tags_on_relations %>:<%= @db.stats('relation_tags').to_s_with_ts %>
<%= t.reports.database_statistics.avg_tags_per_relation %>:<%= ( 100.0 * @db.stats('relation_tags') / @db.stats('relations')).to_i.to_f / 100 %>