Commit d5f224bb79f314d656e2f6d21b160e428be36418
Committed by
Rodrigo Souto
1 parent
a5c0c0f3
Exists in
master
and in
27 other branches
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,9 +6,15 @@ class Object | ||
6 | alias :ngettext :n_ | 6 | alias :ngettext :n_ |
7 | end | 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 | # translations in place? | 16 | # translations in place? |
10 | locale_dir = Rails.root.join('locale') | 17 | locale_dir = Rails.root.join('locale') |
11 | -repos = [] | ||
12 | if File.exists?(locale_dir) | 18 | if File.exists?(locale_dir) |
13 | repos << FastGettext::TranslationRepository.build('noosfero', :type => 'mo', :path => locale_dir) | 19 | repos << FastGettext::TranslationRepository.build('noosfero', :type => 'mo', :path => locale_dir) |
14 | repos << FastGettext::TranslationRepository.build('iso_3166', :type => 'mo', :path => locale_dir) | 20 | repos << FastGettext::TranslationRepository.build('iso_3166', :type => 'mo', :path => locale_dir) |