Object
Responsibility:
- base for all repositories - fallback as empty repository, that cannot translate anything but does not crash
# File lib/fast_gettext/translation_repository/base.rb, line 20 def [](key) current_translations[key] end
# File lib/fast_gettext/translation_repository/base.rb, line 16 def available_locales [] end
# File lib/fast_gettext/translation_repository/base.rb, line 24 def plural(*keys) current_translations.plural(*keys) end
# File lib/fast_gettext/translation_repository/base.rb, line 34 def current_translations MoFile.empty end
# File lib/fast_gettext/translation_repository/base.rb, line 38 def find_files_in_locale_folders(relative_file_path,path) path ||= "locale" raise "path #{path} could not be found!" unless File.exist?(path) @files = {} Dir[File.join(path,'*')].each do |locale_folder| next unless File.basename(locale_folder) =~ LOCALE_REX file = File.join(locale_folder,relative_file_path).untaint next unless File.exist? file locale = File.basename(locale_folder) @files[locale] = yield(locale,file) end end
Generated with the Darkfish Rdoc Generator 2.