]> git.openstreetmap.org Git - rails.git/blob - vendor/plugins/i18n_data/lib/i18n_data.rb
Added localized language names with plugin from http://github.com/grosser/i18n_data...
[rails.git] / vendor / plugins / i18n_data / lib / i18n_data.rb
1 require 'activesupport'
2 module I18nData
3   extend self
4   
5   def languages(language_code='EN')
6     data_provider.codes(:languages,language_code.to_s.upcase)
7   end
8
9   def countries(language_code='EN')
10     data_provider.codes(:countries,language_code.to_s.upcase)
11   end
12
13   def data_provider
14     if @data_provider
15       @data_provider
16     else
17       require 'i18n_data/file_data_provider'
18       FileDataProvider
19     end
20   end
21
22   def data_provider=(provider)
23     @data_provider = provider
24   end
25   
26   class NoTranslationAvailable < Exception
27     def to_s
28       "NoTranslationAvailable -- #{super}"
29     end
30   end
31 end