Sha256: c3aacd8af20bca0161bd21db81586b15f0320b029c2d356018dce94de1b85ddf

Contents?: true

Size: 419 Bytes

Versions: 3

Compression:

Stored size: 419 Bytes

Contents

module SwaggerUiEngineRails7
  module TranslationHelper
    def load_translation_file
      return unless translator_enabled?
      javascript_include_tag('swagger_ui_engine/lang/translator', lang_file_path)
    end

    def lang_file_path
      "swagger_ui_engine/lang/#{I18n.locale.to_s.downcase}.js"
    end

    def translator_enabled?
      SwaggerUiEngineRails7.configuration.translator_enabled
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
swagger_ui_engine_rails7-1.2.5 app/helpers/swagger_ui_engine_rails7/translation_helper.rb
swagger_ui_engine_rails7-1.2.4 app/helpers/swagger_ui_engine_rails7/translation_helper.rb
swagger_ui_engine_rails7-1.2.3 app/helpers/swagger_ui_engine/translation_helper.rb