From 6519a11717920c086dd025fd972925dbd899c3a1 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Wed, 18 Mar 2015 10:45:19 -0300 Subject: [PATCH] WIP Internationalizing of project views --- app/views/projects/_form.html.erb | 6 +++--- app/views/projects/edit.html.erb | 2 +- app/views/projects/index.html.erb | 8 ++++---- app/views/projects/new.html.erb | 2 +- app/views/projects/show.html.erb | 22 +++++++++++----------- config/locales/views/en.yml | 9 --------- config/locales/views/projects/en.yml | 18 ++++++++++++++++++ config/locales/views/projects/pt.yml | 0 8 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 config/locales/views/projects/en.yml create mode 100644 config/locales/views/projects/pt.yml diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index 525580c..ab7cc40 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -16,14 +16,14 @@
- <%= f.label "Image url", class: 'control-label' %>
+ <%= f.label t("image_url"), class: 'control-label' %>
<%= f.text_field :image_url, class: 'text-area', value: @project.attributes.nil? || @project.attributes.image_url.nil? ? '#' : @project.attributes.image_url %>
- <%= f.submit 'Save', class: 'btn btn-primary' %> - <%= link_to 'All Projects', projects_path, class: 'btn btn-default'%> + <%= f.submit t('save'), class: 'btn btn-primary' %> + <%= link_to t('all_projects'), projects_path, class: 'btn btn-default'%>
<% end %> diff --git a/app/views/projects/edit.html.erb b/app/views/projects/edit.html.erb index 129a924..1310527 100644 --- a/app/views/projects/edit.html.erb +++ b/app/views/projects/edit.html.erb @@ -1,5 +1,5 @@ <%= render 'form' %> diff --git a/app/views/projects/index.html.erb b/app/views/projects/index.html.erb index e3b0d5d..767df98 100644 --- a/app/views/projects/index.html.erb +++ b/app/views/projects/index.html.erb @@ -1,16 +1,16 @@ <% if user_signed_in? %>

- <%= link_to 'New Project', new_project_path, class: 'btn btn-primary' %> + <%= link_to t('new_project'), new_project_path, class: 'btn btn-primary' %>

<%else%>

- You must be logged in to create new Projects. + <%= t('must_logged_create_projects') %>

<% end %> -<%= render partial: 'shared/project_list', locals: {projects: @projects} %> \ No newline at end of file +<%= render partial: 'shared/project_list', locals: {projects: @projects} %> diff --git a/app/views/projects/new.html.erb b/app/views/projects/new.html.erb index 8df6de4..e500060 100644 --- a/app/views/projects/new.html.erb +++ b/app/views/projects/new.html.erb @@ -1,5 +1,5 @@ <%= render 'form' %> diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 9654a68..cbae955 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -6,7 +6,7 @@ <%= image_tag "#{@project_image.url}", size:"128x128" %> <% else %>

- No image available + <%= t("no_image_available") %> <% end %>
@@ -16,22 +16,22 @@

- Description: + <%= t("description") %>: <%= @project.description %>


-

Repositories

+

<%= t("repositories") %>

-<% if project_owner? @project.id %><%= link_to 'New Repository', new_project_repository_path(@project,), class: 'btn btn-primary' %><% end %> +<% if project_owner? @project.id %><%= link_to t('new_repository'), new_project_repository_path(@project,), class: 'btn btn-primary' %><% end %> - - - + + + @@ -40,7 +40,7 @@ <% if @project_repositories.size == 0 %> <% col_number = project_owner?(@project.id) ? 4 : 3 %> - + <% end %> <% @project_repositories.each do |repository| %> @@ -50,11 +50,11 @@ + <%= link_to t('show'), project_repository_path(@project, repository.id), class: 'btn btn-info' %> <% end %> @@ -65,6 +65,6 @@

<% if project_owner? @project.id %> - <%= link_to 'Destroy Project', project_path(@project.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Project?' }, class: 'btn btn-danger' %> + <%= link_to t('destroy_project'), project_path(@project.id), method: :delete, data: { confirm: t('want_destroy_project') }, class: 'btn btn-danger' %> <% end %>

diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index 8b9029d..0d40d06 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -39,8 +39,6 @@ en: code: "Code" reading_group: "Reading Group" reading_groups: "Reading Groups" - project: "Project" - projects: "Projects" configuration: "Configuration" configurations: "Configurations" edit_account: "Edit Account" @@ -51,7 +49,6 @@ en: ranges: "Ranges" range: "Range" language: "Language:" - new_project: "New Project" no_description: "There is no description available." welcome: "Welcome" metrics: "Metrics" @@ -177,8 +174,6 @@ en: new_range: "New Range" new_reading: "New Reading" only_point_printed_chart: "There is only one point and it will not be printed into a chart." - edit_project: "Edit Project" - must_logged_create_projetcs: "You must be logged in to create new Projects." there_readings_yet: "There are no Readings yet!" edit_reading_group: "Edit Reading Group" must_logged_create_reading_groups: "You must be logged in to create new Reading Groups." @@ -194,16 +189,12 @@ en: really_want_cancel_account: "Do you really want to cancel your account?" received_confirmation_instructions: "Have you received confirmation instructions?" received_unlock_instructions: "Have you received unlock instructions?" - your_projects: "Your projects" mezuro_team: "The Mezuro Team" want_destroy_range: "Are you sure that you want to destroy this Range?" compound_metric: "Compound Metric" add_metric: "Add Metric" destroy_configuration: "Destroy Configuration" want_destroy_configuration: "Are you sure that you want to destroy this Configuration?" - new_project: "New Project" - destroy_projects: "Destroy Project" - want_destroy_project: "Are you sure that you want to destroy this Project?" want_destroy_reading: "Are you sure that you want to destroy this Reading?" grade_show: "Grade" destroy_reading_group: "Destroy Reading Group" diff --git a/config/locales/views/projects/en.yml b/config/locales/views/projects/en.yml new file mode 100644 index 0000000..edd5a6b --- /dev/null +++ b/config/locales/views/projects/en.yml @@ -0,0 +1,18 @@ +en: + activemodel: + models: + project: "Project" + attributes: + name: "Name" + description: "Description" + project: "Project" + projects: "Projects" + new_project: "New Project" + must_logged_create_projects: "You must be logged in to create new Projects." + edit_project: "Edit Project" + your_projects: "Your projects" + new_project: "New Project" + destroy_project: "Destroy Project" + want_destroy_project: "Are you sure that you want to destroy this Project?" + image_url: "Image URL" + all_projects: "All Projects" diff --git a/config/locales/views/projects/pt.yml b/config/locales/views/projects/pt.yml new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/config/locales/views/projects/pt.yml -- libgit2 0.21.2
NameTypeAddress<%= t("Name") %><%= t("Type") %><%= t("Address") %>
There are no Repositories yet! <%= t("no_repositories") %>
<%= repository.address %> <% if project_owner? @project.id %> - <%= link_to 'Edit', edit_project_repository_path(@project, repository.id), class: 'btn btn-info' %> + <%= link_to t('edit'), edit_project_repository_path(@project, repository.id), class: 'btn btn-info' %> <% end %> - <%= link_to 'Show', project_repository_path(@project, repository.id), class: 'btn btn-info' %>