Namespace
Methods
Class Public methods
new(locale:, site_id:, fallback: DB::SiteSettings.default_locale) Link
Source: show
# File app/services/service/translations.rb, line 3 def initialize(locale:, site_id:, fallback: DB::SiteSettings.default_locale) @locale = locale @fallback = fallback @site_id = site_id validate_locales end
Instance Public methods
get_translations_group_for_keys(group_keys = ["."]) Link
Source: show
# File app/services/service/translations.rb, line 10 def get_translations_group_for_keys(group_keys = ["."]) translations_group = HashWithIndifferentAccess.new group_keys.each do |key| build_group_for_locale(@locale, key, translations_group) build_group_for_locale(@fallback, key, translations_group) unless @locale == @fallback end translations_group end