]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/available_locales.rb
First stage of i18n. Some migrations and extra plugins.
[rails.git] / config / initializers / available_locales.rb
diff --git a/config/initializers/available_locales.rb b/config/initializers/available_locales.rb
new file mode 100644 (file)
index 0000000..171d0c6
--- /dev/null
@@ -0,0 +1,24 @@
+# Get loaded locales conveniently
+# See http://rails-i18n.org/wiki/pages/i18n-available_locales
+module I18n
+  class << self
+    def available_locales; backend.available_locales; end
+  end
+  module Backend
+    class Simple
+      def available_locales; translations.keys.collect { |l| l.to_s }.sort; end
+        def langs; translations.values end
+    end
+  end
+end
+
+# You need to "force-initialize" loaded locales
+I18n.backend.send(:init_translations)
+
+#AVAILABLE_LOCALES = I18n.backend.available_locales
+#RAILS_DEFAULT_LOGGER.debug "* Loaded locales: #{AVAILABLE_LOCALES.inspect}"
+
+LANGUAGES = 
+{ "en" => "English",
+  "de" => "Deutsch"
+  }