Sha256: 08f27d21bec1a711eaaea0ec17f9570d2d8e5524b503f44205a307469416b613

Contents?: true

Size: 1.95 KB

Versions: 4

Compression:

Stored size: 1.95 KB

Contents

require 'active_support/core_ext/class/attribute_accessors'

module Tolk
  module Config


    class << self
      # Mapping : a hash of the type { 'ar'    => 'Arabic' }
      attr_accessor :mapping

      # Dump locale path by default the locales folder (config/locales)
      attr_accessor :dump_path

      def reset
        @dump_path = Proc.new { "#{Rails.application.root}/config/locales" }

        @mapping = {
          'ar'    => 'Arabic',
          'bs'    => 'Bosnian',
          'bg'    => 'Bulgarian',
          'ca'    => 'Catalan',
          'cs'    => 'Czech',
          'da'    => 'Danish',
          'de'    => 'German',
          'el'    => 'Greek',
          'en'    => 'English',
          'es'    => 'Spanish',
          'et'    => 'Estonian',
          'fa'    => 'Persian',
          'fi'    => 'Finnish',
          'fr'    => 'French',
          'he'    => 'Hebrew',
          'hr'    => 'Croatian',
          'hu'    => 'Hungarian',
          'id'    => 'Indonesian',
          'is'    => 'Icelandic',
          'it'    => 'Italian',
          'ja'    => 'Japanese',
          'ko'    => 'Korean',
          'lo'    => 'Lao',
          'lt'    => 'Lithuanian',
          'lv'    => 'Latvian',
          'mk'    => 'Macedonian',
          'nl'    => 'Dutch',
          'no'    => 'Norwegian',
          'pl'    => 'Polish',
          'pt-BR' => 'Portuguese (Brazilian)',
          'pt-PT' => 'Portuguese (Portugal)',
          'ro'    => 'Romanian',
          'ru'    => 'Russian',
          'sv'    => 'Swedish',
          'sk'    => 'Slovak',
          'sl'    => 'Slovene',
          'sr'    => 'Serbian',
          'sw'    => 'Swahili',
          'th'    => 'Thai',
          'tr'    => 'Turkish',
          'uk'    => 'Ukrainian',
          'vi'    => 'Vietnamese',
          'zh-CN' => 'Chinese (Simplified)',
          'zh-TW' => 'Chinese (Traditional)'
        }
      end
    end

    # Set default values for configuration options on load
    self.reset
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tolk-1.3.11 lib/tolk/config.rb
tolk-1.3.10 lib/tolk/config.rb
tolk-1.3.9 lib/tolk/config.rb
tolk-1.3.8 lib/tolk/config.rb