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

feat: translations to PT-BR #40

Merged
merged 1 commit into from
Aug 1, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2>Forgot your password?</h2>
<h2>Esqueceu sua senha?</h2>

<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand All @@ -9,7 +9,7 @@
</div>

<div class="actions">
<%= f.submit "Send me reset password instructions" %>
<%= f.submit "Enviar instruções para redefinição de senha" %>
</div>
<% end %>

Expand Down
13 changes: 5 additions & 8 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% content_for :body_class, 'body' %>

<h2>Sign up</h2>
<h2>Cadastro</h2>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
Expand All @@ -11,38 +11,35 @@
</div>

<div class="field">
<%= f.label :password %>
<%= f.label :password, "Senha" %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "new-password" %>
</div>

<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.label :password_confirmation, "Confirme a senha" %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
</div>

<!-- Include the name field from the current form -->
<div class="field">
<%= f.label :name, style: "display: block" %>
<%= f.label :name, "Nome", style: "display: block" %>
<%= f.text_field :name, class: "form-control" %>
</div>

<!-- Include the cpf field from the current form -->
<div class="field">
<%= f.label :cpf, class: "uppercase-label", style: "display: block" %>
<%= f.text_field :cpf, class: "form-control" %>
</div>

<!-- Include the driver field from the current form -->
<div>
<%= f.label "Você é entregador?", style: "display: block" %>
<%= f.check_box :driver %>
</div>

<div class="actions">
<%= f.submit "Sign up" %>
<%= f.submit "Cadastre-se" %>
</div>
<% end %>

Expand Down
8 changes: 4 additions & 4 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% content_for :body_class, 'body' %>

<h2>Log in</h2>
<h2>Login</h2>

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
Expand All @@ -9,19 +9,19 @@
</div>

<div class="field">
<%= f.label :password %><br />
<%= f.label :password, "Senha" %><br />
<%= f.password_field :password, autocomplete: "current-password" %>
</div>

<% if devise_mapping.rememberable? %>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
<%= f.label :remember_me, "Lembrar-me" %>
</div>
<% end %>

<div class="actions">
<%= f.submit "Log in" %>
<%= f.submit "Entrar" %>
</div>
<% end %>

Expand Down
10 changes: 5 additions & 5 deletions app/views/devise/shared/_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
<% end %>

<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<%= link_to "Cadastrar", new_registration_path(resource_name) %><br />
<% end %>

<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
<%= link_to "Esqueceu sua senha?", new_password_path(resource_name) %><br />
<% end %>

<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<%= link_to "Não recebeu as instruções de confirmação?", new_confirmation_path(resource_name) %><br />
<% end %>

<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<%= link_to "Não recebeu as instruções para desbloqueio?", new_unlock_path(resource_name) %><br />
<% end %>

<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
<%= button_to "Entrar com #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
<% end %>
<% end %>
8 changes: 4 additions & 4 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
<% if not user_signed_in? %>
<p>
<%= link_to 'Crie uma conta', '/users/sign_up', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Ver viagens oferecidas', 'trips', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Solicite ou ofereça uma viagem', 'trips/new', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Ver fretes disponíveis', 'trips', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Solicite ou ofereça um frete', 'trips/new', class: 'btn btn-primary btn-lg' %>
</p>
<% else %>
<div class="button-container">
<%= link_to 'Ver viagens oferecidas', 'trips', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Solicite ou ofereça uma viagem!', 'trips/new', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Ver fretes disponíveis', 'trips', class: 'btn btn-primary btn-lg' %>
<%= link_to 'Solicite ou ofereça um frete!', 'trips/new', class: 'btn btn-primary btn-lg' %>
</div>
<% end %>
</div>
Expand Down
18 changes: 9 additions & 9 deletions app/views/trips/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= form_with(model: trip) do |form| %>
<% if trip.errors.any? %>
<div style="color: red">
<h2><%= pluralize(trip.errors.count, "error") %> prohibited this trip from being saved:</h2>
<h2><%= pluralize(trip.errors.count, "erro") %> impediu que esta viagem fosse salva:</h2>

<ul>
<% trip.errors.each do |error| %>
Expand All @@ -14,42 +14,42 @@
<% end %>

