Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client’s views internationalized #3

Merged
merged 3 commits into from Feb 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/clients/_form.html.erb
Expand Up @@ -2,7 +2,7 @@
<div class="col-md-12">
<div class="widget stacked">
<div class="widget-header">
<h3>Client</h3>
<h3><%= t('clients.edit.headers.client')%></h3>
</div> <!-- /widget-header -->
<div class="widget-content">
<%= simple_form_for @client, html: { class: "form-horizontal col-md-7"} do |f| %>
Expand All @@ -24,7 +24,7 @@

<div class="form-actions text-center">
<%= f.button :submit, class: "btn btn-success" %>
<%= link_to "Cancel", clients_path, class: "btn btn-default" %>
<%= link_to t('helpers.submit.cancel'), clients_path, class: "btn btn-default" %>
</div>
<% end %>
</div> <!-- /widget-content -->
Expand Down
14 changes: 7 additions & 7 deletions app/views/clients/import.html.erb
Expand Up @@ -2,27 +2,27 @@
<div class="col-md-12">
<div class="widget stacked">
<div class="widget-header">
<h3>Import Clients from CSV</h3>
<h3><%= t('.header') %></h3>
</div> <!-- /widget-header -->
<div class="widget-content">
<div class="col-lg-8">
<p><strong>Important: </strong>You need to have these columns in the first line of your CSV file</p>
<pre>Client Name,Address</pre>
<p>The column <code>Client Name</code> can't be blank.</p>
<p><%= t('.instructions.line_1_html') %></p>
<%= t('.instructions.line_2_html') %>
<p><%= t('.instructions.line_3_html') %></p>
</div>
<%= form_tag import_clients_file_path, multipart: true, class: "form-horizontal col-md-7" do %>
<fieldset>
<div class="form-group">
<%= label_tag :file, nil, class: "control-label col-lg-4", required: true %>
<%= label_tag t('.file'), nil, class: "control-label col-lg-4", required: true %>
<div class="col-lg-8">
<%= file_field_tag :file, class: "form-control", required: true %>
</div>
</div>
</fieldset>

