Permalink
Browse files

Ignore translations in the i18n namespace.

  • Loading branch information...
Craig Davey
Craig Davey committed Apr 19, 2010
1 parent eca137f commit ad72d42616eb65b75d778848a72642b9305777f0
Showing with 6 additions and 1 deletion.
  1. +4 −1 lib/tolk/sync.rb
  2. +2 −0 test/locales/sync/en.yml
View
@@ -12,7 +12,7 @@ def sync!
def load_translations
I18n.available_locales # force load
translations = flat_hash(I18n.backend.send(:translations)[primary_locale.name.to_sym])
- translations.merge(read_primary_locale_file)
+ filter_out_i18n_keys(translations.merge(read_primary_locale_file))
end
def read_primary_locale_file
@@ -70,6 +70,9 @@ def sync_phrases(translations)
end
end
+ def filter_out_i18n_keys(flat_hash)
+ flat_hash.reject { |key, value| key.starts_with? "i18n" }
+ end
end
end
View
@@ -3,3 +3,5 @@ en:
nested:
hello_country: Nested Hello Country
hello_world: Hello World
+ i18n:
+ plural: Locale specific pluralization rules

0 comments on commit ad72d42

Please sign in to comment.