<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,7 +5,7 @@ class Translation &lt; ActiveRecord::Base
   def validate
     unless locale.main?
       main_tr = counterpart_in_main
-      if main_tr
+      if main_tr &amp;&amp; !main_tr.text.blank?
         if main_tr.count_macros != count_macros
           errors.add(&quot;text&quot;, &quot;did not preserve macro variables, e.g. {{to_be_kept}}. Please do not change or translate the macros.&quot;)
         end
@@ -45,6 +45,22 @@ class Translation &lt; ActiveRecord::Base
   def counterpart_in_main
     Locale.find_main_cached.translations.find(:first, :conditions =&gt; { :namespace =&gt; namespace, :tr_key =&gt; tr_key })
   end
+  
+  # Corresponding translations will be copied to the new place in all locales where destination does not exist already
+  def safe_copy_to(new_namespace, new_key)
+    created_list = []
+    Locale.find(:all).each do |loc|
+      source = counterpart_in(loc)
+      target = loc.translations.find_or_initialize_by_namespace_and_tr_key(new_namespace, new_key)
+      
+      if source &amp;&amp; !source.text.blank? &amp;&amp; target.new_record?
+        target.text = source.text
+        target.save!
+        created_list &lt;&lt; target
+      end
+    end
+    created_list
+  end
 
   def self.pick(key, locale, namespace = nil)
     conditions = 'tr_key = ? AND locale_id = ?'</diff>
      <filename>lib/i18n_db/translation.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>40337e48daba31e1e6ac60a75b778de8e0fa6acc</id>
    </parent>
  </parents>
  <author>
    <name>yar</name>
    <email>yar@laptop</email>
  </author>
  <url>http://github.com/yar/i18n_db/commit/2ab5149404ea7c0c52e3e2de508b0b90612499f6</url>
  <id>2ab5149404ea7c0c52e3e2de508b0b90612499f6</id>
  <committed-date>2009-10-09T11:51:12-07:00</committed-date>
  <authored-date>2009-10-09T11:51:12-07:00</authored-date>
  <message>safe copy function</message>
  <tree>248cafe231486009abdf4be04d7d4804258cdaf0</tree>
  <committer>
    <name>yar</name>
    <email>yar@laptop</email>
  </committer>
</commit>
