<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>install.rb</filename>
    </added>
    <added>
      <filename>test/view_translation_namespace_test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -78,8 +78,8 @@ See the wiki (http://www.globalize-rails.org/) for more documentation.
 
 From your rails app root directory:
 
-1. &lt;tt&gt;script/plugin install http://svn.globalize-rails.org/svn/globalize/globalize/trunk&lt;/tt&gt;
-1. &lt;tt&gt;rake globalize:setup&lt;/tt&gt; (might take a while, about a minute or so)
+1. &lt;tt&gt;script/plugin install http://svn.globalize-rails.org/svn/globalize/trunk&lt;/tt&gt;
+2. &lt;tt&gt;rake globalize:setup&lt;/tt&gt; (might take a while, about a minute or so)
 
 ...and you're globalized, dude!
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,86 @@
+Usage: script/generate globalize [tiny|internal] [lang|lang1,lang2...]
+
 Description:
-    Generates a new migration that creates and populates the &quot;globalize&quot; db tables.
-    All tables are prefixed with &quot;globalize_&quot;, so they won't conflict with 
-    other application tables. Run 'rake migrate' afterwards to synch the db.
+    Generates globalize specific migrations. The default migration creates and
+    populates the &quot;globalize&quot; db tables.
+    All tables are prefixed with &quot;globalize_&quot;, so they won't conflict with
+    other application tables. Run 'rake db:migrate' afterwards to synch the db.
+
+    You can also specify the extra argument &quot;tiny&quot; to generate a compact version
+    of the data files (major languages only).
+
+    Specify &quot;internal&quot; to generate a migration which adds the required
+    language-suffixed columns for those model attributes marked as translatable
+    when using the internal storage mechanism
+    (i.e. keep_translations_in_model is true.)
+
+
 
 Example:
+
+    Firstly, the command:
+
     ./script/generate globalize
 
-    This will create:
-	db/migrate/xxx_globalize.rb
\ No newline at end of file
+    will create:
+      db/migrate/xxx_globalize_migration.rb
+
+    which contains the db schema commands necessary to create the globalize tables
+    preloaded with a large amount of language/country data and certain translations
+    used for the ActionView date helper.
+
+    Secondly, the command:
+
+    ./script/generate globalize tiny
+
+    will also create:
+      db/migrate/xxx_globalize_migration.rb
+
+    but with a reduced amount of language and country data.
+
+
+  Assuming you have these two models:
+
+  class Product
+    self.keep_translations_in_model = true
+    translates :title
+  end
+
+  class Client
+    set_table_name :customers
+    self.keep_translations_in_model = true
+    translates :name
+  end
+
+  The following command:
+
+  ./script/generate globalize internal es,ca,fr
+
+  will create:
+	db/migrate/xxx_globalize_add_translated_fields_for_products_clients.rb
+
+  class GlobalizeAddTranslatedFieldsForProductsClients &lt; ActiveRecord::Migration
+    def self.up
+        add_column :products, :title_es, :string
+        add_column :products, :title_ca, :string
+        add_column :products, :title_fr, :string
+
+        add_column :customers, :name_es, :string
+        add_column :customers, :name_ca, :string
+        add_column :customers, :name_fr, :string
+    end
+
+    def self.down
+        remove_column :products, :title_es
+        remove_column :products, :title_ca
+        remove_column :products, :title_fr
+        remove_column :customers, :name_es
+        remove_column :customers, :name_ca
+        remove_column :customers, :name_fr
+    end
+  end
+
+  Note: It will only generate the language-suffixed columns if they currently
+  do not exist in the table (for the current environment).
+
+  Remember to run rake db:migrate to add these migrations to your database.
\ No newline at end of file</diff>
      <filename>generators/globalize/USAGE</filename>
    </modified>
    <modified>
      <diff>@@ -2,15 +2,35 @@ require 'zlib'
 require 'pathname'
 
 class GlobalizeGenerator &lt; MigrationGenerator
+
+  attr_accessor :attributes_for_migrations
+
   def initialize(runtime_args, runtime_options = {})
-    arg = runtime_args.first
-    @tiny = arg &amp;&amp; arg.downcase == 'tiny'
+    arg = runtime_args.shift
+    @internal,@tiny = false,false
+    case arg.downcase
+      when 'tiny'
+        @tiny = true
+      when 'internal'
+        @attributes_for_migrations = generate_translated_model_migrations(runtime_args.pop)
+        raise %q(No models found using internal storage mechanism or all required columns exist in db.) and return if @attributes_for_migrations.empty?
+        @internal = true
+        @migration_file_name = &quot;globalize_add_translated_fields_for_#{@attributes_for_migrations.keys.collect {|key| key.split('/').first.underscore}.join('_')}&quot;
+        @migration_class_name = &quot;GlobalizeAddTranslatedFieldsFor#{@attributes_for_migrations.keys.collect {|key| key.split('/').first}.join}&quot;
+      else
+        @tiny = false
+    end if arg
+
     super([ &quot;globalize_migration&quot; ] + runtime_args, runtime_options)
   end
 
   def banner
-    &quot;Usage: script/generate globalize [tiny]\n&quot; +
-    '  Specify &quot;tiny&quot; to generate a compact version of the data files (major languages only).'
+    %q(
+    Usage: script/generate globalize [tiny|internal] [lang|lang1,lang2...]
+    No arguments generates a migration for the globalize tables with all the data files (major languages only).
+    Specify &quot;tiny&quot; to generate a compact version of the data files (major languages only).
+    Specify &quot;internal&quot; to generate a migration of all model attributes marked as translatable (when keep_translations_in_model is true.)
+    )
   end
 
   def inflate_schema
@@ -31,12 +51,62 @@ class GlobalizeGenerator &lt; MigrationGenerator
     end
   end
 
+=begin
+  For each supplied langugage finds all attributes (in all models) marked as
+  translatable and creates a hash like:
+
+    {'ModelClassName' =&gt; [['attribute_es','string', nil], ['attribute_fr','string', nil]]}
+
+   where the value is an array whose entries are (in order):
+
+   * {attribute_name}_{lang_suffix},
+   * {attribute_column_type}
+   * {attribute_default_value}
+=end
+  def generate_translated_model_migrations(langs)
+    require &quot;#{RAILS_ROOT}/config/environment&quot;
+    raise &quot;Task unavailable to this database (no migration support)&quot; unless ActiveRecord::Base.connection.supports_migrations?
+
+    langs = langs ? langs.split(',') : []
+
+    raise %q(You must specify at least one non-base language as an extra argument.
+    You may also specify a comma-separated list of as many non-base languages as you need.
+
+    e.g. script/generate globalize model es,en,fr) if langs.empty?
+
+    attributes_for_migrations = {}
+
+    Dir.glob(&quot;#{RAILS_ROOT}/app/models/*.rb&quot;).each  do |f|
+      model = File.basename(f).gsub(File.extname(f),'').camelize.constantize rescue nil
+      if model &amp;&amp; model.base_class.superclass == ActiveRecord::Base
+        if model.keep_translations_in_model || Globalize::DbTranslate.keep_translations_in_model
+        key = &quot;#{model.name}/#{model.table_name}&quot;
+        attributes_for_migrations[key] = []
+          langs.each do |lang|
+            model.globalize_facets.each do |facet|
+              localized_facet_name = &quot;#{facet}_#{lang}&quot;
+              unless (column = model.columns.find {|c| c.name == facet.to_s}) &amp;&amp; model.column_names.include?(localized_facet_name)
+                attributes_for_migrations[key] &lt;&lt; [localized_facet_name, column.type, column.default]
+              end
+            end
+          end
+        end
+      end
+    end
+
+    attributes_for_migrations
+  end
+
   def manifest
     record do |m|
       m.directory 'db/migrate'
-      m.inflate_schema
-      m.migration_template 'migration.rb', 'db/migrate'
+      m.inflate_schema unless @internal
+      m.migration_template 'migration.rb', 'db/migrate' unless @internal
+      m.migration_template 'model_migration.rb', 'db/migrate', :migration_file_name =&gt; @migration_file_name,
+                                                               :assigns =&gt; {
+                                                                  :attributes_for_migrations =&gt; @attributes_for_migrations,
+                                                                  :migration_class_name =&gt; @migration_class_name
+                                                               } if @internal
     end
   end
-end
-
+end
\ No newline at end of file</diff>
      <filename>generators/globalize/globalize_generator.rb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>generators/globalize/templates/migration.rb.gz</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>generators/globalize/templates/tiny_migration.rb.gz</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,3 @@
-require 'jcode'
-$KCODE = 'u' # Always use UTF-8 internally!
-
 require 'pathname'
 require 'singleton'
 </diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-# This module supplies a bunch of localization-related core extensions to ruby 
+# This module supplies a bunch of localization-related core extensions to ruby
 # built-in and standard classes.
 
 module Globalize # :nodoc:
@@ -6,12 +6,12 @@ module Globalize # :nodoc:
 
     module String
 
-      # Indicates direction of text (usually +ltr+ [left-to-right] or 
+      # Indicates direction of text (usually +ltr+ [left-to-right] or
       # +rtl+ [right-to-left].
       attr_accessor :direction
 
-      # Translates the string into the active language. If there is a 
-      # quantity involved, it can be set with the +arg+ parameter. In this case 
+      # Translates the string into the active language. If there is a
+      # quantity involved, it can be set with the +arg+ parameter. In this case
       # string should contain the code &lt;tt&gt;%d&lt;/tt&gt;, which will be substituted with
       # the supplied number.
       #
@@ -20,11 +20,33 @@ module Globalize # :nodoc:
       #
       # If there is no translation available, +default+ will be returned, or
       # if it's not supplied, the original string will be returned.
-      def translate(default = nil, arg = nil)
-        Locale.translate(self, default, arg)
+      def translate(default = nil, arg = nil, namespace = nil)
+        Locale.translate(self, default, arg, namespace)
       end
       alias :t :translate
 
+
+      # Translates the string into the active language using the supplied namespace.
+      #
+      # Example:
+      #          &lt;tt&gt;&quot;draw&quot;.t -&gt; &quot;dibujar&quot;&lt;/tt&gt;
+      #          &lt;tt&gt;&quot;draw&quot;.tn(:lottery) -&gt; &quot;seleccionar&quot;&lt;/tt&gt;
+      def translate_with_namespace(namespace, arg = nil, default = nil)
+        Locale.translate(self, default, arg, namespace.to_s)
+      end
+
+      alias :tn :translate_with_namespace
+
+      # Translates the string into the active language using the supplied namespace.
+      # This is equivalent to translate_with_namespace(arg).
+      #
+      # Example:
+      #          &lt;tt&gt;&quot;draw&quot;.t -&gt; &quot;dibujar&quot;&lt;/tt&gt;
+      #          &lt;tt&gt;&quot;draw&quot; &gt;&gt; 'lottery' -&gt; &quot;seleccionar&quot;&lt;/tt&gt;
+      def &gt;&gt;(namespace)
+        translate_with_namespace(namespace, nil, nil)
+      end
+
       # Translates the string into the active language. This is equivalent
       # to translate(arg).
       #
@@ -36,20 +58,20 @@ module Globalize # :nodoc:
     end
 
     module Symbol
-      # Translates the symbol into the active language. Underscores are 
+      # Translates the symbol into the active language. Underscores are
       # converted to spaces.
       #
       # If there is no translation available, +default+ will be returned, or
       # if it's not supplied, the original string will be returned.
-      def translate(default = nil)
-        Locale.translate(self, default)
+      def translate(default = nil, namespace = nil)
+        Locale.translate(self, default, namespace)
       end
       alias :t :translate
     end
 
     module Object
-      # Translates the supplied string into the active language. If there is a 
-      # quantity involved, it can be set with the +arg+ parameter. In this case 
+      # Translates the supplied string into the active language. If there is a
+      # quantity involved, it can be set with the +arg+ parameter. In this case
       # string should contain the code &lt;tt&gt;%d&lt;/tt&gt;, which will be substituted with
       # the supplied number.
       #
@@ -59,7 +81,7 @@ module Globalize # :nodoc:
       # &lt;em&gt;Note: This method is deprectated and is supplied for backward
       # compatibility with other translation packages, notable gettext.&lt;/em&gt;
       def _(str, default = nil, arg = nil)
-        Locale.translate(str, default, arg)        
+        Locale.translate(str, default, arg)
       end
     end
 
@@ -77,7 +99,7 @@ module Globalize # :nodoc:
           number_grouping_scheme ||= :western
           number_grouping_scheme == :indian ?
             str.gsub(/(\d)(?=((\d\d\d)(?!\d))|((\d\d)+(\d\d\d)(?!\d)))/) { |match|
-              match + delimiter } : 
+              match + delimiter } :
             str.gsub(/(\d)(?=(\d\d\d)+(?!\d))/) { |match| match + delimiter }
         else
           str
@@ -106,7 +128,7 @@ module Globalize # :nodoc:
 
           int, frac = str.split('.')
           number_grouping_scheme == :indian ?
-            int.gsub!(/(\d)(?=((\d\d\d)(?!\d))|((\d\d)+(\d\d\d)(?!\d)))/) { |match| 
+            int.gsub!(/(\d)(?=((\d\d\d)(?!\d))|((\d\d)+(\d\d\d)(?!\d)))/) { |match|
               match + delimiter} :
             int.gsub!(/(\d)(?=(\d\d\d)+(?!\d))/) { |match| match + delimiter }
           int + decimal + frac
@@ -118,7 +140,7 @@ module Globalize # :nodoc:
     end
 
     module Time
-      # Acts the same as #strftime, but returns a localized version of the 
+      # Acts the same as #strftime, but returns a localized version of the
       # formatted date/time string.
       def localize(format)
         # unabashedly stole this snippet from Tadayoshi Funaba's Date class
@@ -130,19 +152,19 @@ module Globalize # :nodoc:
           when '%a'; o &lt;&lt; &quot;#{::Date::ABBR_DAYNAMES[wday]} [abbreviated weekday]&quot;.t(::Date::ABBR_DAYNAMES[wday])
           when '%B'; o &lt;&lt; &quot;#{::Date::MONTHNAMES[mon]} [month]&quot;.t(::Date::MONTHNAMES[mon])
           when '%b'; o &lt;&lt; &quot;#{::Date::ABBR_MONTHNAMES[mon]} [abbreviated month]&quot;.t(::Date::ABBR_MONTHNAMES[mon])
-          when '%c'; o &lt;&lt; ((Locale.active? &amp;&amp; !Locale.active.date_format.nil?) ? 
+          when '%c'; o &lt;&lt; ((Locale.active? &amp;&amp; !Locale.active.date_format.nil?) ?
             localize(Locale.active.date_format) : strftime('%Y-%m-%d'))
           when '%p'; o &lt;&lt; if hour &lt; 12 then 'AM [Ante Meridiem]'.t(&quot;AM&quot;) else 'PM [Post Meridiem]'.t(&quot;PM&quot;) end
           else;      o &lt;&lt; c
           end
         end
         strftime(o)
-      end                
+      end
       alias :loc :localize
     end
-    
+
     module Date
-      # Acts the same as #strftime, but returns a localized version of the 
+      # Acts the same as #strftime, but returns a localized version of the
       # formatted date/time string.
       def localize(format)
         # unabashedly stole this snippet from Tadayoshi Funaba's Date class
@@ -154,7 +176,7 @@ module Globalize # :nodoc:
           when '%a'; o &lt;&lt; &quot;#{::Date::ABBR_DAYNAMES[wday]} [abbreviated weekday]&quot;.t(::Date::ABBR_DAYNAMES[wday])
           when '%B'; o &lt;&lt; &quot;#{::Date::MONTHNAMES[mon]} [month]&quot;.t(::Date::MONTHNAMES[mon])
           when '%b'; o &lt;&lt; &quot;#{::Date::ABBR_MONTHNAMES[mon]} [abbreviated month]&quot;.t(::Date::ABBR_MONTHNAMES[mon])
-          when '%c'; o &lt;&lt; ((Locale.active? &amp;&amp; !Locale.active.date_format.nil?) ? 
+          when '%c'; o &lt;&lt; ((Locale.active? &amp;&amp; !Locale.active.date_format.nil?) ?
             localize(Locale.active.date_format) : strftime('%Y-%m-%d'))
           when '%p'; o &lt;&lt; if hour &lt; 12 then 'AM [Ante Meridiem]'.t(&quot;am&quot;) else 'PM [Post Meridiem]'.t(&quot;am&quot;) end
           when '%P'; o &lt;&lt; if hour &lt; 12 then 'AM [Ante Meridiem]'.t(&quot;AM&quot;) else 'PM [Post Meridiem]'.t(&quot;PM&quot;) end
@@ -162,7 +184,7 @@ module Globalize # :nodoc:
           end
         end
         strftime(o)
-      end                
+      end
       alias :loc :localize
     end
 </diff>
      <filename>lib/globalize/localization/core_ext.rb</filename>
    </modified>
    <modified>
      <diff>@@ -372,8 +372,31 @@ module Globalize # :nodoc:
             @@facet_options = {}
             @@globalize_facets = #{facets_string}
 
-            def self.globalize_facets
-              @@globalize_facets
+            class &lt;&lt; self
+
+              def globalize_facets
+                @@globalize_facets
+              end
+
+
+              #Returns the localized column name of the supplied attribute for the
+              #current locale
+              #
+              #Useful when you have to build up sql by hand or for AR::Base::find conditions
+              #
+              #  e.g. Product.find(:all , :conditions = [&quot;\#{Product.localized_facet(:name)} = ?&quot;, name])
+              #
+              # Note: &lt;i&gt;Used when Globalize::DbTranslate.keep_translations_in_model is true&lt;/i&gt;
+              def localized_facet(facet)
+                unless Locale.base?
+                  &quot;\#{facet}_\#{Locale.language.code}&quot;
+                else
+                  facet.to_s
+                end
+              end
+
+              alias_method :globalize_old_method_missing, :method_missing unless
+                respond_to? :globalize_old_method_missing
             end
 
             def globalize_facets_hash
@@ -400,6 +423,8 @@ module Globalize # :nodoc:
               value = send(localized_method.to_sym) if respond_to?(localized_method.to_sym)
               return !value.nil?
             end
+
+            extend  Globalize::DbTranslate::InternalStorageClassMethods
           }
 
           facets.each do |facet|
@@ -495,78 +520,6 @@ module Globalize # :nodoc:
               protected :add_bidi
             }
           end
-
-          #Returns the localized column name of the supplied attribute for the
-          #current locale
-          #
-          #Useful when you have to build up sql by hand or for AR::Base::find conditions
-          #
-          #  e.g. Product.find(:all , :conditions = [&quot;#{Product.localized_facet(:name)} = ?&quot;, name])
-          #
-          # Note: &lt;i&gt;Used when Globalize::DbTranslate.keep_translations_in_model is true&lt;/i&gt;
-          def localized_facet(facet)
-            unless Locale.base?
-              &quot;#{facet}_#{Locale.language.code}&quot;
-            else
-              facet.to_s
-            end
-          end
-
-          # Overridden to ensure that dynamic finders using localized attributes
-          # like find_by_user_name(user_name) or find_by_user_name_and_password(user_name, password)
-          # use the appropriately localized column.
-          #
-          # Note: &lt;i&gt;Used when Globalize::DbTranslate.keep_translations_in_model is true&lt;/i&gt;
-          def method_missing(method_id, *arguments)
-            if match = /find_(all_by|by)_([_a-zA-Z]\w*)/.match(method_id.to_s)
-              finder, deprecated_finder = determine_finder(match), determine_deprecated_finder(match)
-
-              facets = extract_facets_from_match(match)
-              super unless all_attributes_exists?(facets)
-
-              #Overrride facets to use appropriate attribute name for current locale
-              facets.collect! {|attr_name| respond_to?(:globalize_facets) &amp;&amp; globalize_facets.include?(attr_name.intern) ? localized_facet(attr_name) : attr_name}
-
-              attributes = construct_attributes_from_arguments(facets, arguments)
-
-              case extra_options = arguments[facets.size]
-                when nil
-                  options = { :conditions =&gt; attributes }
-                  set_readonly_option!(options)
-                  ActiveSupport::Deprecation.silence { send(finder, options) }
-
-                when Hash
-                  finder_options = extra_options.merge(:conditions =&gt; attributes)
-                  validate_find_options(finder_options)
-                  set_readonly_option!(finder_options)
-
-                  if extra_options[:conditions]
-                    with_scope(:find =&gt; { :conditions =&gt; extra_options[:conditions] }) do
-                      ActiveSupport::Deprecation.silence { send(finder, finder_options) }
-                    end
-                  else
-                    ActiveSupport::Deprecation.silence { send(finder, finder_options) }
-                  end
-
-                else
-                  ActiveSupport::Deprecation.silence do
-                    send(deprecated_finder, sanitize_sql(attributes), *arguments[facets.length..-1])
-                  end
-              end
-            elsif match = /find_or_(initialize|create)_by_([_a-zA-Z]\w*)/.match(method_id.to_s)
-              instantiator = determine_instantiator(match)
-              facets = extract_facets_from_match(match)
-              super unless all_attributes_exists?(facets)
-
-              attributes = construct_attributes_from_arguments(facets, arguments)
-              options = { :conditions =&gt; attributes }
-              set_readonly_option!(options)
-
-              find_initial(options) || send(instantiator, attributes)
-            else
-              super
-            end
-          end
         end
 
         #Default Globalize translations storage mechanism
@@ -939,6 +892,66 @@ module Globalize # :nodoc:
           return results
         end
     end
-  end
 
+    module InternalStorageClassMethods
+
+      private
+
+      # Overridden to ensure that dynamic finders using localized attributes
+      # like find_by_user_name(user_name) or find_by_user_name_and_password(user_name, password)
+      # use the appropriately localized column.
+      #
+      # Note: &lt;i&gt;Used when Globalize::DbTranslate.keep_translations_in_model is true&lt;/i&gt;
+      def method_missing(method_id, *arguments)
+        if match = /find_(all_by|by)_([_a-zA-Z]\w*)/.match(method_id.to_s)
+          finder, deprecated_finder = determine_finder(match), determine_deprecated_finder(match)
+
+          facets = extract_attribute_names_from_match(match)
+          super unless all_attributes_exists?(facets)
+
+          #Overrride facets to use appropriate attribute name for current locale
+          facets.collect! {|attr_name| respond_to?(:globalize_facets) &amp;&amp; globalize_facets.include?(attr_name.intern) ? localized_facet(attr_name) : attr_name}
+
+          attributes = construct_attributes_from_arguments(facets, arguments)
+
+          case extra_options = arguments[facets.size]
+            when nil
+              options = { :conditions =&gt; attributes }
+              set_readonly_option!(options)
+              ActiveSupport::Deprecation.silence { send(finder, options) }
+
+            when Hash
+              finder_options = extra_options.merge(:conditions =&gt; attributes)
+              validate_find_options(finder_options)
+              set_readonly_option!(finder_options)
+
+              if extra_options[:conditions]
+                with_scope(:find =&gt; { :conditions =&gt; extra_options[:conditions] }) do
+                  ActiveSupport::Deprecation.silence { send(finder, finder_options) }
+                end
+              else
+                ActiveSupport::Deprecation.silence { send(finder, finder_options) }
+              end
+
+            else
+              ActiveSupport::Deprecation.silence do
+                send(deprecated_finder, sanitize_sql(attributes), *arguments[facets.length..-1])
+              end
+          end
+        elsif match = /find_or_(initialize|create)_by_([_a-zA-Z]\w*)/.match(method_id.to_s)
+          instantiator = determine_instantiator(match)
+          facets = extract_attribute_names_from_match(match)
+          super unless all_attributes_exists?(facets)
+
+          attributes = construct_attributes_from_arguments(facets, arguments)
+          options = { :conditions =&gt; attributes }
+          set_readonly_option!(options)
+
+          find_initial(options) || send(instantiator, attributes)
+        else
+          super
+        end
+      end
+    end
+  end
 end</diff>
      <filename>lib/globalize/localization/db_translate.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,22 +1,22 @@
 module Globalize # :nodoc:
-  class DbViewTranslator 
+  class DbViewTranslator
     include Singleton
 
-    # The maximum size of the cache in kilobytes. 
+    # The maximum size of the cache in kilobytes.
     # This is just a rough estimate, the cache can grow bigger than this figure.
     attr_accessor :max_cache_size
 
     attr_reader :cache_size, :cache_total_hits, :cache_total_queries
 
-    def fetch(key, language, default = nil, arg = nil) # :nodoc:
+    def fetch(key, language, default = nil, arg = nil, namespace = nil) # :nodoc:
 
       # use argument as pluralization number, if number
       num = arg.kind_of?(Numeric) ? arg : nil
 
-      # if there's no translation, use default or original key      
+      # if there's no translation, use default or original key
       real_default = default || key
 
-      result = fetch_from_cache(key, language, real_default, num)
+      result = fetch_from_cache(key, language, real_default, num, namespace)
 
       if num
         return result.sub('%d', num.to_s)
@@ -25,7 +25,7 @@ module Globalize # :nodoc:
       end
     end
 
-    def set(key, language, translations, zero_form = nil) # :nodoc:
+    def set(key, language, translations, zero_form = nil, namespace = nil) # :nodoc:
       raise ArgumentError, &quot;No language set&quot; if !language
       if translations.kind_of? Array
         translations = [ zero_form ] + translations
@@ -35,23 +35,23 @@ module Globalize # :nodoc:
 
       idx = 0
       translations.each do |translation|
-        set_pluralized(key, language, idx, translation)
+        set_pluralized(key, language, idx, translation, namespace)
         idx += 1
       end
     end
 
-    def set_pluralized(key, language, idx, translation)
-      invalidate_cache(key, language, idx)
+    def set_pluralized(key, language, idx, translation, namespace = nil)
+      invalidate_cache(key, language, idx, namespace)
       ViewTranslation.transaction do
-        old_tr = ViewTranslation.pick(key, language, idx)
+        old_tr = ViewTranslation.pick(key, language, idx, namespace)
         if old_tr
           old_tr.update_attribute(:text, translation)
         else
-          ViewTranslation.create!(:tr_key =&gt; key, 
-            :language_id =&gt; language.id, :pluralization_index =&gt; idx, 
-            :text =&gt; translation)
+          ViewTranslation.create!(:tr_key =&gt; key,
+            :language_id =&gt; language.id, :pluralization_index =&gt; idx,
+            :text =&gt; translation, :namespace =&gt; namespace)
         end
-      end 
+      end
     end
 
     # Returns the number of items in the cache.
@@ -67,45 +67,45 @@ module Globalize # :nodoc:
     end
 
     private
-      def fetch_view_translation(key, language, idx)
+      def fetch_view_translation(key, language, idx, namespace = nil)
         tr = nil
         ViewTranslation.transaction do
-          tr = ViewTranslation.pick(key, language, idx)
+          tr = ViewTranslation.pick(key, language, idx, namespace)
 
           # fill in a nil record for missed translations report
           # do not report missing zero-forms -- they're optional
           if !tr &amp;&amp; idx != 0
-            tr = ViewTranslation.create!(:tr_key =&gt; key, 
+            tr = ViewTranslation.create!(:tr_key =&gt; key,
               :language_id =&gt; language.id, :pluralization_index =&gt; idx,
-              :text =&gt; nil)
+              :text =&gt; nil, :namespace =&gt; namespace)
           end
         end
 
         tr ? tr.text : nil
       end
 
-      def cache_fetch(key, language, idx)
+      def cache_fetch(key, language, idx, namespace = nil)
         @cache_total_queries += 1
-        cache_key = cache_key(key, language, idx)
+        cache_key = cache_key(key, language, idx, namespace)
         @cache_total_hits += 1 if @cache.has_key?(cache_key)
         @cache[cache_key]
       end
 
-      def cache_add(key, language, idx, translation)
+      def cache_add(key, language, idx, translation, namespace = nil)
         cache_clear if @cache_size &gt; max_cache_size * 1024
         size = key.size + (translation.nil? ? 0 : translation.size)
         @cache_size += size
-        @cache[cache_key(key, language, idx)] = translation
+        @cache[cache_key(key, language, idx, namespace)] = translation
       end
 
-      def invalidate_cache(key, language, idx)
-        tr = @cache.delete(cache_key(key, language, idx))
+      def invalidate_cache(key, language, idx, namespace = nil)
+        tr = @cache.delete(cache_key(key, language, idx, namespace))
         size = key.size + (tr.nil? ? 0 : tr.size)
         @cache_size -= size
       end
 
-      def cache_key(key, language, idx)
-        [ key, language.code, idx ].join(':')
+      def cache_key(key, language, idx, namespace = nil)
+        [ key, language.code, idx, namespace].compact.join(':')
       end
 
       def cache_hit_ratio
@@ -123,27 +123,27 @@ module Globalize # :nodoc:
         @cache_total_hits = 0
         @cache_total_queries = 0
 
-        # default cache size is 8mb        
+        # default cache size is 8mb
         @max_cache_size = 8192
       end
 
-      def fetch_from_cache(key, language, real_default, num)
+      def fetch_from_cache(key, language, real_default, num, namespace = nil)
         return real_default if language.nil?
 
         zero_form   = num == 0
         plural_idx  = language.plural_index(num)        # language-defined plural form
         zplural_idx = zero_form ? 0 : plural_idx # takes zero-form into account
 
-        cached = cache_fetch(key, language, zplural_idx)
+        cached = cache_fetch(key, language, zplural_idx, namespace)
         if cached
           result = cached
         else
-          result = fetch_view_translation(key, language, zplural_idx)
+          result = fetch_view_translation(key, language, zplural_idx, namespace)
 
           # set to plural_form if no zero-form exists
-          result ||= fetch_view_translation(key, language, plural_idx) if zero_form
+          result ||= fetch_view_translation(key, language, plural_idx, namespace) if zero_form
 
-          cache_add(key, language, zplural_idx, result)          
+          cache_add(key, language, zplural_idx, result, namespace)
         end
         result ||= real_default
       end</diff>
      <filename>lib/globalize/localization/db_view_translator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -146,33 +146,45 @@ module Globalize
     #   Locale.set_translation(&quot;There are %d items in your cart&quot;,
     #   &quot;There is one item in your cart&quot;, &quot;There are %d items in your cart&quot;)
     def self.set_translation(key, *options)
-      key = key.to_s.gsub('_', ' ') if key.kind_of? Symbol
-      if options.first.kind_of? Language
-        language = options.shift
-      else
-        language = self.language
-      end
+      key, language, translations, zero_form = key_and_language(key, options)
+      raise ArgumentError, &quot;No translations given&quot; if options.empty?
+      translator.set(key, language, translations, zero_form, nil)
+    end
 
+    # Same as set_translation but translation is set to a particular namespace
+    #
+    # Example:
+    #   Locale.set('es-ES')
+    #   Locale.set_translation(&quot;draw&quot;, &quot;dibujar&quot;)
+    #   &quot;draw&quot;.t =&gt; &quot;dibujar&quot;
+    #   Locale.set_translation_with_namespace(&quot;draw&quot;, &quot;lottery&quot;, &quot;seleccionar&quot;)
+    #   &quot;draw&quot; &gt;&gt; 'lottery' =&gt; &quot;seleccionar&quot;
+    #
+    # or
+    #   Locale.set_translation(&quot;draw %d times&quot;, &quot;dibujar una vez&quot;, &quot;dibujar %d veces&quot;)
+    #   Locale.set_translation_with_namespace(&quot;draw %d times&quot;, &quot;lottery&quot;, &quot;seleccionar una vez&quot;, &quot;seleccionar %d veces&quot;)
+    def self.set_translation_with_namespace(key, namespace, *options)
+      key, language, translations, zero_form = key_and_language(key, options)
       raise ArgumentError, &quot;No translations given&quot; if options.empty?
-      translator.set(key, language, *options)
+      translator.set(key, language, translations, zero_form, namespace)
     end
 
     def self.set_pluralized_translation(key, *options)
-      key = key.to_s.gsub('_', ' ') if key.kind_of? Symbol
-      if options.first.kind_of? Language
-        language = options.shift
-      else
-        language = self.language
-      end
+      key, language, translations, zero_form = key_and_language(key, options)
+      raise ArgumentError, &quot;No translations given&quot; if options.empty?
+      translator.set_pluralized(key, language, translations, zero_form, nil)
+    end
 
+    def self.set_pluralized_translation_with_namespace(key, *options)
+      key, language, translations, zero_form = key_and_language(key, options)
       raise ArgumentError, &quot;No translations given&quot; if options.empty?
-      translator.set_pluralized(key, language, *options)
+      translator.set_pluralized(key, language, translations, zero_form, namespace)
     end
 
-    def self.translate(key, default = nil, arg = nil) # :nodoc:
+    def self.translate(key, default = nil, arg = nil, namespace = nil) # :nodoc:
       key = key.to_s.gsub('_', ' ') if key.kind_of? Symbol
 
-      translator.fetch(key, self.language, default, arg)
+      translator.fetch(key, self.language, default, arg, namespace)
     end
 
     # Returns the translator object -- mostly for testing and adjusting the cache.
@@ -180,6 +192,18 @@ module Globalize
 
     private
 
+      def self.key_and_language(key, options)
+        key = key.to_s.gsub('_', ' ') if key.kind_of? Symbol
+        if options.first.kind_of? Language
+          language = options.shift
+        else
+          language = self.language
+        end
+
+        zero_form = (options.first.kind_of?(Array) &amp;&amp; options.last.kind_of?(String)) ? options.pop : nil
+        [key,language,options.flatten, zero_form]
+      end
+
       def setup_fields
         return if !@country
 
@@ -189,4 +213,3 @@ module Globalize
       end
   end
 end
-</diff>
      <filename>lib/globalize/localization/locale.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,19 @@ module Globalize
   # views, and flashes, but not database content.
   class ViewTranslation &lt; Translation # :nodoc:
 
-    def self.pick(key, language, idx)
-      find(:first, :conditions =&gt; [ 
-        'tr_key = ? AND language_id = ? AND pluralization_index = ?', 
-        key, language.id, idx ])
+    def self.pick(key, language, idx, namespace = nil)
+      conditions = 'tr_key = ? AND language_id = ? AND pluralization_index = ?'
+      namespace_condition = namespace ? ' AND namespace = ?' : ' AND namespace IS NULL'
+      conditions &lt;&lt; namespace_condition
+      find(:first, :conditions =&gt; [conditions,*[key, language.id, idx, namespace].compact])
+    end
+
+    #Find all namespaces used in translations
+    def self.find_all_namespaces
+      sql = &lt;&lt;-SQL
+        SELECT distinct(namespace) FROM globalize_translations order by namespace
+      SQL
+      self.connection.select_values(sql).compact
     end
 
   end</diff>
      <filename>lib/globalize/models/view_translation.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,10 +14,10 @@ def load_from_csv table_name, data
 
   ActiveRecord::Base.silence do
     reader = CSV::Reader.create data
-    
+
     columns = reader.shift.map { |column_name| cnx.quote_column_name(column_name) }
     column_clause = columns.join(', ')
-    
+
     reader.each do |row|
       next if row.first.nil? # skip blank lines
       raise &quot;No table name defined&quot; unless table_name
@@ -32,13 +32,13 @@ end
 namespace :globalize do
   desc 'Reset the Globalize data'
   task :reset =&gt; [ :teardown, :setup ]
-  
+
   desc 'Create Globalize database tables and load locale data'
   task :setup =&gt; [ :create_tables, :load_locale_data ]
-  
+
   desc 'Remove all globalize data'
   task :teardown =&gt; :drop_tables
-  
+
   desc 'Create Globalize database tables'
   task :create_tables =&gt; :environment do
     raise &quot;Task unavailable to this database (no migration support)&quot; unless ActiveRecord::Base.connection.supports_migrations?
@@ -55,7 +55,7 @@ namespace :globalize do
       t.column :number_grouping_scheme, :string
     end
     ActiveRecord::Base.connection.add_index :globalize_countries, :code
-    
+
     ActiveRecord::Base.connection.create_table :globalize_translations, :force =&gt; true do |t|
       t.column :type,                   :string
       t.column :tr_key,                 :string
@@ -66,10 +66,11 @@ namespace :globalize do
       t.column :language_id,            :integer
       t.column :pluralization_index,    :integer
       t.column :text,                   :text
+      t.column :namespace,              :string
     end
     ActiveRecord::Base.connection.add_index :globalize_translations, [ :tr_key, :language_id ]
     ActiveRecord::Base.connection.add_index :globalize_translations, [ :table_name, :item_id, :language_id ], :name =&gt; 'globalize_translations_table_name_and_item_and_language'
-    
+
     ActiveRecord::Base.connection.create_table :globalize_languages, :force =&gt; true do |t|
       t.column :iso_639_1,              :string,  :limit =&gt; 2
       t.column :iso_639_2,              :string,  :limit =&gt; 3
@@ -87,11 +88,11 @@ namespace :globalize do
       t.column :scope,                  :string,  :limit =&gt; 1
     end
     ActiveRecord::Base.connection.add_index :globalize_languages, :iso_639_1
-    ActiveRecord::Base.connection.add_index :globalize_languages, :iso_639_2  
-    ActiveRecord::Base.connection.add_index :globalize_languages, :iso_639_3  
-    ActiveRecord::Base.connection.add_index :globalize_languages, :rfc_3066 
+    ActiveRecord::Base.connection.add_index :globalize_languages, :iso_639_2
+    ActiveRecord::Base.connection.add_index :globalize_languages, :iso_639_3
+    ActiveRecord::Base.connection.add_index :globalize_languages, :rfc_3066
   end
-  
+
   desc 'Drops Globalize database tables'
   task :drop_tables =&gt; :environment do
     raise &quot;Task unavailable to this database (no migration support)&quot; unless ActiveRecord::Base.connection.supports_migrations?
@@ -100,7 +101,7 @@ namespace :globalize do
     ActiveRecord::Base.connection.drop_table :globalize_translations
     ActiveRecord::Base.connection.drop_table :globalize_languages
   end
-  
+
   desc 'Load locale data'
   task :load_locale_data =&gt; :environment do
     # This needs to be called here, so that we can load the structure without
@@ -114,17 +115,34 @@ namespace :globalize do
     load_from_csv 'globalize_languages',    csv_file( :language_data )
     load_from_csv 'globalize_translations', csv_file( :translation_data )
   end
-  
+
   desc 'Purge locale data'
   task :purge_locale_data =&gt; :environment do
     Globalize::Country.destroy_all
     Globalize::Language.destroy_all
     Globalize::Translation.destroy_all
   end
-  
+
   desc 'Run Globalize tests'
   Rake::TestTask.new do |t|
-    t.test_files = FileList[&quot;#{File.dirname( __FILE__ )}/../test/*_test.rb&quot;]
-    t.verbose = true
+    t.test_files = FileList[&quot;#{File.dirname( __FILE__ )}/../test/*_test.rb&quot;]
+    t.verbose = true
   end
+
+  desc 'Upgrade to Globalize 1.2 schema'
+  task :upgrade_schema_to_1_dot_2 =&gt; :environment do
+    if ActiveRecord::Base.connection.tables.include? 'globalize_translations'
+      puts &quot;Upgrading schema to Globalize 1.2&quot;
+      existing_column_names = ActiveRecord::Base.connection.columns('globalize_translations').collect(&amp;:name)
+      raise &quot;Schema already upgraded to 1.2&quot; if existing_column_names.include?('namespace')
+      if ActiveRecord::Base.connection.supports_migrations?
+        ActiveRecord::Base.connection.add_column :globalize_translations, :namespace, :string
+      else
+        ActiveRecord::Base.connection.execute &quot;ALTER TABLE globalize_translations ADD COLUMN namespace VARCHAR;&quot;
+      end
+    else
+      puts 'Globalize has not been setup yet. Generate a migration via script/generate globalize or run rake globalize:setup'
+    end
+  end
+
 end</diff>
      <filename>tasks/data.rake</filename>
    </modified>
    <modified>
      <diff>@@ -74,6 +74,7 @@ ActiveRecord::Schema.define do
     t.column :language_id,    :integer
     t.column :pluralization_index,    :integer
     t.column :text,           :text
+    t.column :namespace,      :string
   end
 
   add_index :globalize_translations, [ :tr_key, :language_id ], :name =&gt; 'tr_key'</diff>
      <filename>test/db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -68,6 +68,24 @@ class LocalizesTranslatesTest &lt; Test::Unit::TestCase
     assert_equal simp.name, simp._name
   end
 
+  def test_find_by_override
+    Globalize::Locale.set(&quot;en-US&quot;)
+    first_product  = Product.find_by_name('first')
+    fourth_product = Product.find_by_name('eff')
+    second_product = Product.find_by_description('This is a description of the second product')
+    assert_equal second_product, Product.find_by_specs('these are the specs for the second product')
+
+
+    Globalize::Locale.set(&quot;es-ES&quot;)
+    assert_equal first_product, Product.find_by_name('primer')
+    assert_equal fourth_product, Product.find_by_name('effes')
+    assert_equal second_product, Product.find_by_description('Esta es una descripcion del segundo producto')
+    assert_equal second_product, Product.find_by_specs('estas son las especificaciones del segundo producto')
+
+    Globalize::Locale.set(&quot;he-IL&quot;)
+    assert_equal fourth_product, Product.find_by_name('&#1505;&#1488;&#1512;&#1496;')
+  end
+
   def test_base_as_default_false
     prod = Product.create!(:code =&gt; 'test-base', :name =&gt; 'english test')
     assert_equal 'english test', prod.name</diff>
      <filename>test/db_localizes_translates_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ second_product:
   code: second-product
   manufacturer_id: 1
   description: This is a description of the second product
-  description_es: Esta es una descripcion del primer producto
+  description_es: Esta es una descripcion del segundo producto
   specs: these are the specs for the second product
   specs_es: estas son las especificaciones del segundo producto
 third:</diff>
      <filename>test/fixtures/globalize_products.yml</filename>
    </modified>
    <modified>
      <diff>@@ -351,4 +351,63 @@ model_simple_desc_1:
   language_id: 2
   text: &#1494;&#1492;&#1493; &#1492;&#1514;&#1497;&#1488;&#1493;&#1512; &#1492;&#1512;&#1488;&#1513;&#1493;&#1503;
   type: ModelTranslation
-  
\ No newline at end of file
+
+view_es_tr_namespace_1:
+  id: 60
+  type: ViewTranslation
+  language_id: 7
+  pluralization_index: 1
+  tr_key: draw
+  text: &quot;dibujar&quot;
+
+view_es_tr_namespace_2:
+  id: 61
+  type: ViewTranslation
+  language_id: 7
+  pluralization_index: 1
+  tr_key: draw
+  namespace: lottery
+  text: &quot;seleccionar&quot;
+
+view_es_tr_namespace_3:
+  id: 62
+  type: ViewTranslation
+  language_id: 7
+  pluralization_index: 1
+  tr_key: &quot;draw %d times&quot;
+  text: &quot;dibujar una vez&quot;
+
+view_es_tr_namespace_4:
+  id: 63
+  type: ViewTranslation
+  language_id: 7
+  pluralization_index: 2
+  tr_key: &quot;draw %d times&quot;
+  text: &quot;dibujar %d veces&quot;
+
+
+view_es_tr_namespace_5:
+  id: 64
+  type: ViewTranslation
+  language_id: 7
+  pluralization_index: 1
+  namespace: lottery
+  tr_key: &quot;draw %d times&quot;
+  text: &quot;seleccionar una vez&quot;
+
+view_es_tr_namespace_6:
+  id: 65
+  type: ViewTranslation
+  language_id: 7
+  pluralization_index: 2
+  namespace: lottery
+  tr_key: &quot;draw %d times&quot;
+  text: &quot;seleccionar %d veces&quot;
+
+view_es_tr_namespace_7:
+  id: 66
+  type: ViewTranslation
+  language_id: 1
+  pluralization_index: 1
+  tr_key: &quot;draw %d times&quot;
+  text: &quot;draw once&quot;
\ No newline at end of file</diff>
      <filename>test/fixtures/globalize_translations.yml</filename>
    </modified>
    <modified>
      <diff>@@ -40,14 +40,14 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
   def test_aliases
     Locale.set(&quot;he-IL&quot;)
     assert_equal &quot;&#1493;&#1506;&#1499;&#1513;&#1497;&#1493; &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;&quot;, &quot;And now in Hebrew&quot;.translate
-    assert_equal &quot;&#1493;&#1506;&#1499;&#1513;&#1497;&#1493; &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;&quot;, _(&quot;And now in Hebrew&quot;)    
+    assert_equal &quot;&#1493;&#1506;&#1499;&#1513;&#1497;&#1493; &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;&quot;, _(&quot;And now in Hebrew&quot;)
   end
 
   def test_set_translation
     assert_equal &quot;a dark and stormy night&quot;, &quot;a dark and stormy night&quot;.t
     Locale.set_translation(&quot;a dark and stormy night&quot;, &quot;quite a dark and stormy night&quot;)
     assert_equal &quot;quite a dark and stormy night&quot;, &quot;a dark and stormy night&quot;.t
-    
+
     Locale.set(&quot;he-IL&quot;)
     assert_equal &quot;a dark and stormy night&quot;, &quot;a dark and stormy night&quot;.t
     Locale.set_translation(&quot;a dark and stormy night&quot;, &quot;&#1500;&#1497;&#1500; &#1511;&#1493;&#1491;&#1512; &#1493;&#1490;&#1493;&#1506;&#1513;&quot;)
@@ -63,13 +63,13 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
   end
 
   def test_set_translation_pl
-    Locale.set_translation(&quot;%d dark and stormy nights&quot;, &quot;quite a dark and stormy night&quot;, 
+    Locale.set_translation(&quot;%d dark and stormy nights&quot;, &quot;quite a dark and stormy night&quot;,
       &quot;%d dark and stormy nights&quot;)
     assert_equal &quot;quite a dark and stormy night&quot;, &quot;%d dark and stormy nights&quot;.t
     assert_equal &quot;5 dark and stormy nights&quot;, &quot;%d dark and stormy nights&quot; / 5
-    
+
     Locale.set(&quot;he-IL&quot;)
-    Locale.set_translation(&quot;%d dark and stormy nights&quot;, 
+    Locale.set_translation(&quot;%d dark and stormy nights&quot;,
       [ &quot;&#1500;&#1497;&#1500; &#1511;&#1493;&#1491;&#1512; &#1493;&#1490;&#1493;&#1506;&#1513;&quot;, &quot;%d &#1500;&#1497;&#1500;&#1493;&#1514; &#1511;&#1493;&#1491;&#1512;&#1497;&#1501; &#1493;&#1490;&#1493;&#1506;&#1513;&#1497;&#1501;&quot; ])
     assert_equal &quot;&#1500;&#1497;&#1500; &#1511;&#1493;&#1491;&#1512; &#1493;&#1490;&#1493;&#1506;&#1513;&quot;, &quot;%d dark and stormy nights&quot;.t
     assert_equal &quot;7 &#1500;&#1497;&#1500;&#1493;&#1514; &#1511;&#1493;&#1491;&#1512;&#1497;&#1501; &#1493;&#1490;&#1493;&#1506;&#1513;&#1497;&#1501;&quot;, &quot;%d dark and stormy nights&quot; / 7
@@ -80,10 +80,10 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
 
   def test_missed_report
     Locale.set(&quot;he-IL&quot;)
-    assert_nil ViewTranslation.find(:first, 
+    assert_nil ViewTranslation.find(:first,
       :conditions =&gt; %q{language_id = 2 AND tr_key = 'not in database'})
     assert_equal &quot;not in database&quot;, &quot;not in database&quot;.t
-    result = ViewTranslation.find(:first, 
+    result = ViewTranslation.find(:first,
       :conditions =&gt; %q{language_id = 2 AND tr_key = 'not in database'})
     assert_not_nil result, &quot;There should be a record in the db with nil text&quot;
     assert_nil result.text
@@ -92,14 +92,14 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
   # for when language doesn't have a translation
   def test_default_number_substitution
     Locale.set(&quot;pl-PL&quot;)
-    assert_equal &quot;There are 0 translations for this&quot;, 
-      &quot;There are %d translations for this&quot; / 0    
+    assert_equal &quot;There are 0 translations for this&quot;,
+      &quot;There are %d translations for this&quot; / 0
   end
 
   # for when language only has one pluralization form for translation
   def test_default_number_substitution2
     Locale.set(&quot;he-IL&quot;)
-    assert_equal &quot;&#1497;&#1513; &#1500;&#1497; 5 &#1511;&#1489;&#1510;&#1497;&#1501;&quot;, &quot;I have %d files&quot; / 5    
+    assert_equal &quot;&#1497;&#1513; &#1500;&#1497; 5 &#1511;&#1489;&#1510;&#1497;&#1501;&quot;, &quot;I have %d files&quot; / 5
   end
 
   def test_symbol
@@ -126,15 +126,15 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
   end
 
   def test_zero_form
-    Locale.set_translation(&quot;%d items in your cart&quot;, 
+    Locale.set_translation(&quot;%d items in your cart&quot;,
       [ &quot;One item in your cart&quot;, &quot;%d items in your cart&quot; ], &quot;Your cart is empty&quot;)
     assert_equal &quot;8 items in your cart&quot;, &quot;%d items in your cart&quot; / 8
     assert_equal &quot;One item in your cart&quot;, &quot;%d items in your cart&quot; / 1
-    assert_equal &quot;Your cart is empty&quot;, &quot;%d items in your cart&quot; / 0    
+    assert_equal &quot;Your cart is empty&quot;, &quot;%d items in your cart&quot; / 0
   end
 
   def test_zero_form_default
-    Locale.set_translation(&quot;%d items in your cart&quot;, 
+    Locale.set_translation(&quot;%d items in your cart&quot;,
       [ &quot;One item in your cart&quot;, &quot;%d items in your cart&quot; ])
     assert_equal &quot;8 items in your cart&quot;, &quot;%d items in your cart&quot; / 8
     assert_equal &quot;One item in your cart&quot;, &quot;%d items in your cart&quot; / 1
@@ -147,7 +147,7 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
   end
 
   def test_no_substitute
-    assert_equal &quot;Don't substitute any %s in %s&quot;, 
+    assert_equal &quot;Don't substitute any %s in %s&quot;,
       &quot;Don't substitute any %s in %s&quot;.t
   end
 
@@ -159,7 +159,7 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
     assert_equal 0, tr.cache_count
     assert_equal 0, tr.cache_total_hits
     assert_equal 0, tr.cache_total_queries
-    
+
     assert_equal &quot;&#1493;&#1506;&#1499;&#1513;&#1497;&#1493; &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;&quot;, :And_now_in_Hebrew.t
     assert_equal 1, tr.cache_count
     assert_equal 42, tr.cache_size
@@ -178,21 +178,21 @@ class ViewTranslationTest &lt; Test::Unit::TestCase
     assert_equal 2, tr.cache_total_hits
     assert_equal 3, tr.cache_total_queries
 
-    assert_equal &quot;&#1493;&#1506;&#1499;&#1513;&#1497;&#1493; &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;&quot;, 
-      tr.instance_eval { 
-        cache_fetch(&quot;And now in Hebrew&quot;, Locale.language, 
-        Locale.language.plural_index(nil)) 
+    assert_equal &quot;&#1493;&#1506;&#1499;&#1513;&#1497;&#1493; &#1489;&#1506;&#1489;&#1512;&#1497;&#1514;&quot;,
+      tr.instance_eval {
+        cache_fetch(&quot;And now in Hebrew&quot;, Locale.language,
+        Locale.language.plural_index(nil))
       }
 
     # test for purging
     tr.max_cache_size = 41 / 1024  # in kb
-    assert_equal &quot;&#1497;&#1513; &#1500;&#1497; 5 &#1511;&#1489;&#1510;&#1497;&#1501;&quot;, &quot;I have %d files&quot; / 5    
+    assert_equal &quot;&#1497;&#1513; &#1500;&#1497; 5 &#1511;&#1489;&#1510;&#1497;&#1501;&quot;, &quot;I have %d files&quot; / 5
     assert_equal 1, tr.cache_count
     assert_equal 38, tr.cache_size
     assert_equal 3, tr.cache_total_hits
     assert_equal 5, tr.cache_total_queries
 
-    assert_equal &quot;&#1497;&#1513; &#1500;&#1497; 5 &#1511;&#1489;&#1510;&#1497;&#1501;&quot;, &quot;I have %d files&quot; / 5    
+    assert_equal &quot;&#1497;&#1513; &#1500;&#1497; 5 &#1511;&#1489;&#1510;&#1497;&#1501;&quot;, &quot;I have %d files&quot; / 5
     assert_equal 1, tr.cache_count
     assert_equal 38, tr.cache_size
     assert_equal 4, tr.cache_total_hits</diff>
      <filename>test/view_translation_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>41614b5284d7745cf7183b07c28c8fd0fefce2e3</id>
    </parent>
  </parents>
  <author>
    <name>Saimon Moore</name>
    <email>saimonmoore@gmail.com</email>
  </author>
  <url>http://github.com/yannlugrin/globalize/commit/4cc24938ea2c8708fd95c8ea6bbe8f217134b198</url>
  <id>4cc24938ea2c8708fd95c8ea6bbe8f217134b198</id>
  <committed-date>2007-03-12T04:16:54-07:00</committed-date>
  <authored-date>2007-03-12T04:16:54-07:00</authored-date>
  <message>--Backporting for-1.2 features</message>
  <tree>1caf7b15253738e436b4638291e6153b5a3ecc52</tree>
  <committer>
    <name>Saimon Moore</name>
    <email>saimonmoore@gmail.com</email>
  </committer>
</commit>
