Gianluca Tessarolo
2008-Jan-19 17:19 UTC
Globalize Plugin: SImple question about searching untraslated records
Hi, how can i find all record of untranslated field on a field under Globalize plugin ? Example: define a model: class Translation < ActiveRecord::Base translates :description end working with 2 locales (en-US base and it-IT) when i create a record for english base locale and after set italian locale reading the translation of model.description I retrieve the default value (that''s ok because Globalize uses coalesce to return the engish description if italian description is not present). What can I do to know which translations is not already loadedin italian locale ? (sort of Model.find(:all, :conditions => "description is null or description = '''')) Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Gianluca Tessarolo
2008-Jan-19 18:36 UTC
[Solved] Globalize Plugin: SImple question about searching untraslated records
I''ve solved from myself. Simply using this condition only when not in base language: Translation.find(:all, :conditions => "t_description.text is null") Hope this helps...> Hi, > > how can i find all record of untranslated field on a field under > Globalize plugin ? > > Example: > > define a model: > > class Translation < ActiveRecord::Base > translates :description > end > > working with 2 locales (en-US base and it-IT) > > when i create a record for english base locale and after set italian > locale reading the translation of model.description I retrieve the > default value (that''s ok because Globalize uses coalesce to return the > engish description if italian description is not present). > > What can I do to know which translations is not already loadedin italian > locale ? (sort of Model.find(:all, :conditions => "description is null > or description = '''')) > > Thanks in advance. > > > > > > > >-- Gianluca Tessarolo TreNetMediaMaster S.r.l. The Internet Technology Company Telefono +39(049)776196 Fax +39(049)8087806 Visit us @: http://www.trenet.it - http://www.mediamaster.it e-mail me @: tessarolo.gianluca-6ZZdBs7hMehZp5Udy/Obhg@public.gmane.org ---------------------------------------------------------------------- Le informazioni trasmesse sono destinate esclusivamente alla persona o alla società in indirizzo e sono da intendersi confidenziali e riservate. Ogni trasmissione, inoltro, diffusione o altro uso di queste informazioni a persone o società differenti dal destinatario é proibita. Se ricevete questa comunicazione per errore, contattate il mittente e cancellate le informazioni da ogni computer. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---