forked from External/greenlight
		
	localize controllers
This commit is contained in:
		@@ -64,12 +64,12 @@ class ApplicationController < ActionController::Base
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  # Default, unconfigured meeting options.
 | 
					  # Default, unconfigured meeting options.
 | 
				
			||||||
  def default_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,
 | 
					      user_is_moderator: false,
 | 
				
			||||||
      meeting_logout_url: request.base_url + logout_room_path(@room),
 | 
					      meeting_logout_url: request.base_url + logout_room_path(@room),
 | 
				
			||||||
      meeting_recorded: true,
 | 
					      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
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,6 @@
 | 
				
			|||||||
# frozen_string_literal: true
 | 
					# frozen_string_literal: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SessionsController < ApplicationController
 | 
					class SessionsController < ApplicationController
 | 
				
			||||||
  LOGIN_FAILED = "Login failed due to invalid credentials. Are you sure you typed them correctly?"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # GET /users/logout
 | 
					  # GET /users/logout
 | 
				
			||||||
  def destroy
 | 
					  def destroy
 | 
				
			||||||
    logout
 | 
					    logout
 | 
				
			||||||
@@ -15,7 +13,7 @@ class SessionsController < ApplicationController
 | 
				
			|||||||
    if user.try(:authenticate, session_params[:password])
 | 
					    if user.try(:authenticate, session_params[:password])
 | 
				
			||||||
      login(user)
 | 
					      login(user)
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      redirect_to root_path, notice: LOGIN_FAILED
 | 
					      redirect_to root_path, notice: I18n.t("login_failed")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,14 +59,14 @@ class UsersController < ApplicationController
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      if errors.empty? && @user.save
 | 
					      if errors.empty? && @user.save
 | 
				
			||||||
        # Notify the user that their account has been updated.
 | 
					        # 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
 | 
					      else
 | 
				
			||||||
        # Append custom errors.
 | 
					        # Append custom errors.
 | 
				
			||||||
        errors.each { |k, v| @user.errors.add(k, v) }
 | 
					        errors.each { |k, v| @user.errors.add(k, v) }
 | 
				
			||||||
        render :edit
 | 
					        render :edit
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    elsif @user.update_attributes(user_params)
 | 
					    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
 | 
					    else
 | 
				
			||||||
      render :edit
 | 
					      render :edit
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -41,6 +41,8 @@ en:
 | 
				
			|||||||
      home: Home room
 | 
					      home: Home room
 | 
				
			||||||
      settings: Settings
 | 
					      settings: Settings
 | 
				
			||||||
      signout: Sign out
 | 
					      signout: Sign out
 | 
				
			||||||
 | 
					  info_update_success: Information successfully updated.
 | 
				
			||||||
 | 
					  invite_message: "To invite someone to the meeting, send them this link:"
 | 
				
			||||||
  landing:
 | 
					  landing:
 | 
				
			||||||
    about: A simple front end for your BigBlueButton Open Source Web Conferencing Server.
 | 
					    about: A simple front end for your BigBlueButton Open Source Web Conferencing Server.
 | 
				
			||||||
    welcome: Welcome to Greenlight.
 | 
					    welcome: Welcome to Greenlight.
 | 
				
			||||||
@@ -48,6 +50,7 @@ en:
 | 
				
			|||||||
    upgrade: Show me how to upgrade to 2.0!
 | 
					    upgrade: Show me how to upgrade to 2.0!
 | 
				
			||||||
    version: We've released a new version of Greenlight, but your database isn't compatible.
 | 
					    version: We've released a new version of Greenlight, but your database isn't compatible.
 | 
				
			||||||
  login: Login
 | 
					  login: Login
 | 
				
			||||||
 | 
					  login_failed: Login failed due to invalid credentials. Are you sure you typed them correctly?
 | 
				
			||||||
  modal:
 | 
					  modal:
 | 
				
			||||||
    create_room:
 | 
					    create_room:
 | 
				
			||||||
      auto_join: Automatically join me into the room.
 | 
					      auto_join: Automatically join me into the room.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user