mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-13 19:04:22 +01:00
Get more i18n fixed in for he locale. Include fallback to en locale and include pluralization mechanism
This commit is contained in:
parent
8ea90504c6
commit
72dbc169ab
20 changed files with 1839 additions and 1703 deletions
|
|
@ -89,16 +89,16 @@ class ApplicationController < ActionController::Base
|
|||
# is count and a string descriptor, correctly pluralised if there are no
|
||||
# actions or multiple actions
|
||||
#
|
||||
def count_undone_todos_phrase(todos_parent, string="actions")
|
||||
def count_undone_todos_phrase(todos_parent)
|
||||
count = count_undone_todos(todos_parent)
|
||||
deferred_count = count_deferred_todos(todos_parent)
|
||||
if count == 0 && deferred_count > 0
|
||||
word = deferred_count == 1 ? string.singularize : string.pluralize
|
||||
word = "deferred " + word
|
||||
deferred_count.to_s + " " + word
|
||||
word = I18n.t('common.actions_midsentence', :count => deferred_count)
|
||||
word = I18n.t('common.deferred') + " " + word
|
||||
return deferred_count.to_s + " " + word
|
||||
else
|
||||
word = count == 1 ? string.singularize : string.pluralize
|
||||
count.to_s + " " + word
|
||||
word = I18n.t('common.actions_midsentence', :count => count)
|
||||
return count.to_s + " " + word
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -98,17 +98,17 @@ module ApplicationHelper
|
|||
# is count and a string descriptor, correctly pluralised if there are no
|
||||
# actions or multiple actions
|
||||
#
|
||||
def count_undone_todos_phrase(todos_parent, string="actions")
|
||||
@controller.count_undone_todos_phrase(todos_parent, string)
|
||||
def count_undone_todos_phrase(todos_parent)
|
||||
@controller.count_undone_todos_phrase(todos_parent)
|
||||
end
|
||||
|
||||
def count_undone_todos_phrase_text(todos_parent, string="actions")
|
||||
count_undone_todos_phrase(todos_parent, string).gsub(" "," ")
|
||||
def count_undone_todos_phrase_text(todos_parent)
|
||||
count_undone_todos_phrase(todos_parent).gsub(" "," ")
|
||||
end
|
||||
|
||||
def count_undone_todos_and_notes_phrase(project, string="actions")
|
||||
s = count_undone_todos_phrase(project, string)
|
||||
s += ", #{pluralize(project.note_count, 'note')}" unless project.note_count == 0
|
||||
def count_undone_todos_and_notes_phrase(project)
|
||||
s = count_undone_todos_phrase(project)
|
||||
s += ", #{t('common.note', :count => project.note_count)}" unless project.note_count == 0
|
||||
s
|
||||
end
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ module ApplicationHelper
|
|||
else
|
||||
return list.inject("") do |html, item|
|
||||
link = (item.class == "Project") ? link_to_project( item ) : link_to_context(item)
|
||||
html << content_tag(:li, link + " (" + count_undone_todos_phrase(item, I18n.t("common.actions_midsentence"))+")")
|
||||
html << content_tag(:li, link + " (" + count_undone_todos_phrase(item)+")")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ suppress_delete_button ||= false
|
|||
<%= suppress_edit_button ? "" : link_to_edit_context(context, image_tag( "blank.png", :title => t('contexts.edit_context'), :class=>"edit_item")) -%>
|
||||
<%= suppress_drag_handle ? "" : image_tag('grip.png', :width => '7', :height => '16', :border => '0', :title => t('common.drag_handle'), :class => 'grip')-%>
|
||||
<div class="context_description">
|
||||
<%= link_to_context( context ) %> <%= " (" + count_undone_todos_phrase(context,t('common.actions_midsentence')) + ")" %>
|
||||
<%= link_to_context( context ) %> <%= " (" + count_undone_todos_phrase(context) + ")" %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="<%= dom_id(context, 'edit') %>" class="edit-form" style="display:none;">
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
<% context = mobile_context_listing -%>
|
||||
<div id="ctx"><%= link_to context.name, context_path(context, :format => 'm') %><%= " (" + count_undone_todos_phrase(context,"actions") + ")" %></div>
|
||||
<div id="ctx"><%= link_to context.name, context_path(context, :format => 'm') %><%= " (" + count_undone_todos_phrase(context) + ")" %></div>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ suppress_delete_button ||= false
|
|||
<div class="project_description">
|
||||
<span class="<%= needsreview_class( project ) %>">
|
||||
<%= link_to_project( project ) %>
|
||||
<%= " (" + count_undone_todos_and_notes_phrase(project,t('common.actions_midsentence')) + ")" %>
|
||||
<%= " (" + count_undone_todos_and_notes_phrase(project) + ")" %>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</div>
|
||||
|
||||
<div class="container" id="completed_recurring_todos_container">
|
||||
<div class=add_note_link><%= link_to "Show all", done_recurring_todos_path%></div>
|
||||
<div class=add_note_link><%= link_to t('common.show_all'), done_recurring_todos_path%></div>
|
||||
<h2><%= t('common.last') %> <%= t('todos.completed_recurring') %></h2>
|
||||
<div id="completed_recurring_todos_container">
|
||||
<div id="completed-empty-nd" style="<%= @no_completed_recurring_todos ? 'display:block' : 'display:none'%>">
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@
|
|||
<%
|
||||
1.upto 5 do |i|
|
||||
%><%=i-%> -
|
||||
<%= i <= @actions_per_context.size ? link_to(@actions_per_context[i-1]['name'], {:controller => "contexts", :action => "show", :id => @actions_per_context[i-1]['id']}) : "n/a"%>
|
||||
<%= i <= @actions_per_context.size ?
|
||||
link_to(@actions_per_context[i-1]['name'], {:controller => "contexts", :action => "show", :id => @actions_per_context[i-1]['id']}) :
|
||||
t('common.not_available_abbr')%>
|
||||
(
|
||||
<%= i <= @actions_per_context.size ? @actions_per_context[i-1]['total'] : t('common.not_available_abbr')%>
|
||||
)
|
||||
|
|
@ -23,7 +25,9 @@
|
|||
<%
|
||||
1.upto 5 do |i|
|
||||
%><%=i-%> -
|
||||
<%= i <= @running_actions_per_context.size ? link_to(@running_actions_per_context[i-1]['name'], {:controller => "contexts", :action => "show", :id => @running_actions_per_context[i-1]['id']}) : "n/a"-%>
|
||||
<%= i <= @running_actions_per_context.size ?
|
||||
link_to(@running_actions_per_context[i-1]['name'], {:controller => "contexts", :action => "show", :id => @running_actions_per_context[i-1]['id']}) :
|
||||
t('common.not_available_abbr')-%>
|
||||
(
|
||||
<%= i <= @running_actions_per_context.size ? @running_actions_per_context[i-1]['total'] : t('common.not_available_abbr')-%>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<% i=0
|
||||
@projects_and_actions.each do |p|
|
||||
i+=1 -%>
|
||||
<%= i -%> - <%= link_to p.name, {:controller => "projects", :action => "show", :id => p.id}%> (<%=p.count %> <%= t('common.actions_midsentence') %>) <br/>
|
||||
<%= i -%> - <%= link_to p.name, {:controller => "projects", :action => "show", :id => p.id}%> (<%=p.count %> <%= t('common.actions_midsentence', :count => p.count) %>) <br/>
|
||||
<% end
|
||||
if i < 10
|
||||
i.upto 10 do |j| -%>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<% i=0
|
||||
@projects_and_actions_last30days.each do |p|
|
||||
i+=1 -%>
|
||||
<%= i -%> - <%= link_to p.name, {:controller => "projects", :action => "show", :id => p.id} %> (<%=p.count %> <%= t('common.actions_midsentence') %>) <br/>
|
||||
<%= i -%> - <%= link_to p.name, {:controller => "projects", :action => "show", :id => p.id} %> (<%=p.count %> <%= t('common.actions_midsentence', :count => p.count) %>) <br/>
|
||||
<% end
|
||||
if i < 10
|
||||
i.upto 10 do |j| -%>
|
||||
|
|
@ -33,6 +33,6 @@
|
|||
<% i=0
|
||||
@projects_and_runtime.each do |id, name, days|
|
||||
i+=1 -%>
|
||||
<%= i -%> - <%= link_to name, {:controller => "projects", :action => "show", :id => id} %> (<%=days %> <%= t('common.days_midsentence') %>) <br/>
|
||||
<%= i -%> - <%= link_to name, {:controller => "projects", :action => "show", :id => id} %> (<%=days %> <%= t('common.days_midsentence', :count => days) %>) <br/>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
<%= link_to t.name,
|
||||
{:controller => "todos", :action => "tag", :id => t.name},
|
||||
{:style => "font-size: " + (9 + 2*(t.count.to_i-@tags_min)/@tags_divisor).to_s + "pt",
|
||||
:title => t.count.to_s+" #{t('common.actions_midsentence')}"}
|
||||
:title => t.count.to_s+" #{t('common.actions_midsentence', :count => t.count)}"}
|
||||
-%> <%
|
||||
end
|
||||
end-%>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<%= link_to t.name,
|
||||
{:controller => "todos", :action => "tag", :id => t.name},
|
||||
{:style => "font-size: " + (9 + 2*(t.count.to_i-@tags_min_90days)/@tags_divisor_90days).to_s + "pt",
|
||||
:title => t.count.to_s+" #{t('common.actions_midsentence')}"}
|
||||
:title => t.count.to_s+" #{t('common.actions_midsentence', :count => t.count)}"}
|
||||
-%> <%
|
||||
end
|
||||
end-%>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div id="display_box">
|
||||
<div class="container">
|
||||
<div class=add_note_link><%= link_to "Show all", done_todos_path%></div>
|
||||
<div class=add_note_link><%= link_to t('common.show_all'), done_todos_path%></div>
|
||||
<h2>
|
||||
<%= t('common.last') %> <%= t('states.completed_plural' )%> <%= t('common.actions') %>
|
||||
</h2>
|
||||
|
|
@ -12,15 +12,15 @@
|
|||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class=add_note_link><%= link_to "Show all", done_projects_path%></div>
|
||||
<h2>
|
||||
<div class=add_note_link><%= link_to t('common.show_all'), done_projects_path%></div>
|
||||
<h2>
|
||||
<%= t('common.last') %> <%= t('states.completed_plural' )%> <%= t('common.projects') %>
|
||||
</h2>
|
||||
</h2>
|
||||
<% if @last_completed_projects.empty? -%>
|
||||
<div class="message"><p><%= t('projects.no_last_completed_projects') %></p></div>
|
||||
<% else -%>
|
||||
<div id="list-completed-projects" class="project-list">
|
||||
<%= render :partial => '/projects/project_listing',
|
||||
<%= render :partial => '/projects/project_listing',
|
||||
:collection => @last_completed_projects,
|
||||
:locals => {:suppress_drag_handle => true}
|
||||
%>
|
||||
|
|
@ -29,17 +29,15 @@
|
|||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class=add_note_link><%= link_to "Show all", done_recurring_todos_path%></div>
|
||||
<h2>
|
||||
<div class=add_note_link><%= link_to t('common.show_all'), done_recurring_todos_path%></div>
|
||||
<h2>
|
||||
<%= t('common.last') %> <%= t('states.completed_plural' )%> <%= t('common.recurring_todos') %>
|
||||
</h2>
|
||||
</h2>
|
||||
<% if @last_completed_recurring_todos.empty? -%>
|
||||
<div class="message"><p><%= t('projects.no_last_completed_recurring_todos') %></p></div>
|
||||
<% else -%>
|
||||
<%= render :partial => '/recurring_todos/recurring_todo', :collection => @last_completed_recurring_todos %>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!-- End of display_box -->
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
suppress_project ||= false
|
||||
-%>
|
||||
<div class="container completed" id="completed_container">
|
||||
<div class=add_note_link><%= link_to "Show all", determine_done_path%></div>
|
||||
<div class=add_note_link><%= link_to t('common.show_all'), determine_done_path%></div>
|
||||
<h2>
|
||||
<% if collapsible %>
|
||||
<a href="#" class="container_toggle" id="toggle_completed"><%= image_tag("collapse.png") %></a>
|
||||
|
|
@ -18,4 +18,4 @@
|
|||
|
||||
<%= render :partial => "todos/todo", :collection => completed, :locals => { :parent_container_type => "completed", :suppress_context => suppress_context, :suppress_project => suppress_project } %>
|
||||
</div>
|
||||
</div><!-- [end:next_actions] -->
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<%
|
||||
paginate_options = {
|
||||
:class => :add_note_link,
|
||||
:class => :add_note_link,
|
||||
:previous_label => '« '+ t('common.previous'),
|
||||
:next_label => t('common.next')+' »',
|
||||
:inner_window => 2
|
||||
|
|
@ -19,4 +19,4 @@
|
|||
|
||||
<%= will_paginate @done, paginate_options %>
|
||||
|
||||
</div><!-- End of display_box -->
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@
|
|||
<% end -%>
|
||||
</div>
|
||||
|
||||
<p>You can see all completed actions <%= link_to "here", determine_all_done_path %></p>
|
||||
<p><%= t('todos.see_all_completed', :link => link_to(t("todos.all_completed_here"), determine_all_done_path)) %></p>
|
||||
|
||||
</div><!-- End of display_box -->
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue