When people ask about missing translations I wonder if they mean missing lookups instead.

If you do I18n.t(:missing, :default => :not_missing) then you won't get into the I18n.exception_handler routine as there is no missing translation. But there is a missing lookup.

If you use the gettext helpers then by definition there are no missing translations, only missing lookups.

In the end I came to the conclusion that it is an impossible task to find missing translations by running or testing the app.

See also:

http://github.com/svenfuchs/i18n/blob/master/lib/i18n/backend/active_record/missing.rb



Cheers,
Lawrence

You can do this to intercept any missing translations when you restart
your app:

module I18n
   class<<  self
     def raise_custom_exception(exception, locale, key, options)
       if MissingTranslationData === exception
         # do something with the missing translation

         return translation
       else
         raise exception
       end
     end
   end
end

I18n.exception_handler = :raise_custom_exception

I've used it to make a call to the google translate API to generate
any missing machine translation(s), and then push them to my backend
so I have them for next time.

Hope that helps!
Shelly

http://wordchuck.com

--




On Oct 12, 2:35 am, Michael Bensoussan<[email protected]>  wrote:
Hi,
We have a multilingual application using I18n,
How would you test your application have no translations missings ?
Would you test it view by view ? or have you a better solution ?

Thanks,

--
You received this message because you are subscribed to the Google Groups 
"rails-i18n" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-i18n?hl=en.

Reply via email to