Sha256: 92795203e42cbe4a384885916c8e7dd09f802cea8a10a70eb9b92f25ea9408c6

Contents?: true

Size: 520 Bytes

Versions: 14

Compression:

Stored size: 520 Bytes

Contents

# frozen_string_literal: true

require_relative 'language'
require_relative 'region'

module LittleWeasel
  module Modules
    # This module provides methods to handle conversion of parts of a locale to
    # their string counter parts.
    module Locale
      include Language
      include Region

      def locale
        language = normalize_language self.language
        return language.to_s unless region?

        region = normalize_region self.region
        "#{language}-#{region}"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
LittleWeasel-5.0.13 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.12 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.11 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.10 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.9 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.8 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.7 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.6 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.5 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.4 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.3 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.2 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.1 lib/LittleWeasel/modules/locale.rb
LittleWeasel-5.0.0 lib/LittleWeasel/modules/locale.rb