]> cat aescling's git repositories - mastodon.git/blob - config/application.rb
New Crowdin translations (#11861)
[mastodon.git] / config / application.rb
1 require_relative 'boot'
2
3 require 'rails/all'
4
5 # Require the gems listed in Gemfile, including any gems
6 # you've limited to :test, :development, or :production.
7 Bundler.require(*Rails.groups)
8
9 require_relative '../app/lib/exceptions'
10 require_relative '../lib/paperclip/lazy_thumbnail'
11 require_relative '../lib/paperclip/gif_transcoder'
12 require_relative '../lib/paperclip/video_transcoder'
13 require_relative '../lib/paperclip/type_corrector'
14 require_relative '../lib/mastodon/snowflake'
15 require_relative '../lib/mastodon/version'
16 require_relative '../lib/devise/ldap_authenticatable'
17
18 Dotenv::Railtie.load
19
20 Bundler.require(:pam_authentication) if ENV['PAM_ENABLED'] == 'true'
21
22 require_relative '../lib/mastodon/redis_config'
23
24 module Mastodon
25 class Application < Rails::Application
26 # Initialize configuration defaults for originally generated Rails version.
27 config.load_defaults 5.2
28
29 # Settings in config/environments/* take precedence over those specified here.
30 # Application configuration should go into files in config/initializers
31 # -- all .rb files in that directory are automatically loaded.
32
33 # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
34 # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
35 # config.time_zone = 'Central Time (US & Canada)'
36
37 # All translations from config/locales/*.rb,yml are auto loaded.
38 # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
39 config.i18n.available_locales = [
40 :en,
41 :ar,
42 :ast,
43 :bg,
44 :bn,
45 :ca,
46 :co,
47 :cs,
48 :cy,
49 :da,
50 :de,
51 :el,
52 :eo,
53 :es,
54 :eu,
55 :fa,
56 :fi,
57 :fr,
58 :ga,
59 :gl,
60 :he,
61 :hi,
62 :hr,
63 :hu,
64 :hy,
65 :id,
66 :io,
67 :it,
68 :ja,
69 :ka,
70 :kk,
71 :ko,
72 :lt,
73 :lv,
74 :ms,
75 :nl,
76 :no,
77 :oc,
78 :pl,
79 :'pt-PT',
80 :'pt-BR',
81 :ro,
82 :ru,
83 :sk,
84 :sl,
85 :sq,
86 :sr,
87 :'sr-Latn',
88 :sv,
89 :ta,
90 :te,
91 :th,
92 :tr,
93 :uk,
94 :'zh-CN',
95 :'zh-HK',
96 :'zh-TW',
97 ]
98
99 config.i18n.default_locale = ENV['DEFAULT_LOCALE']&.to_sym
100
101 unless config.i18n.available_locales.include?(config.i18n.default_locale)
102 config.i18n.default_locale = :en
103 end
104
105 # config.paths.add File.join('app', 'api'), glob: File.join('**', '*.rb')
106 # config.autoload_paths += Dir[Rails.root.join('app', 'api', '*')]
107
108 config.active_job.queue_adapter = :sidekiq
109
110 config.middleware.use Rack::Attack
111 config.middleware.use Rack::Deflater
112
113 config.to_prepare do
114 Doorkeeper::AuthorizationsController.layout 'modal'
115 Doorkeeper::AuthorizedApplicationsController.layout 'admin'
116 Doorkeeper::Application.send :include, ApplicationExtension
117 Devise::FailureApp.send :include, AbstractController::Callbacks
118 Devise::FailureApp.send :include, HttpAcceptLanguage::EasyAccess
119 Devise::FailureApp.send :include, Localized
120 end
121 end
122 end
This page took 0.099838 seconds and 4 git commands to generate.