module Greek::I18n

Constants

LOCALES_DIR
TRANSLITERATIONS
VERSION

Public Class Methods

ancient_greeklish(line) click to toggle source
# File lib/greek/i18n.rb, line 28
def self.ancient_greeklish(line)
  ::I18n.transliterate(line, locale: :ancient_greeklish)
end
atono(line) click to toggle source
# File lib/greek/i18n.rb, line 32
def self.atono(line)
  ::I18n.transliterate(line, locale: :atono)
end
greeklish(line) click to toggle source
# File lib/greek/i18n.rb, line 24
def self.greeklish(line)
  ::I18n.transliterate(line, locale: :greeklish)
end
setup() click to toggle source
# File lib/greek/i18n.rb, line 11
def self.setup
  TRANSLITERATIONS.each do |transliteration|
    locales_location = File.expand_path(LOCALES_DIR, __FILE__)
    locale_file = "#{locales_location}/#{transliteration}.yml"
    locale_obj = YAML.load_file(locale_file)
    locale = locale_obj[transliteration]["i18n"]
    ::I18n.backend.store_translations(
      transliteration.to_sym,
      i18n: locale
    )
  end
end