Logo
Explore Help
Sign In
IntenseWebs/discourse
3
0
Fork 0
You've already forked discourse
mirror of https://github.com/discourse/discourse.git synced 2025-02-25 18:55:32 -06:00
Code Issues Packages Projects Releases Wiki Activity
Files
bb1d0dea8a5840aceffe2a9fc2e2f7aeb0d9f320
discourse/config/initializers/i18n.rb

9 lines
271 B
Ruby
Raw Normal View History

FEATURE: Localization fallbacks (server-side) The FallbackLocaleList object tells I18n::Backend::Fallbacks what order the languages should be attempted in. Because of the translate_accelerator patch, the SiteSetting.default_locale is *not* guaranteed to be fully loaded after the server starts, so a call to ensure_loaded! is added after the locale is set for the current user. The declarations of config.i18n.fallbacks = true in the environment files were actually garbage, because the I18n.default_locale was SiteSetting.default_locale, so there was nothing to fall back to. *derp*
2015-07-15 09:04:45 -07:00
# order: after 02-freedom_patches.rb
Refactor to our own Discourse I18n backend This removes some monkey patches and makes testing easier. It will also support database backed I18n changes.
2015-11-13 15:42:01 -05:00
require 'i18n/backend/discourse_i18n'
I18n.backend = I18n::Backend::DiscourseI18n.new
Always use locale fallback on server
2015-09-02 21:28:50 +02:00
I18n.config.missing_interpolation_argument_handler = proc { throw(:exception) }
PERF: Much more performant, multisite aware I18n overrides
2015-11-19 16:36:59 -05:00
I18n.reload!
Refresh I18n customizations on change
2015-11-17 16:14:42 -05:00
MessageBus.subscribe("/i18n-flush") { I18n.reload! }
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 114ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API