Commit d5f224bb79f314d656e2f6d21b160e428be36418

Authored by Caio Tiago Oliveira
Committed by Rodrigo Souto
1 parent a5c0c0f3

L10n: support for custom locales

AI3113
Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
lib/noosfero/i18n.rb
... ... @@ -6,9 +6,15 @@ class Object
6 6 alias :ngettext :n_
7 7 end
8 8  
  9 +
  10 +custom_locale_dir = Rails.root.join('custom_locales', Rails.env)
  11 +repos = []
  12 +if File.exists?(custom_locale_dir)
  13 + repos << FastGettext::TranslationRepository.build('environment', :type => 'po', :path => custom_locale_dir)
  14 +end
  15 +
9 16 # translations in place?
10 17 locale_dir = Rails.root.join('locale')
11   -repos = []
12 18 if File.exists?(locale_dir)
13 19 repos << FastGettext::TranslationRepository.build('noosfero', :type => 'mo', :path => locale_dir)
14 20 repos << FastGettext::TranslationRepository.build('iso_3166', :type => 'mo', :path => locale_dir)
... ...