OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/config/initializers/i18n.rb

16 lines
722 B

# load custom translation rules, as stored in config/locales/plurals.rb
# to be aware of e.g. Japanese not having a plural from for nouns
require 'open_project/translations/pluralization_backend'
I18n::Backend::Simple.include OpenProject::Translations::PluralizationBackend
# Adds fallback to default locale for untranslated strings
I18n::Backend::Simple.include I18n::Backend::Fallbacks
# As we enabled +config.i18n.fallbacks+, Rails will fall back
# to the default locale.
# When other locales are available, fall back to them.
if Setting.table_exists? # don't want to prevent migrations
defaults = Set.new I18n.fallbacks.defaults + Setting.available_languages.map(&:to_sym)
I18n.fallbacks.defaults = defaults
end