Rationalize browse translation keys

This commit is contained in:
John Firebaugh 2013-11-12 12:51:33 -08:00
parent 1757a5a789
commit e670da54cb
17 changed files with 90 additions and 114 deletions

View file

@ -59,10 +59,10 @@ module BrowseHelper
def type_and_paginated_count(type, pages)
if pages.page_count == 1
t "browse.changeset_details.#{type}",
t "browse.changeset.#{type}",
:count => pages.item_count
else
t "browse.changeset_details.#{type}_paginated",
t "browse.changeset.#{type}_paginated",
:x => pages.current_page.first_item,
:y => pages.current_page.last_item,
:count => pages.item_count

View file

@ -5,20 +5,20 @@ module ChangesetHelper
closed_at = distance_of_time_in_words_to_now(changeset.closed_at)
date = ''
if changeset.closed_at > DateTime.now
date << t('browse.changeset_details.created_at') + ' '
date << content_tag(:abbr, t('browse.changeset_details.ago', :ago => created_at), title: l(changeset.created_at))
date << t('browse.created') + ' '
date << content_tag(:abbr, t('browse.ago', :ago => created_at), title: l(changeset.created_at))
else
date << t('browse.changeset_details.closed_at') + ' '
both_times = t('browse.changeset_details.created_at') + ': ' + l(changeset.created_at)
date << t('browse.closed') + ' '
both_times = t('browse.created') + ': ' + l(changeset.created_at)
both_times << '&#10;'
both_times << t('browse.changeset_details.closed_at') + ': ' + l(changeset.closed_at)
date << content_tag(:abbr, t('browse.changeset_details.ago', :ago => created_at), title: both_times.html_safe)
both_times << t('browse.closed') + ': ' + l(changeset.closed_at)
date << content_tag(:abbr, t('browse.ago', :ago => created_at), title: both_times.html_safe)
end
out << content_tag(:span, date.html_safe, class: 'date')
unless params.key?(:display_name)
userspan = ''
if changeset.user.data_public?
userspan << ' ' + t('browse.changeset_details.by') + ' '
userspan << ' ' + t('browse.by') + ' '
if changeset.user.data_public?
user = link_to changeset.user.display_name, user_path(changeset.user.display_name)
else

View file

@ -2,30 +2,30 @@
<% if common_details.changeset.tags['comment'].present? %>
<%= linkify(h(common_details.changeset.tags['comment'])) %>
<% else %>
<%= t 'browse.changeset_details.no_comment' %>
<%= t 'browse.no_comment' %>
<% end %>
</h4>
<div class="details">
<% if common_details.visible? %>
<%= t 'browse.common_details.edited' %>
<%= t 'browse.edited' %>
<% else %>
<%= t 'browse.common_details.deleted' %>
<%= t 'browse.deleted' %>
<% end %>
<abbr><%= distance_of_time_in_words_to_now(common_details.timestamp) %> ago</abbr>
<% if common_details.changeset.user.data_public? %>
<%= t 'browse.common_details.by' %>
<%= t 'browse.by' %>
<%= link_to h(common_details.changeset.user.display_name), :controller => "user", :action => "view", :display_name => common_details.changeset.user.display_name %>
<% end %>
</div>
<div class="details">
<%= t 'browse.common_details.version' %>
<%= t 'browse.version' %>
#<%= h(common_details.version) %>
&middot;
<%= t 'browse.common_details.in_changeset' %>
<%= t 'browse.in_changeset' %>
#<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %>
</div>

View file

@ -9,7 +9,7 @@
<%= render :partial => "common_details", :object => node_details %>
<% unless node_details.ways.empty? and node_details.containing_relation_members.empty? %>
<h4><%= t 'browse.node_details.part_of' %></h4>
<h4><%= t 'browse.part_of' %></h4>
<ul>
<% node_details.ways.each do |way| %>
<li><%= link_to h(printable_name(way)), { :action => "way", :id => way.id.to_s }, :class => link_class('way', way), :title => link_title(way) %></li>

View file

@ -9,12 +9,12 @@
<%= render :partial => "common_details", :object => relation_details %>
<% unless relation_details.relation_members.empty? %>
<h4><%= t'browse.relation_details.members' %></h4>
<h4><%= t'browse.relation.members' %></h4>
<ul><%= render :partial => "relation_member", :collection => relation_details.relation_members %></ul>
<% end %>
<% unless relation_details.containing_relation_members.empty? %>
<h4><%= t'browse.relation_details.part_of' %></h4>
<h4><%= t'browse.part_of' %></h4>
<ul><%= render :partial => "containing_relation", :collection => relation_details.containing_relation_members %></ul>
<% end %>
<% end %>

