diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f159345b..e7a50839 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 41a623d8..1a5a5f3e 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 869df464..877cc49e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 4b2c8009..0ac42048 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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.