diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 80ab5e02..da4b5b89 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -1,9 +1,14 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+ before_filter :set_locale
before_filter :force_approved_account
before_filter :redirect_suspended_account
+ def set_locale
+ I18n.locale = params[:locale] || I18n.default_locale
+ end
+
def force_approved_account
# We will redirect to the approval page if a user is signed in, is not an admin and is marked as waiting for approval
redirect = user_signed_in? && !current_user.is_admin? && current_user.registration_status.waiting_approval?
diff --git a/app/views/admin/admin/index.html.erb b/app/views/admin/admin/index.html.erb
index f05a841b..5d4f7b01 100644
--- a/app/views/admin/admin/index.html.erb
+++ b/app/views/admin/admin/index.html.erb
@@ -8,19 +8,19 @@
-
Site settings
+
<%= t('admin.site_settings') %>
<%= form_for @settings, :url => admin_update_path, :method => :post do |f| %>
<%= f.label :max_rooms do %>
- Max number of rooms <%= f.number_field :max_rooms, :class => "input-mini pull-right" %>
+ <%= t('admin.max_number_of_rooms') %><%= f.number_field :max_rooms, :class => "input-mini pull-right" %>
<% end %>
<%= f.label :disable_conn_disconn_activity do %>
- <%= f.check_box :disable_conn_disconn_activity, :class => "switch" %> disable connect/disconnect activity
+ <%= f.check_box :disable_conn_disconn_activity, :class => "switch" %><%= t('admin.disable_connect') %>
<% end %>
<%= f.label :public_site do %>
- <%= f.check_box :public_site, :class => "switch" %> Public site
+ <%= f.check_box :public_site, :class => "switch" %> <%= t('admin.public_site') %>
<% end %>
@@ -29,17 +29,17 @@
<% end %>
-
Users waiting for approval
+
<%= t('admin.users_waiting_approval') %>
<%= render(:collection => @waiting_for_approval_users, :as => :user, :partial => "user") ||\
- content_tag(:li, "There are no users needing approval right now. Invite others to join Kandan!", class: 'no-users') %>
+ content_tag(:li, t('admin.warn_no_user'), class: 'no-users') %>
<%= link_to "Cancel my account", registration_path(resource_name), :class => "btn btn-danger", :confirm => "Are you sure you want to delete your account?", :method => :delete %>
diff --git a/config/application.rb b/config/application.rb
index 756e8c0a..93e450fc 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -43,6 +43,9 @@ class Application < Rails::Application
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
+ config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
+ config.i18n.default_locale = :en
+ config.i18n.enforce_available_locales = true
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
diff --git a/config/locales/en.yml b/config/locales/en.yml
deleted file mode 100644
index 7da9cf8a..00000000
--- a/config/locales/en.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
-
-en:
- hello: "Hello world"
- activerecord:
- errors:
- models:
- attachment:
- attributes:
- file:
- spoofed_media_type: "Media Type Spoofed"
diff --git a/config/locales/en/admin.en.yml b/config/locales/en/admin.en.yml
new file mode 100644
index 00000000..12ea707f
--- /dev/null
+++ b/config/locales/en/admin.en.yml
@@ -0,0 +1,9 @@
+en:
+ admin:
+ site_settings: "Site settings"
+ max_number_of_rooms: "Max number of rooms"
+ public_site: "Public site"
+ disable_connect: "disable connect/disconnect activity"
+ users_waiting_approval: "Users waiting for approval"
+ warn_no_user: "There are no users needing approval right now. Invite others to join Kandan!"
+ warn_no_approved_user: "There are no users. Invite others to join Kandan!"
diff --git a/config/locales/devise.en.yml b/config/locales/en/devise.en.yml
similarity index 67%
rename from config/locales/devise.en.yml
rename to config/locales/en/devise.en.yml
index ec9a38df..88c1f3d0 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/en/devise.en.yml
@@ -25,15 +25,42 @@ en:
signed_in: 'Signed in successfully.'
signed_out: 'Signed out successfully.'
passwords:
+ new:
+ head: "Forgot Password?"
+ email: "Email"
+ submit: "Submit"
+ edit:
+ head: "Change your password"
+ new: "New password"
+ confirm: "Confirm new password"
+ submit: "Change my password"
send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
updated: 'Your password was changed successfully. You are now signed in.'
updated_not_active: 'Your password was changed successfully.'
send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
confirmations:
+ resend_confirm:
+ head: "Resend confirmation instructions"
+ button: "Resend confirmation instructions"
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
confirmed: 'Your account was successfully confirmed. You are now signed in.'
registrations:
+ register_account: "Register an Account"
+ first_name: "First Name"
+ last_name: "Last Name"
+ email: "Email"
+ username: "Username"
+ password: "Password"
+ password_confirmation: "Password Confirmation"
+ register: "Register"
+ edit: "Edit"
+ avatar_url: "Avatar URL"
+ current_password: "Current Password"
+ cancel_account:
+ head: "Cancel My Account."
+ html: "
Unhappy with your service? We hate to see you go!
"
+ link: "Cancel my account"
signed_up: 'Welcome! You have signed up successfully.'
updated: 'You updated your account successfully.'
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
@@ -50,7 +77,21 @@ en:
mailer:
confirmation_instructions:
subject: 'Confirmation instructions'
+ message:
+ html: "
You can confirm your account through the link below: