Changed code to support basic i18n.

Added RubyMine configuration and rvm setup to .gitignore.
This commit is contained in:
Marcus Ilgner 2010-10-31 21:27:13 +08:00 committed by Reinier Balt
parent 04faa5d408
commit fd3f69d927
99 changed files with 1157 additions and 601 deletions

View file

@ -13,7 +13,7 @@
<div id="c_<%=context.id%>_target" class="context_target drop_target"></div>
<div id="c<%= context.id %>items" class="items toggle_target">
<div id="c<%= context.id %>empty-nd" style="display:<%= @not_done.empty? ? 'block' : 'none'%>;">
<div class="message"><p>Currently there are no incomplete actions in this context</p></div>
<div class="message"><p><%= t 'contexts.no_actions' %></p></div>
</div>
<%= render :partial => "todos/todo", :collection => @not_done, :locals => { :parent_container_type => "context" } %>
</div><!-- [end:items] -->

View file

@ -14,11 +14,11 @@
<div class="widgets">
<button type="submit" class="positive" id="<%= dom_id(context, 'submit') %>" tabindex="15">
<%=image_tag("accept.png", :alt => "") %>
Update
<%= t 'common.update' %>
</button>
<a href="" onclick="" class="negative">
<%=image_tag("cancel.png", :alt => "") %>
Cancel
<%= t 'common.cancel' %>
</a>
</div>
</div>

View file

@ -1,7 +1,7 @@
<div class="list-stategroup-contexts-container">
<h2><span id="<%= state %>-contexts-count" class="badge"><%= context_state_group.length %></span><%= state.titlecase %> Contexts</h2>
<h2><span id="<%= state %>-contexts-count" class="badge"><%= context_state_group.length %></span><%= state.titlecase %> <%= t('common.contexts') %></h2>
<div id="<%= state%>-contexts-empty-nd" style="<%= no_contexts ? 'display:block' : 'display:none'%>">
<div class="message"><p>Currently there are no <%= state %> contexts</p></div>
<div class="message"><p><%= t('contexts.no_contexts', :state => state) %></p></div>
</div>
<div id="list-contexts-<%= state %>">
<%= render :partial => 'context_listing', :collection => context_state_group %>

View file

@ -3,4 +3,4 @@ page.delay(0.5) do
page[dom_id(@context, "container")].remove
end
page['badge_count'].replace_html @down_count
page.notify :notice, "Deleted context '#{@context.name}'", 5.0
page.notify :notice, t('contexts.context_deleted', :name=>@context.name), 5.0

View file

@ -1 +1 @@
page.notify :error, @error_message || "An error occurred on the server.", 8.0
page.notify :error, @error_message || t('common.server_error'), 8.0

View file

@ -7,7 +7,7 @@
<div id="context_new_container">
<div id="toggle_context_new" class="hide_form">
<a title="Hide new context form" accesskey="n">&laquo; Hide form</a>
<a title="<%= t('contexts.hide_form_link_title') %>" accesskey="n">&laquo; <%= t('contexts.hide_form') %></a>
</div>
<div id="context_new" class="context_new" style="display:block">
@ -20,16 +20,16 @@
<div id="status"><%= error_messages_for('context') %></div>
<label for="context_name">Context name</label><br />
<label for="context_name"><%= t 'contexts.context_name' %></label><br />
<%= text_field( "context", "name" ) %><br />
<label for="context_hide">Hide from front page?</label>
<label for="context_hide"><%= t 'contexts.context_hide' %></label>
<%= check_box( "context", "hide" ) %><br />
<div class="submit_box">
<div class="widgets">
<button type="submit" class="positive" id="context_new_submit">
<%= image_tag("accept.png", :alt => "") + 'Add Context' %>
<%= image_tag("accept.png", :alt => "") + t('contexts.add_context') %>
</button>
</div>
</div>

View file

@ -1,5 +1,5 @@
<% current_user.contexts.each do |c| -%>
<%= c.name.upcase %>
<%= count_undone_todos_phrase_text(c)%>. Context is <%= c.hidden? ? "Hidden" : "Active" %>.
<%= count_undone_todos_phrase_text(c)%>. <%= c.hidden? ? t('contexts.status_hidden') : t('contexts.status_active') %>.
<% end -%>

View file

@ -1,2 +1,2 @@
<h2>Visible Contexts</h2><%= render :partial => 'mobile_context_listing', :collection => @active_contexts %>
<h2>Hidden Contexts</h2><%= render :partial => 'mobile_context_listing', :collection => @hidden_contexts %>
<h2><%= t('contexts.visible_contexts') %></h2><%= render :partial => 'mobile_context_listing', :collection => @active_contexts %>
<h2><%= t('contexts.hidden_contexts') %></h2><%= render :partial => 'mobile_context_listing', :collection => @hidden_contexts %>

View file

@ -1,7 +1,7 @@
<div id="display_box">
<%= render :partial => "contexts/context", :locals => { :context => @context, :collapsible => false } %>
<% unless @max_completed==0 -%>
<%= render :partial => "todos/completed", :locals => { :done => @done, :suppress_context => true, :collapsible => false, :append_descriptor => "in this context (last #{prefs.show_number_completed})" } %>
<%= render :partial => "todos/completed", :locals => { :done => @done, :suppress_context => true, :collapsible => false, :append_descriptor => t('contexts.last_completed_in_context', :number=>prefs.show_number_completed) } %>
<% end -%>
</div><!-- [end:display_box] -->

View file

@ -1,4 +1,4 @@
status_message = 'Context saved'
status_message = t('contexts.save_status_message')
page.notify :notice, status_message, 5.0
if @context_state_changed
page.remove dom_id(@context, 'container')

View file

@ -4,5 +4,5 @@ page['todo_context_name'].value = @context.name
# renew context auto complete array
page << "contextAutoCompleter.options.array = #{context_names_for_autocomplete}; contextAutoCompleter.changed = true"
status_message = "Name of context was changed"
status_message = t('contexts.update_status_message')
page.notify :notice, status_message, 5.0