Localization added, but not implemented yet.
This commit is contained in:
12
src/bot.rb
12
src/bot.rb
@@ -15,10 +15,22 @@
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
require 'discordrb'
|
||||
require 'i18n'
|
||||
require_relative 'database'
|
||||
require_relative 'utils/locales_helper'
|
||||
|
||||
class FrugalityBot
|
||||
def initialize
|
||||
|
||||
I18n.config.enforce_available_locales = false
|
||||
|
||||
locales_path = File.join(File.dirname(__dir__), 'locales')
|
||||
I18n.load_path += Dir["#{locales_path}/*.yml"]
|
||||
|
||||
I18n.backend.load_translations
|
||||
I18n.default_locale = :en
|
||||
|
||||
|
||||
@bot = Discordrb::Bot.new(
|
||||
token: ENV['BOT_TOKEN'],
|
||||
intents: [:servers, :server_messages]
|
||||
|
||||
Reference in New Issue
Block a user