lib/i18n-spec/models/locale_file.rb in i18n-spec-0.0.3 vs lib/i18n-spec/models/locale_file.rb in i18n-spec-0.0.4
- old
+ new
@@ -20,9 +20,17 @@
return false unless pluralization.keys.all? {|k| PLURALIZATION_KEYS.include?(k)}
end
true
end
+ def has_one_top_level_namespace?
+ translations.keys.size == 1
+ end
+
+ def is_named_like_top_level_namespace?
+ translations.keys.first == File.basename(@filepath, File.extname(@filepath))
+ end
+
protected
def translations
@translations ||= Psych.load_file(@filepath)
end
\ No newline at end of file