Class: GovukDocumentTypes::TranslationsRailtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/govuk_document_types/translations_railtie.rb

Class Method Summary collapse

Class Method Details

.add(pattern) ⇒ Object



11
12
13
14
# File 'lib/govuk_document_types/translations_railtie.rb', line 11

def self.add(pattern)
  files = Dir[File.join(File.dirname(__FILE__), "../..", pattern)]
  I18n.load_path.concat(files)
end

.pattern_from(args) ⇒ Object



16
17
18
19
# File 'lib/govuk_document_types/translations_railtie.rb', line 16

def self.pattern_from(args)
  array = Array(args || [])
  array.blank? ? "*" : "{#{array.join ','}}"
end