localize controllers

This commit is contained in:
Joshua Arts 2018-07-19 16:04:08 -04:00
parent ce4c8b3bff
commit c5cfc621ca
4 changed files with 8 additions and 7 deletions

View File

@ -64,12 +64,12 @@ class ApplicationController < ActionController::Base
# Default, unconfigured meeting options.
def default_meeting_options
invite_msg = "To invite someone to the meeting, send them this link:"
invite_msg = I18n.t("invite_message")
{
user_is_moderator: false,
meeting_logout_url: request.base_url + logout_room_path(@room),
meeting_recorded: true,
moderator_message: "#{invite_msg}\n\n #{request.base_url + room_path(@room)}",
moderator_message: "#{invite_msg}\n\n#{request.base_url + room_path(@room)}",
}
end
end

View File

@ -1,8 +1,6 @@
# frozen_string_literal: true
class SessionsController < ApplicationController
LOGIN_FAILED = "Login failed due to invalid credentials. Are you sure you typed them correctly?"
# GET /users/logout
def destroy
logout
@ -15,7 +13,7 @@ class SessionsController < ApplicationController
if user.try(:authenticate, session_params[:password])
login(user)
else
redirect_to root_path, notice: LOGIN_FAILED
redirect_to root_path, notice: I18n.t("login_failed")
end
end

View File

@ -59,14 +59,14 @@ class UsersController < ApplicationController
if errors.empty? && @user.save
# Notify the user that their account has been updated.
redirect_to edit_user_path(@user), notice: "Information successfully updated."
redirect_to edit_user_path(@user), notice: I18n.t("info_update_success")
else
# Append custom errors.
errors.each { |k, v| @user.errors.add(k, v) }
render :edit
end
elsif @user.update_attributes(user_params)
redirect_to edit_user_path(@user), notice: "Information successfully updated."
redirect_to edit_user_path(@user), notice: I18n.t("info_update_success")
else
render :edit
end

View File

@ -41,6 +41,8 @@ en:
home: Home room
settings: Settings
signout: Sign out
info_update_success: Information successfully updated.
invite_message: "To invite someone to the meeting, send them this link:"
landing:
about: A simple front end for your BigBlueButton Open Source Web Conferencing Server.
welcome: Welcome to Greenlight.
@ -48,6 +50,7 @@ en:
upgrade: Show me how to upgrade to 2.0!
version: We've released a new version of Greenlight, but your database isn't compatible.
login: Login
login_failed: Login failed due to invalid credentials. Are you sure you typed them correctly?
modal:
create_room:
auto_join: Automatically join me into the room.