View file

@ -9,14 +9,14 @@
<%= render :partial => "common_details", :object => way_details %>
<% unless way_details.way_nodes.empty? %>
<h4><%= t'browse.way_details.nodes' %></h4>
<h4><%= t'browse.way.nodes' %></h4>
<ul>
<% way_details.way_nodes.each do |wn| %>
<li>
<%= link_to h(printable_name(wn.node)), { :action => "node", :id => wn.node_id.to_s }, :class => link_class('node', wn.node), :title => link_title(wn.node) %>
<% related_ways = wn.node.ways.reject { |w| w.id == wn.way_id } %>
<% if related_ways.size > 0 then %>
(<%= raw t 'browse.way_details.also_part_of', :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(h(printable_name(w)), { :action => "way", :id => w.id.to_s }, :class => link_class('way', w), :title => link_title(w) ) }.to_sentence %>)
(<%= raw t 'browse.way.also_part_of', :count => related_ways.size, :related_ways => related_ways.map { |w| link_to(h(printable_name(w)), { :action => "way", :id => w.id.to_s }, :class => link_class('way', w), :title => link_title(w) ) }.to_sentence %>)
<% end %>
</li>
<% end %>
@ -24,7 +24,7 @@
<% end %>
<% unless way_details.containing_relation_members.empty? %>
<h4><%= t'browse.way_details.part_of' %></h4>
<h4><%= t'browse.part_of' %></h4>
<ul>
<%= render :partial => "containing_relation", :collection => way_details.containing_relation_members %>
</ul>

View file

@ -6,7 +6,7 @@
</h2>
<div class="browse-section">
<h4><%= @changeset.tags['comment'].to_s.presence || t('browse.changeset_details.no_comment') %></h4>
<h4><%= @changeset.tags['comment'].to_s.presence || t('browse.no_comment') %></h4>
<div class="details"><%= changeset_details(@changeset) %></div>
<%= render :partial => "tag_details", :object => @changeset.tags.except('comment') %>

View file

@ -11,7 +11,7 @@
<%= render :partial => "node_details", :object => @node %>
<div class='secondary-actions'>
<%= link_to(t('browse.node.download_xml'), :controller => "node", :action => "read") %>
<%= link_to(t('browse.download_xml'), :controller => "node", :action => "read") %>
&middot;
<%= link_to(t('browse.node.view_history'), :action => "node_history") %>
<%= link_to(t('browse.view_history'), :action => "node_history") %>
</div>

View file

@ -1,11 +1,11 @@
<%
@name = printable_name @node
set_title(t('browse.node_history.node_history') + ' | ' + @name)
set_title(t('browse.node.node_history') + ' | ' + @name)
%>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= raw t'browse.node_history.node_history_title', :node_name => link_to(h(@name), :action => "node", :id => @node.id) %>
<%= raw t'browse.node.node_history_title', :node_name => link_to(h(@name), :action => "node", :id => @node.id) %>
</h2>
<% @node.old_nodes.reverse.each do |node| %>
@ -13,7 +13,7 @@
<% end %>
<div class='secondary-actions'>
<%= link_to(t('browse.node_history.download_xml'), :controller => "old_node", :action => "history") %>
<%= link_to(t('browse.download_xml'), :controller => "old_node", :action => "history") %>
&middot;
<%= link_to(t('browse.node_history.view_details'), :action => "node") %>
<%= link_to(t('browse.view_details'), :action => "node") %>
</div>

View file

@ -11,7 +11,7 @@
<%= render :partial => "relation_details", :object => @relation %>
<div class='secondary-actions'>
<%= link_to(t('browse.relation.download_xml'), :controller => "relation", :action => "read") %>
<%= link_to(t('browse.download_xml'), :controller => "relation", :action => "read") %>
&middot;
<%= link_to(t('browse.relation.view_history'), :action => "relation_history") %>
<%= link_to(t('browse.view_history'), :action => "relation_history") %>
</div>

View file

@ -1,11 +1,11 @@
<%
@name = printable_name @relation
set_title(t('browse.relation_history.relation_history') + ' | ' + @name)
set_title(t('browse.relation.relation_history') + ' | ' + @name)
%>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= raw t'browse.relation_history.relation_history_title', :relation_name => link_to(h(@name), :action => "relation", :id => @relation.id) %>
<%= raw t'browse.relation.relation_history_title', :relation_name => link_to(h(@name), :action => "relation", :id => @relation.id) %>
</h2>
<% @relation.old_relations.reverse.each do |relation| %>
@ -13,7 +13,7 @@
<% end %>
<div class='secondary-actions'>
<%= link_to(t('browse.relation_history.download_xml'), :controller => "old_relation", :action => "history") %>
<%= link_to(t('browse.download_xml'), :controller => "old_relation", :action => "history") %>
&middot;
<%= link_to(t('browse.relation_history.view_details'), :action => "relation") %>
<%= link_to(t('browse.view_details'), :action => "relation") %>
</div>

View file

@ -11,7 +11,7 @@
<%= render :partial => "way_details", :object => @way %>
<div class='secondary-actions'>
<%= link_to(t('browse.way.download_xml'), :controller => "way", :action => "read") %>
<%= link_to(t('browse.download_xml'), :controller => "way", :action => "read") %>
&middot;
<%= link_to(t('browse.way.view_history'), :action => "way_history") %>
<%= link_to(t('browse.view_history'), :action => "way_history") %>
</div>

View file

@ -1,11 +1,11 @@
<%
@name = printable_name @way
set_title(t('browse.way_history.way_history') + ' | ' + @name)
set_title(t('browse.way.way_history') + ' | ' + @name)
%>
<h2>
<a class="geolink" href="<%= root_path %>"><span class="icon close"></span></a>
<%= raw t'browse.way_history.way_history_title', :way_name => link_to(h(@name), :action => "way", :id => @way.id) %>
<%= raw t'browse.way.way_history_title', :way_name => link_to(h(@name), :action => "way", :id => @way.id) %>
</h2>
<% @way.old_ways.reverse.each do |way| %>
@ -13,7 +13,7 @@
<% end %>
<div class='secondary-actions'>
<%= link_to(t('browse.way_history.download_xml'), :controller => "old_way", :action => "history") %>
<%= link_to(t('browse.download_xml'), :controller => "old_way", :action => "history") %>
&middot;
<%= link_to(t('browse.way_history.view_details'), :action => "way") %>
<%= link_to(t('browse.view_details'), :action => "way") %>
</div>

View file

@ -18,7 +18,7 @@
<% if changeset.tags['comment'].to_s != '' %>
<%= linkify(h(changeset.tags['comment'])) %>
<% else %>
<%= t 'changeset.changeset.no_comment' %>
<%= t 'browse.no_comment' %>
<% end %>
</a>
</h4>

View file

@ -40,16 +40,16 @@ atom_feed(:language => I18n.locale, :schema_date => 2009,
xhtml.style "th { text-align: left } tr { vertical-align: top }"
xhtml.table do |table|
table.tr do |tr|
tr.th t("browse.changeset_details.created_at")
tr.th t("browse.created")
tr.td l(changeset.created_at)
end
table.tr do |tr|
tr.th t("browse.changeset_details.closed_at")
tr.th t("browse.closed")
tr.td l(changeset.closed_at)
end
if changeset.user.data_public?
table.tr do |tr|
tr.th t("browse.changeset_details.belongs_to")
tr.th t("browse.changeset.belongs_to")
tr.td do |td|
td.a h(changeset.user.display_name), :href => url_for(:controller => "user", :action => "view", :display_name => changeset.user.display_name, :only_path => false)
end

View file

@ -24,7 +24,7 @@
<% changeset = contact.changesets.first %>
<% if changeset %>
<%= t('user.view.latest edit', :ago => t('user.view.ago', :time_in_words_ago => time_ago_in_words(changeset.created_at))) %>
<% comment = changeset.tags['comment'].to_s != '' ? changeset.tags['comment'] : t('changeset.changeset.no_comment') %>
<% comment = changeset.tags['comment'].to_s != '' ? changeset.tags['comment'] : t('browse.no_comment') %>
"<%= link_to(comment,
{:controller => 'browse', :action => 'changeset', :id => changeset.id},
{:title => t('changeset.changeset.view_changeset_details')})

View file

@ -95,17 +95,22 @@ en:
name: "Remote Control"
description: "Remote Control (JOSM or Merkaartor)"
browse:
created: "Created"
edited: "Edited"
closed: "Closed"
deleted: "Deleted"
by: "by"
ago: "%{ago} ago"
version: "Version"
in_changeset: "Changeset"
no_comment: "(no comment)"
part_of: "Part of"
download_xml: "Download XML"
view_history: "View history"
view_details: "View details"
changeset:
title: "Changeset"
changeset: "Changeset %{id}"
changesetxml: "Changeset XML"
osmchangexml: "osmChange XML"
feed:
title: "Changeset %{id}"
title_comment: "Changeset %{id} - %{comment}"
changeset_details:
created_at: "Created"
closed_at: "Closed"
belongs_to: "Author"
node: "Nodes (%{count})"
node_paginated: "Nodes (%{x}-%{y} of %{count})"
@ -113,32 +118,41 @@ en:
way_paginated: "Ways (%{x}-%{y} of %{count})"
relation: "Relations (%{count})"
relation_paginated: "Relations (%{x}-%{y} of %{count})"
no_comment: "(no comment)"
ago: "%{ago} ago"
by: "by"
common_details:
edited: "Edited"
deleted: "Deleted"
by: "by"
version: "Version"
in_changeset: "Changeset"
changeset_comment: "Comment"
containing_relation:
entry: "Relation %{relation_name}"
entry_role: "Relation %{relation_name} (as %{relation_role})"
node_details:
part_of: "Part of"
node_history:
node_history: "Node History"
node_history_title: "Node History: %{node_name}"
download_xml: "Download XML"
view_details: "View details"
changesetxml: "Changeset XML"
osmchangexml: "osmChange XML"
feed:
title: "Changeset %{id}"
title_comment: "Changeset %{id} - %{comment}"
node:
node: "Node"
node_title: "Node: %{node_name}"
download_xml: "Download XML"
view_history: "View history"
edit: "Edit node"
node_history: "Node History"
node_history_title: "Node History: %{node_name}"
way:
way: "Way"
way_title: "Way: %{way_name}"
way_history: "Way History"
way_history_title: "Way History: %{way_name}"
nodes: "Nodes"
also_part_of:
one: "part of way %{related_ways}"
other: "part of ways %{related_ways}"
relation:
relation: "Relation"
relation_title: "Relation: %{relation_name}"
relation_history: "Relation History"
relation_history_title: "Relation History: %{relation_name}"
members: "Members"
relation_member:
entry: "%{type} %{name}"
entry_role: "%{type} %{name} as %{role}"
type:
node: "Node"
way: "Way"
relation: "Relation"
containing_relation:
entry: "Relation %{relation_name}"
entry_role: "Relation %{relation_name} (as %{relation_role})"
not_found:
sorry: "Sorry, %{type} #%{id} could not be found."
type:
@ -160,26 +174,6 @@ en:
node: "node"
way: "way"
relation: "relation"
relation_details:
members: "Members"
part_of: "Part of"
relation_history:
relation_history: "Relation History"
relation_history_title: "Relation History: %{relation_name}"
download_xml: "Download XML"
view_details: "View details"
relation_member:
entry: "%{type} %{name}"
entry_role: "%{type} %{name} as %{role}"
type:
node: "Node"
way: "Way"
relation: "Relation"
relation:
relation: "Relation"
relation_title: "Relation: %{relation_name}"
download_xml: "Download XML"
view_history: "View history"
start_rjs:
loaded_an_area_with_num_features: "Loading %{num_features} features, which may make your browser slow or unresponsive. Are sure you want to display this data?"
load_data: "Load Data"
@ -191,23 +185,6 @@ en:
key: "The wiki description page for the %{key} tag"
tag: "The wiki description page for the %{key}=%{value} tag"
wikipedia_link: "The %{page} article on Wikipedia"
way_details:
nodes: "Nodes"
part_of: "Part of"
also_part_of:
one: "part of way %{related_ways}"
other: "part of ways %{related_ways}"
way_history:
way_history: "Way History"
way_history_title: "Way History: %{way_name}"
download_xml: "Download XML"
view_details: "View details"
way:
way: "Way"
way_title: "Way: %{way_name}"
download_xml: "Download XML"
view_history: "View history"
edit: "Edit way"
note:
title: "Note"
new_note: "New Note"
@ -236,7 +213,6 @@ en:
previous: "« Previous"
changeset:
anonymous: "Anonymous"
no_comment: "(no comment)"
no_edits: "(no edits)"
view_changeset_details: "View changeset details"
changesets: