<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lang/rails/mg.yml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -186,6 +186,7 @@ Mariano Ayesa (Spanish Spain and Argentina localization)
 jyrkij http://github.com/jyrkij (Finnish)
 Ilke Akdeniz (Turkish)
 Dejan Dimic (Serbian)
+Tosoa Bacca (Malagasy)
 
 your name here if you submit a patch :)
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -186,6 +186,7 @@ Mariano Ayesa (Spanish Spain and Argentina localization)
 jyrkij http://github.com/jyrkij (Finnish)
 Ilke Akdeniz (Turkish)
 Dejan Dimic (Serbian)
+Tosoa Bacca (Malagasy)
 
 your name here if you submit a patch :)
 </diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,16 @@
 namespace :globalite do
   namespace :localization do
 
+    # Returns a hash of localizations in org_base.yml
+    def load_localizations(org_base=&quot;en-US&quot;)
+      @localizations = {}
+      filename = RAILS_ROOT + &quot;/lang/ui/#{org_base}.yml&quot;
+      File.open(filename) do |file|
+        @localizations = YAML.load(file)
+      end if File.exists?(filename)
+      @localizations
+    end
+    
     # Returns a hash with the missing localizations compared to the original locale 
     def missing_localizations(org_base='en-US')
       @langs = {}
@@ -43,5 +53,28 @@ namespace :globalite do
       end  
     end
 
+    desc &quot;Create and/or append all non-translated symbols from views , helpers &amp; controllers to the org_base file&quot;
+    task :localize =&gt; :environment do
+      @org_base     = ENV['BASE_LOCALE'] || 'en-US'
+      @localizations = load_localizations(@org_base)
+      @new_localizations = {} # we don't want to keep unused keys
+      @files = Dir[File.join( RAILS_ROOT, '/app/**/*')]
+      @files.each do |file|
+        File.open(file) do |res|
+          res.each do |line|
+            line.scan(/:([\w\d_]*)\.l(?:ocalize|_with_args)?(?:\s*\(?\s*[&quot;']([^&quot;']*)[&quot;']\s*\))?/) do |key, value|
+              if @localizations.has_key?(key) 
+                @new_localizations[key] = @localizations[key] # we keep the old localizations
+              else
+                @new_localizations[key] = value
+              end
+            end
+          end
+        end if File.file?(file)
+      end
+      File.open(RAILS_ROOT + &quot;/lang/ui/#{@org_base}.yml&quot;, &quot;w+&quot;) do |l_file|
+        YAML.dump(@new_localizations, l_file)
+      end
+    end
   end
 end
\ No newline at end of file</diff>
      <filename>tasks/globalite_tasks.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b6d7aa43eace99e701bc1e16a989444991e27769</id>
    </parent>
  </parents>
  <author>
    <name>tosoa</name>
    <email>tosoa@lunatex.local</email>
  </author>
  <url>http://github.com/mattetti/globalite/commit/01b2c8355b773bf0c0efe84e2648d7a0eac4f828</url>
  <id>01b2c8355b773bf0c0efe84e2648d7a0eac4f828</id>
  <committed-date>2008-06-15T13:19:00-07:00</committed-date>
  <authored-date>2008-06-15T13:19:00-07:00</authored-date>
  <message>added malagasy localization - and a rake task to create the localization.yaml file</message>
  <tree>3c60a2da6aa9fb8e9566d622d96c0a7cfcc85e7b</tree>
  <committer>
    <name>tosoa</name>
    <email>tosoa@lunatex.local</email>
  </committer>
</commit>
