Sha256: 8c4a2c5bd76914816559aa2915b20542976d7748240056e0a25a3a0e9c3f952c
Contents?: true
Size: 721 Bytes
Versions: 6
Compression:
Stored size: 721 Bytes
Contents
module MiradorRails class Locale attr_reader :language def initialize(language) @language = language end def path "#{language}/translation.json" end def file_source raise MiradorRails::Exceptions::LocaleNotFound, "Could not find #{path}" if file.blank? file.source.force_encoding('UTF-8') end def file # Rails.application.assets is `nil` in production mode (where compile assets is enabled). # This workaround is based off of this comment: https://github.com/fphilipe/premailer-rails/issues/145#issuecomment-225992564 (Rails.application.assets || ::Sprockets::Railtie.build_environment(Rails.application)).find_asset(path) end end end
Version data entries
6 entries across 6 versions & 1 rubygems