Following locales are now available by default: * "bg" (Bulgarian): 98,5% translated * "ca" (Catalan): 100 % translated * "es-PE" (Spanish from Perú): 64,8% translated * "eu" (Euskara): 67,8% translated * "ka" (Georgian): 98,9% translated * "oc" (Occitan): 98,9% translated * "ro" (Romanian): 99,1% translated Spanish and Euskara were enabled becuase both are near the 70% and its fallback language (Spanish) is complete. Add custom fallbacks: * Catalan (ca) => Español (es). * Español de Perú (es-PE) => Español (es). * Euskara (eu) => Español (es). * Portuguese-Brazilero (pt-BR) => Español (es). * Occitan (oc) => French (fr)
107 lines
3.0 KiB
Ruby
107 lines
3.0 KiB
Ruby
require_relative "boot"
|
|
|
|
require "rails/all"
|
|
|
|
# Require the gems listed in Gemfile, including any gems
|
|
# you've limited to :test, :development, or :production.
|
|
Bundler.require(*Rails.groups)
|
|
|
|
module Consul
|
|
class Application < Rails::Application
|
|
# Settings in config/environments/* take precedence over those specified here.
|
|
# Application configuration should go into files in config/initializers
|
|
# -- all .rb files in that directory are automatically loaded.
|
|
|
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
# config.time_zone = 'Central Time (US & Canada)'
|
|
|
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
config.i18n.default_locale = :en
|
|
available_locales = [
|
|
"ar",
|
|
"bg",
|
|
"bs",
|
|
"ca",
|
|
"cs",
|
|
"da",
|
|
"de",
|
|
"el",
|
|
"en",
|
|
"es",
|
|
"es-PE",
|
|
"eu",
|
|
"fa",
|
|
"fr",
|
|
"gl",
|
|
"he",
|
|
"hr",
|
|
"id",
|
|
"it",
|
|
"ka",
|
|
"nl",
|
|
"oc",
|
|
"pl",
|
|
"pt-BR",
|
|
"ro",
|
|
"ru",
|
|
"sl",
|
|
"sq",
|
|
"so",
|
|
"sv",
|
|
"tr",
|
|
"val",
|
|
"zh-CN",
|
|
"zh-TW"]
|
|
config.i18n.available_locales = available_locales
|
|
config.i18n.fallbacks = {
|
|
"ca" => "es",
|
|
"es-PE" => "es",
|
|
"eu" => "es",
|
|
"fr" => "es",
|
|
"gl" => "es",
|
|
"it" => "es",
|
|
"oc" => "fr",
|
|
"pt-BR" => "es",
|
|
"val" => "es"
|
|
}
|
|
|
|
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "**[^custom]*", "*.{rb,yml}")]
|
|
config.i18n.load_path += Dir[Rails.root.join("config", "locales", "custom", "**", "*.{rb,yml}")]
|
|
|
|
config.after_initialize do
|
|
Globalize.set_fallbacks_to_all_available_locales
|
|
end
|
|
|
|
config.assets.paths << Rails.root.join("app", "assets", "fonts")
|
|
config.assets.paths << Rails.root.join("vendor", "assets", "fonts")
|
|
|
|
# Add lib to the autoload path
|
|
config.autoload_paths << Rails.root.join("lib")
|
|
config.time_zone = "Madrid"
|
|
config.active_job.queue_adapter = :delayed_job
|
|
|
|
# CONSUL specific custom overrides
|
|
# Read more on documentation:
|
|
# * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md
|
|
# * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md
|
|
#
|
|
config.autoload_paths << "#{Rails.root}/app/controllers/custom"
|
|
config.autoload_paths << "#{Rails.root}/app/models/custom"
|
|
config.paths["app/views"].unshift(Rails.root.join("app", "views", "custom"))
|
|
end
|
|
end
|
|
|
|
class Rails::Engine
|
|
initializer :prepend_custom_assets_path, group: :all do |app|
|
|
if self.class.name == "Consul::Application"
|
|
%w[images fonts javascripts].each do |asset|
|
|
app.config.assets.paths.unshift(Rails.root.join("app", "assets", asset, "custom").to_s)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
require "./config/application_custom.rb"
|