Method: GetText::LocalePath#current_path

Defined in:
lib/gettext/locale_path.rb

#current_path(lang) ⇒ Object

Gets the current path.

  • lang: a Locale::Tag.


105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/gettext/locale_path.rb', line 105

def current_path(lang)
  lang_candidates = lang.candidates

  lang_candidates.each do |tag|
    path = @locale_paths[tag.to_s]
    warn "GetText::TextDomain#load_mo: mo-file is #{path}" if $DEBUG
    return path if path
  end

  if $DEBUG
    warn "MO file is not found in"
    @locale_paths.each do |path|
      warn "  #{path[1]}"
    end
  end
  nil
end