<div class="form-group">
<%= form.label :departure_location, style: "display: block" %>
<%= form.label :departure_location, "Local de Partida:", style: "display: block" %>
<%= form.text_field :departure_location, class: "form-control" %>
</div>

<div class="form-group">
<%= form.label :arrival_location, style: "display: block" %>
<%= form.label :arrival_location, "Local de Chegada:", style: "display: block" %>
<%= form.text_field :arrival_location, class: "form-control" %>
</div>

<div class="form-group">
<%= form.label :departure_date, style: "display: block" %>
<%= form.label :departure_date, "Data de Partida:", style: "display: block" %>
<%= form.date_field :departure_date, class: "form-control smaller-input" %>
</div>

<div class="form-group">
<%= form.label :arrival_date, style: "display: block" %>
<%= form.label :arrival_date, "Data de Chegada:", style: "display: block" %>
<%= form.date_field :arrival_date, class: "form-control smaller-input" %>
</div>

<div class="form-group">
<%= form.label :departure_time, style: "display: block" %>
<%= form.label :departure_time, "Hora de Partida:", style: "display: block" %>
<%= form.time_field :departure_time, class: "form-control smaller-input" %>
</div>

<div class="form-group">
<%= form.label :arrival_time, style: "display: block" %>
<%= form.label :arrival_time, "Hora de Chegada:", style: "display: block" %>
<%= form.time_field :arrival_time, class: "form-control smaller-input" %>
</div>

<div class="form-group">
<%= form.label "Sua viagem é solicitada ou oferecida?", style: "display: block" %>
<%= form.label "Tipo de Viagem:", style: "display: block" %>
<%= form.select :trip_type, [['Solicitada', 'Solicitada'], ['Oferecida', 'Oferecida']], { include_blank: false }, class: "form-control smaller-input" %>
</div>

<div class="form-group">
<%= form.submit "Submit", class: "btn btn-primary" %>
<%= form.submit "Enviar", class: "btn btn-primary" %>
</div>
<% end %>

6 changes: 3 additions & 3 deletions app/views/trips/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Editing trip</h1>
<h1>Editar Frete</h1>

<%= render "form", trip: @trip %>

Expand All @@ -11,6 +11,6 @@
<%= link_to "Manage Requests", manage_requests_trip_path(@trip), class: "btn btn-default"%>
<% end %>
<% end %>
<%= link_to "Show this trip", @trip, class: "btn btn-default" %>
<%= link_to "Back to trips", trips_path, class: 'btn btn-default' %>
<%= link_to "Ver frete", @trip, class: "btn btn-default" %>
<%= link_to "Voltar", trips_path, class: 'btn btn-default' %>
</div>
41 changes: 20 additions & 21 deletions app/views/trips/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,47 +63,46 @@
<% content_for :body_class, 'body' %>

<p style="color: green"><%= notice %></p>
<h1>Trips</h1>
<h1>Fretes</h1>
<div class="search-container">
<div class="search-box">
<%= search_form_for @q do |f| %>
<%= f.label :departure_location %>
<%= f.label :departure_location, "Local de Partida:" %>
<%= f.text_field :departure_location_cont, class: 'form-control' %>

<%= f.label :arrival_location %>
<%= f.label :arrival_location, "Local de Chegada:" %>
<%= f.text_field :arrival_location_cont, class: 'form-control' %>

<%= f.label :departure_date %>
<%= f.text_field :departure_date_cont, class: 'form-control', placeholder: 'dd/mm/yyyy' %>
<%= f.label :departure_date, "Data de Partida:" %>
<%= f.text_field :departure_date_cont, class: 'form-control', placeholder: 'dd/mm/aaaa' %>

<%= f.label :arrival_date %>
<%= f.text_field :arrival_date_cont, class: 'form-control', placeholder: 'dd/mm/yyyy' %>
<%= f.label :arrival_date, "Data de Chegada:" %>
<%= f.text_field :arrival_date_cont, class: 'form-control', placeholder: 'dd/mm/aaaa' %>

<%= f.label :trip_type %>
<%= f.label :trip_type, "Tipo de Viagem:" %>
<%= f.text_field :trip_type_cont, class: 'form-control' %>

<div class="actions">
<%= f.submit class: 'btn btn-primary' %>
<%= link_to "Clear", request.path, class: "btn btn-default" %>
<%= f.submit "Buscar", class: 'btn btn-primary' %>
<%= link_to "Limpar", request.path, class: "btn btn-default" %>
</div>

<%= link_to "New trip", new_trip_path, class: 'btn btn-default btn-gray' %>
<%= link_to "Novo frete", new_trip_path, class: 'btn btn-default btn-gray' %>
<% end %>
</div>

<body>
<table id="trips">
<thead>
<tr>
<th>Departure Location</th>
<th>Arrival Location</th>
<th>Departure Date</th>
<th>Arrival Date</th>
<th>Departure Time</th>
<th>Arrival Time</th>
<th>Trip Type</th>
<th>Participants</th>
<th>Actions</th>
<th>Local de Partida</th>
<th>Local de Chegada</th>
<th>Data de Partida</th>
<th>Data de Chegada</th>
<th>Hora de Partida</th>
<th>Hora de Chegada</th>
<th>Tipo de Viagem</th>
<th>Participantes</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
Expand Down
4 changes: 2 additions & 2 deletions app/views/trips/manage_requests.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<% @requested_participants.each do |participant| %>
<li>
<%= participant %>
<%= button_to "Accept", accept_request_trip_path(@trip, participant: participant), method: :patch, class: "btn btn-success", style: "float: left; margin-right: 5px;" %>
<%= button_to "Reject", reject_request_trip_path(@trip, participant: participant), method: :delete, class: "btn btn-danger", style: "float: left; margin-right: 5px;" %>
<%= button_to "Aceitar", accept_request_trip_path(@trip, participant: participant), method: :patch, class: "btn btn-success", style: "float: left; margin-right: 5px;" %>
<%= button_to "Rejeitar", reject_request_trip_path(@trip, participant: participant), method: :delete, class: "btn btn-danger", style: "float: left; margin-right: 5px;" %>
<div style="clear: both;"></div>
</li>
<% end %>
Expand Down
18 changes: 9 additions & 9 deletions app/views/trips/my_trips.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
<table id="my-trips">
<thead>
<tr>
<th>Departure Location</th>
<th>Arrival Location</th>
<th>Departure Date</th>
<th>Arrival Date</th>
<th>Departure Time</th>
<th>Arrival Time</th>
<th>Trip Type</th>
<th>Participants</th>
<th>Actions</th>
<th>Local de Partida</th>
<th>Local de Chegada</th>
<th>Data de Partida</th>
<th>Data de Chegada</th>
<th>Hora de Partida</th>
<th>Hora de Chegada</th>
<th>Tipo de Viagem</th>
<th>Participantes</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
Expand Down
2 changes: 1 addition & 1 deletion app/views/trips/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>New trip</h1>
<h1>Novo Frete</h1>

<%= render "form", trip: @trip %>

Expand Down
10 changes: 5 additions & 5 deletions app/views/trips/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
<div>
<% if current_user && @trip.user.eql?(current_user) %>
<% if @trip.requested_participants.any? %>
<%= link_to "Manage Requests", manage_requests_trip_path(@trip), class: 'btn btn-default'%>
<%= link_to "Gerenciar solicitações", manage_requests_trip_path(@trip), class: 'btn btn-default'%>
<% end %>

<%= link_to "Edit this trip", edit_trip_path(@trip), class: 'btn btn-default'%>
<%= link_to "Back to trips", trips_path, class: 'btn btn-default'%>
<%= link_to "Editar frete", edit_trip_path(@trip), class: 'btn btn-default'%>
<%= link_to "Voltar", trips_path, class: 'btn btn-default'%>
<%= form_with(model: @trip, url: trip_path(@trip), method: :delete, data: { confirm: "Are you sure you want to delete this trip?" }) do |form| %>
<%= form.submit "Destroy this trip", class: 'btn btn-default btn-gray', style: 'margin-top: 10px;'%>
<%= form.submit "Excluir frete", class: 'btn btn-default btn-gray', style: 'margin-top: 10px;'%>
<% end %>
<% else %>
<%= link_to "Back to trips", trips_path, class: 'btn btn-default'%>
<%= link_to "Voltar", trips_path, class: 'btn btn-default'%>
<% end %>
</div>