Sha256: ed74348617b08be0e31f6dffccda53ec474b30a8286f65f91197283083ae3c01

Contents?: true

Size: 956 Bytes

Versions: 2

Compression:

Stored size: 956 Bytes

Contents

# frozen_string_literal: true

module LokaliseRails
  # Inherits from LokaliseManager::GlobalConfig to provide a global configuration specific to the LokaliseRails gem.
  # This class is primarily used to manage configuration settings that affect how the LokaliseRails gem operates
  # within a Ruby on Rails application, particularly in managing locale paths.
  class GlobalConfig < LokaliseManager::GlobalConfig
    class << self
      # Provides the path to the locales directory where translation files are stored. If not set explicitly,
      # it defaults to the `config/locales` directory within the root of the application using this gem.
      #
      # @return [String] the path to the locales directory
      def locales_path
        # If @locales_path is not set, it defaults to a path under the application's root directory.
        @locales_path || "#{LokaliseRails::Utils.root}/config/locales"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lokalise_rails-8.0.0 lib/lokalise_rails/global_config.rb
lokalise_rails-7.1.0 lib/lokalise_rails/global_config.rb