<div class="form-actions text-center">
<%= submit_tag "Upload and Import", class: "btn btn-success" %>
<%= link_to "Cancel", clients_path, class: "btn btn-default" %>
<%= submit_tag t('helpers.submit.submit_and_upload'), class: "btn btn-success" %>
<%= link_to t('helpers.submit.cancel'), clients_path, class: "btn btn-default" %>
</div>
<% end %>
</div> <!-- /widget-content -->
Expand Down
28 changes: 14 additions & 14 deletions app/views/clients/index.html.erb
Expand Up @@ -2,39 +2,39 @@
<div class="col-md-12">
<div class="widget stacked ">
<div class="widget-header">
<h3>Listing clients</h3>
<h3><%= t('.headers.client_list') %></h3>
</div> <!-- /.widget-header -->
<div class="widget-content">
<p>
<%= link_to 'New Client', new_client_path, class: "btn btn-primary" %>
<%= link_to 'Export to Excel', clients_path(format: "xlsx"), class: "btn btn-default" %>
<%= link_to 'Export to CSV', clients_path(format: "csv"), class: "btn btn-default" %>
<%= link_to 'Import from CSV', import_clients_path, class: "btn btn-default" %>
<%= link_to t('.actions.new_client'), new_client_path, class: "btn btn-primary" %>
<%= link_to t('.actions.export_excel'), clients_path(format: "xlsx"), class: "btn btn-default" %>
<%= link_to t('.actions.export_csv'), clients_path(format: "csv"), class: "btn btn-default" %>
<%= link_to t('.actions.import_csv'), import_clients_path, class: "btn btn-default" %>
</p>
<% if @clients.size > 0 %>
<div class="panel panel-default">
<div class="panel-body">
<div class="list-group">
<% @clients.each do |client| %>
<div class="list-group-item<%= " disabled" if !client.enabled? %>">
<div class="list-group-item<%= " disabled" unless client.enabled? %>">
<div class="pull-right">
<%= link_to 'Edit', edit_client_path(client), class: "btn btn-default btn-xs" %>
<%= link_to t('.actions.edit'), edit_client_path(client), class: "btn btn-default btn-xs" %>
<% if client.enabled %>
<%= link_to 'Archive', disable_client_path(client), class: "btn btn-default btn-xs", method: :patch if @clients.enabled.size > 1 and client.projects.enabled.size == 0 %>
<%= link_to t('.actions.archive'), disable_client_path(client), class: "btn btn-default btn-xs", method: :patch if @clients.enabled.size > 1 and client.projects.enabled.size == 0 %>
<% else %>
<%= link_to 'Reopen', enable_client_path(client), class: "btn btn-default btn-xs", method: :patch %>
<%= link_to t('.actions.reopen'), enable_client_path(client), class: "btn btn-default btn-xs", method: :patch %>
<% end -%>
<% if client.projects.size == 0 and client.time_entered == 0 and @clients.enabled.size > 1 %>
<%= link_to 'Delete', client, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger btn-xs" %>
<%= link_to t('.actions.delete'), client, method: :delete, data: { confirm: t('.messages.confirmation') }, class: "btn btn-danger btn-xs" %>
<% else %>
<%= link_to 'Delete', '#', class: "btn btn-danger btn-xs disabled" %>
<%= link_to t('.actions.delete'), '#', class: "btn btn-danger btn-xs disabled" %>
<% end -%>
</div>
<h5 class="list-group-item-heading"><%= link_to client.name, edit_client_path(client) %></h5>
<p class="list-group-item-text">
Projects: <%= client.projects.enabled.size %> |
Archived projects: <%= client.projects.disabled.size %> |
Tracked time: <%= nice_time(client.time_entered) %></p>
<%= t('.sub_headers.projects') %>: <%= client.projects.enabled.size %> |
<%= t('.sub_headers.archived_projects') %>: <%= client.projects.disabled.size %> |
<%= t('.sub_headers.tracked_time') %>: <%= nice_time(client.time_entered) %></p>
</div>
<% end -%>
</div>
Expand Down
5 changes: 3 additions & 2 deletions app/views/companies/show.html.erb
Expand Up @@ -2,12 +2,13 @@
<div class="col-md-12">
<div class="widget stacked">
<div class="widget-header">
<h3>Account Settings</h3>
<h3><%= t('.header') %></h3>
</div> <!-- /widget-header -->
<div class="widget-content">
<div class="col-md-offset-2">
<p>
<%= link_to "Delete account", delete_account_path, class: "btn btn-danger btn-xs", method: :delete, data: { confirm: 'You will lose everything. Your time entries, your projects, your clients... And your account!!!! Are you sure? Really??'} %>
<%= link_to t('.actions.delete'), delete_account_path, class: "btn btn-danger btn-xs", method: :delete,
data: { confirm: t('.messages.confirmation')} %>
</p>
</div>
</div> <!-- /widget-content -->
Expand Down
30 changes: 30 additions & 0 deletions config/locales/en/clients.en.yml
@@ -0,0 +1,30 @@
en:
clients:
edit:
headers:
client: Client
import:
file: File
header: Import Clients from CSV
instructions:
line_1_html: "<strong>Important: </strong>You need to have these columns in the first line of your CSV file"
line_2_html: "<pre>Client Name,Address</pre>"
line_3_html: "The column <code>Client Name</code> can't be blank."
index:
actions:
archive: Archive
delete: Delete
edit: Edit
export_csv: Export to CSV
export_excel: Export to Excel
import_csv: Import from CSV
new_client: New Client
reopen: Reopen
headers:
client_list: Client list
messages:
confirmation: 'Are you sure?'
sub_headers:
archived_projects: Archived projects
projects: Projects
tracked_time: Tracked time
8 changes: 8 additions & 0 deletions config/locales/en/companies.en.yml
@@ -0,0 +1,8 @@
en:
companies:
show:
actions:
delete: Delete account
header: Account Settings
messages:
confirmation: 'You will lose everything. Your time entries, your projects, your clients... And your account!!!! Are you sure? Really?'
24 changes: 3 additions & 21 deletions config/locales/en/en.yml
@@ -1,22 +1,4 @@
# Files in the config/locales directory are used for internationalization
# and are automatically loaded by Rails. If you want to use locales other
# than English, add the necessary files in this directory.
#
# To use the locales, use `I18n.t`:
#
# I18n.t 'hello'
#
# In views, this is aliased to just `t`:
#
# <%= t('hello') %>
#
# To use a different locale, set it with `I18n.locale`:
#
# I18n.locale = :es
#
# This would use the information in config/locales/es.yml.
#
# To learn more, please read the Rails Internationalization guide
# available at http://guides.rubyonrails.org/i18n.html.
en:
hello: "Hello world"
helpers:
submit:
submit_and_upload: "Upload & Import"
9 changes: 9 additions & 0 deletions config/locales/es/activerecord.es.yml
@@ -0,0 +1,9 @@
es:
activerecord:
attributes:
client:
address: "AddressXXX"
name: "NameXXX"
notes: "NotesXXX"
models:
client: Cliente
30 changes: 30 additions & 0 deletions config/locales/es/clients.es.yml
@@ -0,0 +1,30 @@
es:
clients:
edit:
headers:
client: ClientXXX
import:
file: Fichero
header: Import Clients from CSVXXX
instructions:
line_1_html: "<strong>Important: </strong>You need to have these columns in the first line of your CSV fileXXX"
line_2_html: "<pre>Client Name,Address</pre>XXX"
line_3_html: "The column <code>Client Name</code> can't be blank.XXX"
index:
actions:
archive: ArchiveXXX
delete: DeleteXXX
edit: EditXXX
export_csv: Export to CSVXXX
export_excel: Export to ExcelXXX
import_csv: Import from CSVXXX
new_client: New ClientXXX
reopen: ReopenXXX
headers:
client_list: Client listXXX
messages:
confirmation: 'Are you sure?XXX'
sub_headers:
archived_projects: Archived projectsXXX
projects: ProjectsXXX
tracked_time: Tracked timeXXX
8 changes: 8 additions & 0 deletions config/locales/es/companies.es.yml
@@ -0,0 +1,8 @@
es:
companies:
show:
actions:
delete: Delete account
header: Account Settings
messages:
confirmation: 'You will lose everything. Your time entries, your projects, your clients... And your account!!!! Are you sure? Really?'
8 changes: 8 additions & 0 deletions config/locales/es/es.yml
@@ -0,0 +1,8 @@
es:
helpers:
submit:
cancel: "Cancelar"
create: "Crear %{model}"
submit: "Guardar %{model}"
submit_and_upload: "Subir & Importar"
update: "Actualizar %{model}"