diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f1de6a20..1b8a62e8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -101,7 +101,7 @@ class ApplicationController < ActionController::Base locale = if user && user.language != 'default' user.language else - http_accept_language.language_region_compatible_from(I18n.available_locales) + Rails.configuration.default_locale.presence || http_accept_language.language_region_compatible_from(I18n.available_locales) end begin diff --git a/config/application.rb b/config/application.rb index c310537d..e47e7543 100644 --- a/config/application.rb +++ b/config/application.rb @@ -131,6 +131,9 @@ module Greenlight # File types allowed in preupload presentation config.allowed_file_types = ".doc,.docx,.ppt,.pptx,.pdf,.xls,.xlsx,.txt,.rtf,.odt,.ods,.odp,.odg,.odc,.odi,.jpg,.jpeg,.png" + # Default locale + config.default_locale = ENV["DEFAULT_LOCALE"] + # DEFAULTS # Default branding image if the user does not specify one diff --git a/sample.env b/sample.env index c59bba94..52226c65 100644 --- a/sample.env +++ b/sample.env @@ -201,6 +201,15 @@ MAINTENANCE_WINDOW= # Button can be disabled by setting the value to blank HELP_URL=https://docs.bigbluebutton.org/greenlight/gl-overview.html +# Change the default language +# +# By default, Greenlight will appear in the same language as that specific user's browser. +# The user can override this by going into their profile and changing the language. +# You can override the default language to a specific language instead of the browser's language by setting +# the variable below. To find the correct value, visit: https://github.com/bigbluebutton/greenlight/tree/v2/config/locales +# and find the code that matches the language you want. Ex: For Arabic -> DEFAULT_LOCALE=ar, For Italian -> DEFAULT_LOCALE=it +# DEFAULT_LOCALE= + # Force a redirect to HTTPS and make cookies secure. # WARNING: Only set this to false for a development environment. ENABLE_SSL=true