<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,15 +1,29 @@
-module Radiant
-  module AvailableLocales
+module Radiant::AvailableLocales
     
-    def self.locales
-      locales = Dir.new(&quot;#{RADIANT_ROOT}/config/locales/&quot;).entries.collect do |x|
-        x =~ /\.yml/ ? x.sub(/\.yml/,&quot;&quot;) : nil
-      end.compact.each_with_object({}) do |str, hsh|
-        locale_file = YAML.load_file(&quot;#{RADIANT_ROOT}/config/locales/&quot; + &quot;/&quot; + str + &quot;.yml&quot;)
-        hsh[locale_file[str][&quot;this_file_language&quot;]] = str if locale_file.has_key? str
-      end.freeze
-      locales
+  def self.locales
+    root_locales = [File.join(RADIANT_ROOT, 'config', 'locales'), File.join(RADIANT_ROOT, 'config', 'locales')].uniq
+    all_locale_paths = unless root_locales.empty?
+      Radiant::ExtensionLoader.locale_paths.dup + root_locales
+    else
+      Radiant::ExtensionLoader.locale_paths
     end
+
+    available_locales = {}
     
+    all_locale_paths.each do |path|    
+    	if File.exists? path
+    		Dir.new(path).entries.collect do |x|
+    		  result = x =~ /\.yml/ ? x.sub(/\.yml/,&quot;&quot;) : nil
+    		  # filters out the available_tags files
+    		  result =~ /\_available_tags/ ? nil : result
+    		end.compact.each do |str|
+      	  locale_file = YAML.load_file(path + &quot;/&quot; + str + &quot;.yml&quot;)
+      	  lang = locale_file[str][&quot;this_file_language&quot;] if locale_file[str]
+      	  available_locales.merge! Hash[lang, str] if lang
+      	end.freeze
+    	end
+    end
+    available_locales
   end
+
 end
\ No newline at end of file</diff>
      <filename>lib/radiant/available_locales.rb</filename>
    </modified>
    <modified>
      <diff>@@ -53,11 +53,11 @@ module Radiant
     end
     
     def locale_paths
-      load_extension_roots.map { |extension|  Dir[File.join(&quot;#{extension}/config/locales&quot; , '*.{rb,yml}')]  }.flatten
+      load_extension_roots.map { |extension| &quot;#{extension}/config/locales&quot; }.select { |d| File.directory?(d) }.reverse
     end
     
     def add_locale_paths
-      configuration.i18n.load_path.concat(locale_paths)
+      configuration.i18n.load_path.concat(locale_paths.map{ |path| Dir[File.join(&quot;#{path}&quot;,&quot;*.{rb,yml}&quot;)] })
     end
 
     def controller_paths</diff>
      <filename>lib/radiant/extension_loader.rb</filename>
    </modified>
    <modified>
      <diff>@@ -170,7 +170,7 @@ end_error
     def initialize_i18n
       extension_loader.add_locale_paths
       radiant_locale_paths = Dir[File.join(RADIANT_ROOT, 'config', 'locales', '*.{rb,yml}')]
-      extension_loader.configuration.i18n.load_path = radiant_locale_paths + extension_loader.configuration.i18n.load_path
+      configuration.i18n.load_path = radiant_locale_paths + extension_loader.configuration.i18n.load_path
       super
     end
 </diff>
      <filename>lib/radiant/initializer.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ff944b1e5f12c1c405fdbab49c3de04738162332</id>
    </parent>
  </parents>
  <author>
    <name>Keith</name>
    <email>keith@keithbingman.com</email>
  </author>
  <url>http://github.com/radiant/radiant/commit/a4d595b9bad693495eb8b4970d78d29c158c312f</url>
  <id>a4d595b9bad693495eb8b4970d78d29c158c312f</id>
  <committed-date>2009-10-12T10:36:06-07:00</committed-date>
  <authored-date>2009-10-12T10:36:06-07:00</authored-date>
  <message>moving langauages to extensions, for easy distribution and maintenence</message>
  <tree>1f87b921d5e6ffa01ff26fd612be255fa34c0415</tree>
  <committer>
    <name>Keith</name>
    <email>keith@keithbingman.com</email>
  </committer>
</commit>
