Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

finish server-side i18n

  • Loading branch information...
commit 0fd8fb18ea0812aaa69f8df58cf9eb74ad89ffaf 1 parent ff9e3f8
@ajb ajb authored
View
4 app/controllers/application_controller.rb
@@ -30,6 +30,10 @@ def check_enabled!(feature)
end
end
+ def only_unauthenticated_user
+ redirect_to(root_path) if current_user
+ end
+
private
def not_found
raise ActionController::RoutingError.new('Not Found')
View
1  app/controllers/users_controller.rb
@@ -1,5 +1,6 @@
class UsersController < ApplicationController
before_filter :authenticate_user!, except: [:signin, :post_signin, :forgot_password, :post_forgot_password]
+ before_filter :only_unauthenticated_user, only: [:signin, :post_signin, :forgot_password, :post_forgot_password]
def signin
if (path = URI(request.referer).path) != users_signin_path
View
4 app/views/layouts/_dropdown_login_form.html.haml
@@ -5,9 +5,9 @@
= password_field_tag :password, nil, placeholder: t('globals.password')
.login-button-wrapper
%button.btn.btn-primary= t('globals.sign_in')
- = t('.or_sign_up.line_html', link: link_to(t('.or_sign_up.link'), new_vendor_registration_path))
+ = t('users.or_sign_up.line_html', link: link_to(t('users.or_sign_up.link'), new_vendor_registration_path))
.forgot-password-wrapper
- = t('.forgot_password.line_html', link: link_to(t('.forgot_password.link'), users_forgot_password_path))
+ = t('users.forgot_password.line_html', link: link_to(t('users.forgot_password.link'), users_forgot_password_path))
View
14 app/views/saved_searches/index.html.haml
@@ -1,21 +1,21 @@
-!=page_header "Saved Searches"
+!=page_header t('.header')
-.alert.alert-info These are your saved searches. You'll receive daily emails with links to any new projects posted that match these parameters.
+.alert.alert-info= t('.description')
%table.table
%thead
%tr
- %th Parameters
- %th Current Results
- %th Actions
+ %th= SavedSearch.human_attribute_name(:parameters)
+ %th= t('saved_searches.current_results')
+ %th= t('globals.actions')
%tbody
- @saved_searches.each do |saved_search|
%tr
%td= saved_search.search_parameters
%td
%span.badge= saved_search.execute[:meta][:total]
- %a{"href" => projects_path(saved_search.search_parameters)} View Results
+ %a{"href" => projects_path(saved_search.search_parameters)}= t('.view_results')
%td
- =link_to "Destroy", saved_search, class: "btn btn-danger", method: :delete
+ =link_to t('actions.saved_search.delete'), saved_search, class: "btn btn-danger", method: :delete
= will_paginate @saved_searches, class: "pagination pagination-centered"
View
2  app/views/users/_notification_settings.html.haml
@@ -1,4 +1,4 @@
-%h4 Email Notifications
+%h4= t('.header')
- event_types.each do |k, v|
%label.checkbox
View
7 app/views/users/forgot_password.html.haml
@@ -1,9 +1,8 @@
-!=page_header "Forgot password"
+!=page_header t('.header')
= form_tag users_forgot_password_path, method: :post do
- %label Email
- = text_field_tag :email, nil, placeholder: "Email Address"
+ = text_field_tag :email, nil, placeholder: t('globals.email_address')
.form-actions
- %button.btn.btn-primary Send reset password instructions
+ %button.btn.btn-primary= t('.send_instructions')
View
10 app/views/users/officer_settings.html.haml
@@ -1,8 +1,8 @@
-!=page_header "Settings"
+!=page_header t('.header')
= form_for current_officer, url: settings_path do |f|
- %h4 Profile
+ %h4= t('.profile')
= f.label :name
= f.text_field :name
@@ -10,10 +10,10 @@
= f.label :title
= f.text_field :title
- %h4 Developer
- %label API Key
+ %h4= t('.dev_header')
+ %label= t('.api_key')
%code.js-api-key-hide.hide= current_officer.authentication_token
- %a.js-api-key-hide{"data-toggle" => "showhide", "data-target" => ".js-api-key-hide", "data-toggle-text" => "(hide)"} (show)
+ %a.js-api-key-hide{"data-toggle" => "showhide", "data-target" => ".js-api-key-hide", "data-toggle-text" => t('globals.hide_paren')}= t('globals.show_paren')
= render 'users/notification_settings', event_types: Officer.event_types
View
16 app/views/users/signin.html.haml
@@ -1,16 +1,16 @@
-!=page_header "Sign in"
+!=page_header t('globals.sign_in')
= form_tag users_signin_path, method: :post do
- %label Email
- = text_field_tag :email, nil, placeholder: "Email Address"
+ %label= t('globals.email_address')
+ = text_field_tag :email, nil, placeholder: t('globals.email_address')
- %label Password
- = password_field_tag :password, nil, placeholder: "Password"
+ %label= t('globals.password')
+ = password_field_tag :password, nil, placeholder: t('globals.password')
.form-actions
- %button.btn.btn-primary Sign in
- or <a href="#{new_vendor_registration_path}">sign up</a>.
+ %button.btn.btn-primary= t('globals.sign_in')
+ = t('users.or_sign_up.line_html', link: link_to(t('users.or_sign_up.link'), new_vendor_registration_path))
.forgot-password-wrapper
- Did you <a href="#{users_forgot_password_path}">forget your password</a>?
+ = t('users.forgot_password.line_html', link: link_to(t('users.forgot_password.link'), users_forgot_password_path))
View
4 app/views/users/vendor_settings.html.haml
@@ -1,8 +1,8 @@
-!=page_header "Settings"
+!=page_header t('.header')
= form_for current_vendor, url: settings_path do |f|
- %h4 Profile
+ %h4= t('.profile')
= f.label :name
= f.text_field :name
View
4 app/views/watches/vendor_projects.html.haml
@@ -1,7 +1,7 @@
-!=page_header "Watched Projects"
+!=page_header t('.header')
%ul
- @projects.each do |project|
%li
= link_to project.title, project_path(project)
- %small last updated #{project.updated_at.to_formatted_s(:readable)}
+ %small= t('watches.last_updated', date: project.updated_at.to_formatted_s(:readable))
View
52 config/locales/en.yml
@@ -5,12 +5,17 @@ en:
globals:
site_name: Procure.io
sign_in: Sign in
+ sign_up: Sign up
email_address: Email Address
password: Password
actions: Actions
unknown_officer: Unknown
experimental_follow_steps_html: >
<strong>Howdy!</strong> This feature is pretty experimental, so if you do choose to proceed, be sure to follow the steps below.
+ show: "show"
+ hide: "hide"
+ show_paren: "(show)"
+ hide_paren: "(hide)"
confirmations:
bid:
@@ -43,6 +48,9 @@ en:
question:
create: "Submit Question"
+ saved_search:
+ delete: "Delete Saved Search"
+
postable_by_officer:
live: Live
@@ -61,12 +69,6 @@ en:
dropdown_login_form:
sign_in: Sign in to %{site_name}
- or_sign_up:
- line_html: or %{link}
- link: sign up
- forgot_password:
- line_html: Did you %{link}?
- link: forget your password
amendments:
posted_on: "Posted on %{date}"
@@ -257,6 +259,44 @@ en:
common:
no_data: "Sorry, no data to display."
+ saved_searches:
+ current_results: Current Results
+ index:
+ header: "Saved Searches"
+ description: "These are your saved searches. You'll receive daily emails with links to any new projects posted that match these parameters."
+ view_results: View Results
+
+ users:
+ notification_settings:
+ header: "Email Notifications"
+
+ forgot_password:
+ header: "Forgot password"
+ send_instructions: "Send reset password instructions"
+
+ officer_settings:
+ header: "Settings"
+ profile: "Profile"
+ dev_header: "Developer"
+ api_key: API Key
+
+ vendor_settings:
+ header: "Settings"
+ profile: Profile
+
+ or_sign_up:
+ line_html: or %{link}
+ link: sign up
+
+ forgot_password:
+ line_html: Did you %{link}?
+ link: forget your password
+
+ watches:
+ last_updated: "last updated %{date}"
+ vendor_projects:
+ header: Watched Projects
+
mailers:
notification:
subject: "%{event_text}"
Please sign in to comment.
Something went wrong with that request. Please try again.