[#1840] Completed the i18n string support.

Thanks to Pau Garcia i Quiles for the patch
This commit is contained in:
Eric Davis
2009-04-27 13:31:47 -07:00
parent 7ed5c20a93
commit e218218ffb
11 changed files with 110 additions and 46 deletions

View File

@@ -1,10 +1,10 @@
<h2 class="title">Budget</h2>
<h2 class="title"><%= l(:budget_title) %></h2>
<table>
<% if allowed_management? %>
<tr>
<td>
Total Budget:
<%= l(:field_budget) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.budget, :precision => 0) %>
@@ -15,7 +15,7 @@
<% if allowed_management? %>
<tr>
<td>
Labor Budget:
<%= l(:label_labor_budget) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.labor_budget, :precision => 0) %>
@@ -26,7 +26,7 @@
<% if allowed_management? %>
<tr>
<td>
Labor Budget Spent:
<%= l(:label_labor_budget_spent) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.spent, :precision => 0) %>
@@ -37,7 +37,7 @@
<% if allowed_management? %>
<tr>
<td>
Labor Budget Remaining:
<%= l(:label_labor_budget_remaining) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.labor_budget_left, :precision => 0) %>
@@ -47,7 +47,7 @@
<tr>
<td>
Progress:
<%= l(:label_progress) %>
</td>
<td class="calculation-column">
<%= h number_to_percentage(budget.progress, :precision => 0) %>
@@ -57,7 +57,7 @@
<% if allowed_management? %>
<tr>
<td>
Budget Score:
<%= l(:label_budget_score) %>
</td>
<td class="calculation-column">
<%= h budget.score %>
@@ -68,7 +68,7 @@
<% if allowed_management? %>
<tr>
<td>
Overruns:
<%= l(:label_overruns) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.overruns, :precision => 0) %>
@@ -79,7 +79,7 @@
<% if allowed_management? && budget.amount_missing_on_deliverables > 0%>
<tr>
<td>
Missing on <%= link_to('Deliverables:', :action => 'issues', :id => @project.id, :deliverable_id => :none) %>
<%= l(:label_missing_on) %> <%= link_to('Deliverables:', :action => 'issues', :id => @project.id, :deliverable_id => :none) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.amount_missing_on_deliverables, :precision => 0) %>
@@ -90,7 +90,7 @@
<% if allowed_management? && budget.amount_missing_on_issues > 0 %>
<tr>
<td>
Missing on <%= link_to('Issues:',
<%= l(:label_missing_on) %> <%= link_to('Issues:',
:controller => 'timelog',
:action => 'details',
:project_id => @project.id,
@@ -106,7 +106,7 @@
<tr>
<td>
Next Due Date:
<%= l(:label_next_due_date) %>
</td>
<td class="calculation-column">
<%= h distance_of_time_in_words_to_now(budget.next_due_date) if budget.next_due_date %>
@@ -114,7 +114,7 @@
</tr>
<tr>
<td>
Completion:
<%= l(:label_completion) %>
</td>
<td class="calculation-column">
<%= h distance_of_time_in_words_to_now(budget.final_due_date) if budget.final_due_date %>
@@ -124,7 +124,7 @@
<% if allowed_management? %>
<tr>
<td>
Potential Profit:
<%= l(:label_potential_profit) %>
</td>
<td class="calculation-column">
<%= h number_to_currency(budget.profit, :precision => 0) %>

View File

@@ -14,15 +14,15 @@
</tr>
<tr id="deliverable-details-<%= deliverable.id %>" class="deliverable deliverable-details <%= css %>" style="display:none;">
<td class="deliverable-actions">
<%= content_tag(:p,link_to("Edit", :action => 'edit', :id => @project.id, :deliverable_id => deliverable.id)) if allowed_management? -%>
<%= content_tag(:p,link_to("Delete", { :action => 'destroy', :id => @project.id, :deliverable_id => deliverable.id}, :confirm => l(:text_are_you_sure))) if allowed_management? %>
<%= content_tag(:p,link_to("Issues", :action => 'issues', :id => @project.id, :deliverable_id => deliverable.id)) -%>
<%= content_tag(:p,link_to(l(:button_edit), :action => 'edit', :id => @project.id, :deliverable_id => deliverable.id)) if allowed_management? -%>
<%= content_tag(:p,link_to(l(:button_delete), { :action => 'destroy', :id => @project.id, :deliverable_id => deliverable.id}, :confirm => l(:text_are_you_sure))) if allowed_management? %>
<%= content_tag(:p,link_to(l(:label_issue_plural), :action => 'issues', :id => @project.id, :deliverable_id => deliverable.id)) -%>
<% if allowed_management? && @project.versions.size > 0 %>
<div>
<% form_for :deliverable, deliverable, :url => { :action => "bulk_assign_issues", :id => @project.id, :deliverable_id => deliverable.id} do |f| %>
<%= select("version", "id", @project.versions.sort.collect {|v| [v.name, v.id ] }, { :prompt => '-- Version --' }) %><br />
<%= submit_tag("Bulk Assign") %>
<%= submit_tag(l(:label_bulk_assign)) %>
<% end %>
</div>
<% end %>
@@ -30,18 +30,18 @@
<td colspan="2">
<table class="progress-table">
<%= row_with_double_data "Progress: ", number_to_percentage(deliverable.progress, :precision => 0), '' %>
<%= row_with_double_data l(:label_progress), number_to_percentage(deliverable.progress, :precision => 0), '' %>
<% if allowed_management? %>
<% if deliverable.hourly? %>
<%= row_with_double_data "Hours Estimated: ", number_with_precision(deliverable.total_hours, 0), '' %>
<%= row_with_double_data l(:label_hours_estimated), number_with_precision(deliverable.total_hours, 0), '' %>
<% end %>
<% if deliverable.fixed? %>
<%= row_with_double_data "Fixed Amount: ", '', number_to_currency(deliverable.fixed_cost, :precision => 0) %>
<%= row_with_double_data l(:label_fixed_amount), '', number_to_currency(deliverable.fixed_cost, :precision => 0) %>
<% end %>
<% if deliverable.hours_used > 0 %>
<%= row_with_double_data "Hours Used: ", number_with_precision(deliverable.hours_used,0), number_to_currency(deliverable.spent_by_members, :precision => 0) %>
<%= row_with_double_data l(:label_hours_used), number_with_precision(deliverable.hours_used,0), number_to_currency(deliverable.spent_by_members, :precision => 0) %>
<tr><td>&nbsp;</td></tr>
@@ -55,13 +55,13 @@
<td colspan="3">
<table class="financials">
<%= row_with_data("Total Budget: ", number_to_currency(deliverable.budget, :precision => 0)) -%>
<%= row_with_data(l(:field_budget), number_to_currency(deliverable.budget, :precision => 0)) -%>
<% if allowed_management? %>
<% base_price_label = deliverable.hourly? ? "Labor: " : "Fixed Amount: " %>
<% base_price_label = deliverable.hourly? ? l(:label_labor) : l(:label_fixed_amount) %>
<%= row_with_data(base_price_label, number_to_currency(deliverable.labor_budget || 0.0, :precision => 0)) -%>
<%= row_with_data("Overhead: ", number_or_percent(deliverable.overhead, deliverable.overhead_percent)) -%>
<%= row_with_data("Materials: ", number_or_percent(deliverable.materials, deliverable.materials_percent)) -%>
<%= row_with_data("Potential Profit: ", number_or_percent(deliverable.profit, deliverable.profit_percent)) -%>
<%= row_with_data(l(:label_overhead), number_or_percent(deliverable.overhead, deliverable.overhead_percent)) -%>
<%= row_with_data(l(:label_materials), number_or_percent(deliverable.materials, deliverable.materials_percent)) -%>
<%= row_with_data(l(:label_potential_profit), number_or_percent(deliverable.profit, deliverable.profit_percent)) -%>
<% end %>
</table>
</td>

View File

@@ -19,7 +19,7 @@
<tr>
<td>
<label for="deliverable_type">Fixed Cost</label>
<label for="deliverable_type"><%= l(:label_fixed_cost) %></label>
</td>
<td>
<%= check_box(:deliverable, :type, {}, FixedDeliverable.name, HourlyDeliverable.name) %>
@@ -31,7 +31,7 @@
<tr class="budget-hourly">
<td>
<label for="deliverable_cost_per_hour">Cost per hour</label>
<label for="deliverable_cost_per_hour"><%= l(:field_cost_per_hour)%></label>
</td>
<td>
<%= text_field :deliverable, :cost_per_hour, :size => 7 %>
@@ -42,7 +42,7 @@
<tr class="budget-hourly">
<td>
<label for="deliverable_total_hours">Total Hours</label>
<label for="deliverable_total_hours"><%= l(:field_total_hours) %></label>
</td>
<td>
<%= text_field :deliverable, :total_hours, :size => 7 %>
@@ -54,7 +54,7 @@
<tr class="budget-fixed" style="display:none;">
<td>
<label for="deliverable_fixed_cost">Fixed Bid</label>
<label for="deliverable_fixed_cost"><%= l(:field_fixed_cost) %></label>
</td>
<td>
<%= text_field :deliverable, :fixed_cost, :size => 7 %>
@@ -69,7 +69,7 @@
<%= field_with_budget_observer_and_totals(f, @deliverable, :profit, :profit_percent, @settings[:budget_profit]) %>
<tr class="total-budget">
<td><label>Total Budget:</label></td>
<td><label><%= l(:field_budget) %></label></td>
<td></td>
<td class="calculation-column">
<%= content_tag(:span, 0, :id => 'total-budget-calculation', :class => "budget-calculation") %>

View File

@@ -2,12 +2,12 @@
<thead><tr>
<%= content_tag('th', " ") %>
<%= sort_header_tag("#{Deliverable.table_name}.id", :caption => '#', :default_order => 'desc') %>
<%= sort_header_tag("score", :caption => 'Score', :default_order => 'desc') if allowed_management? %>
<%= sort_header_tag("#{Deliverable.table_name}.subject", :caption => 'Subject') %>
<%= sort_header_tag("labor_budget", :caption => 'Budget') if allowed_management? %>
<%= sort_header_tag("spent", :caption => 'Spent') if allowed_management? %>
<%= sort_header_tag("#{Deliverable.table_name}.due", :caption => 'Due') %>
<%= sort_header_tag("progress", :caption => 'Progress') %>
<%= sort_header_tag("score", :caption => l(:caption_score), :default_order => 'desc') if allowed_management? %>
<%= sort_header_tag("#{Deliverable.table_name}.subject", :caption => l(:caption_subject)) %>
<%= sort_header_tag("labor_budget", :caption => l(:caption_budget)) if allowed_management? %>
<%= sort_header_tag("spent", :caption => l(:caption_spent)) if allowed_management? %>
<%= sort_header_tag("#{Deliverable.table_name}.due", :caption => l(:caption_due)) %>
<%= sort_header_tag("progress", :caption => l(:caption_progress)) %>
</tr></thead>
<tbody>
<% deliverables.each do |deliverable| -%>

View File

@@ -1,3 +1,3 @@
<h3>Budget</h3>
<h3><%= l(:budget_title) %></h3>
<%= link_to l(:label_issue_view_all), { :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 } %><br />
<%= link_to_function "New Deliverable", "$('new-deliverable').toggle();" if allowed_management? %><br />
<%= link_to_function l(:label_new_deliverable), "$('new-deliverable').toggle();" if allowed_management? %><br />

View File

@@ -1,4 +1,4 @@
<h2>Update Deliverable</h2>
<h2><%= l(:label_update_deliverable) %></h2>
<% form_for :deliverable, @deliverable, :url => {:controller => 'deliverables', :action => 'update', :id => @project, :deliverable_id => @deliverable.id },
:method => :post, :builder => TabularFormBuilder, :lang => current_language,
:html => {:multipart => true, :id => 'deliverable-form', :class => 'tabular'} do |f| %>

View File

@@ -4,7 +4,7 @@
<% if allowed_management? %>
<div id="new-deliverable" style="display:none;">
<h2>New Deliverable</h2>
<h2><%= l(:label_new_deliverable) %></h2>
<% remote_form_for :deliverable, @deliverable, :url => {:controller => 'deliverables', :action => 'create', :id => @project },
:method => :post, :builder => TabularFormBuilder, :lang => current_language,
:html => {:multipart => true, :id => 'deliverable-form', :class => 'tabular'} do |f| %>

View File

@@ -1,16 +1,16 @@
<p>
Enter a dollar amount or percentage into each field to set your default amount. Use <strong>%</strong> in the field for percentages.
<%= l(:message_budget_settings) %>
</p>
<p>
<label>Non billable overhead</label><%= text_field_tag 'settings[budget_non_billable_overhead]', @settings['budget_non_billable_overhead'], :size => 15 %>
<label><%= l(:label_non_billable_overhead) %></label><%= text_field_tag 'settings[budget_non_billable_overhead]', @settings['budget_non_billable_overhead'], :size => 15 %>
</p>
<p>
<label>Materials</label><%= text_field_tag 'settings[budget_materials]', @settings['budget_materials'], :size => 15 %>
<label><%= l(:label_materials) %></label><%= text_field_tag 'settings[budget_materials]', @settings['budget_materials'], :size => 15 %>
</p>
<p>
<label>Profit</label><%= text_field_tag 'settings[budget_profit]', @settings['budget_profit'], :size => 15 %>
<label><%= l(:label_profit) %></label><%= text_field_tag 'settings[budget_profit]', @settings['budget_profit'], :size => 15 %>
</p>

View File

@@ -1,10 +1,14 @@
en:
budget_title: Budget
field_cost_per_hour: Cost per hour
field_total_hours: Total hours
field_overhead: Overhead
label_overhead: "Overhead: "
field_materials: Material costs
label_materials: "Materials: "
field_profit: Profit
field_budget: Total Budget
label_budget: "Total Budget: "
field_fixed_cost: Fixed Bid
field_project_manager_signoff: Project Manager Signoff
field_client_signoff: Client Signoff
@@ -13,3 +17,31 @@ en:
field_due: Due Date
label_member_rate: Rate ($)
message_updated_issues: Updated %d issues
message_budget_settings: Enter a dollar amount or percentage into each field to set your default amount. Use <strong>%%</strong> in the field for percentages.
label_non_billable_overhead: Non billable overhead
label_materials: Materials
label_profit: Profit
label_new_deliverable: New deliverable
label_fixed_cost: Fixed cost
caption_due: Due
caption_progress: Progress
caption_subject: Subject
caption_score: Score
caption_budget: Budget
caption_spent: Spent
label_update_deliverable: Update Deliverable
label_labor_budget: "Labor Budget: "
label_labor_budget_spent: "Labor Budget Spent: "
label_labor_budget_remaining: "Labor Budget Remaining: "
label_progress: "Progress: "
label_budget_score: "Budget Score: "
label_overruns: "Overruns: "
label_missing_on: Missing on
label_next_due_date: "Next Due Date: "
label_completion: "Completion: "
label_potential_profit: "Potential Profit: "
label_bulk_assign: Bulk Assign
label_labor: "Labor: "
label_fixed_amount: "Fixed Amount: "
label_hours_estimated: "Hours Estimated: "
label_hours_used: "Hours Used: "

View File

@@ -33,5 +33,5 @@ Redmine::Plugin.register :budget_plugin do
permission :manage_budget, { :deliverables => [:new, :edit, :create, :update, :destroy, :preview, :bulk_assign_issues]}
end
menu :project_menu, :budget, :controller => "deliverables", :action => 'index'
menu :project_menu, :budget, {:controller => "deliverables", :action => 'index'}, :caption => :budget_title
end

View File

@@ -1,9 +1,13 @@
budget_title: Budget
field_cost_per_hour: Cost per hour
field_total_hours: Total hours
field_overhead: Overhead
label_overhead: "Overhead: "
field_materials: Material costs
label_materials: "Materials: "
field_profit: Profit
field_budget: Total Budget
label_budget: "Total Budget: "
field_fixed_cost: Fixed Bid
field_project_manager_signoff: Project Manager Signoff
field_client_signoff: Client Signoff
@@ -12,3 +16,31 @@ field_deliverable_subject: Deliverable
field_due: Due Date
label_member_rate: Rate ($)
message_updated_issues: Updated %d issues
message_budget_settings: Enter a dollar amount or percentage into each field to set your default amount. Use <strong>%%</strong> in the field for percentages.
label_non_billable_overhead: Non billable overhead
label_materials: Materials
label_profit: Profit
label_new_deliverable: New deliverable
label_fixed_cost: Fixed cost
caption_due: Due
caption_progress: Progress
caption_subject: Subject
caption_score: Score
caption_budget: Budget
caption_spent: Spent
label_update_deliverable: Update Deliverable
label_labor_budget: "Labor Budget: "
label_labor_budget_spent: "Labor Budget Spent: "
label_labor_budget_remaining: "Labor Budget Remaining: "
label_progress: "Progress: "
label_budget_score: "Budget Score: "
label_overruns: "Overruns: "
label_missing_on: Missing on
label_next_due_date: "Next Due Date: "
label_completion: "Completion: "
label_potential_profit: "Potential Profit: "
label_bulk_assign: Bulk Assign
label_labor: "Labor: "
label_fixed_amount: "Fixed Amount: "
label_hours_estimated: "Hours Estimated: "
label_hours_used: "Hours Used: "