From 6dab9927c68edb5ceac2b1cd8714ae4fbf0bd654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 20 Mar 2013 10:51:28 +0100 Subject: [PATCH] ensure locales are not overwritten --- spec/integrity/i18n_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/integrity/i18n_spec.rb b/spec/integrity/i18n_spec.rb index 381adb4c601..b8eee52ef37 100644 --- a/spec/integrity/i18n_spec.rb +++ b/spec/integrity/i18n_spec.rb @@ -21,5 +21,17 @@ describe "i18n integrity checks" do end end + it "does not overwrite another language" do + Dir["#{Rails.root}/config/locales/*.yml"].each do |f| + locale = /.*\.([^.]{2,})\.yml$/.match(f)[1] + ':' + IO.foreach(f) do |line| + next if line.start_with? "#" + next if line.start_with? "---" + next if line.strip!.blank? + line.should eq locale + break + end + end + end end