Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eandrejko/31e5aa46c8d5544df994 to your computer and use it in GitHub Desktop.
Save eandrejko/31e5aa46c8d5544df994 to your computer and use it in GitHub Desktop.
From 0f78adcd6572fc2619c8809c52e82a284d339372 Mon Sep 17 00:00:00 2001
From: Erik Andrejko <erik@shopittome.com>
Date: Tue, 2 Feb 2010 14:40:45 -0800
Subject: [PATCH] added dup to result returned by lookup_key to avoid modification of translation keys
---
lib/i18n/backend/base.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/i18n/backend/base.rb b/lib/i18n/backend/base.rb
index 7b2e876..156c94b 100644
--- a/lib/i18n/backend/base.rb
+++ b/lib/i18n/backend/base.rb
@@ -117,7 +117,7 @@ module I18n
return nil unless result.is_a?(Hash) && result.has_key?(key)
result = result[key]
result = resolve(locale, key, result, options) if result.is_a?(Symbol)
- result
+ result.dup
end
end
--
1.6.2.2+GitX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment