I am building a Web service that will provide content for different client via Rest API. currently I have: content has_many :keys (since many keys can reference the same content) content table has only one field - text keys table has name and content_id example for key: help_about example for content: "This website is for blablabla.." I want to add support for translations. is it reasonable to store the content in separate table for each language? for example - content_english, content_spanish, etc. If it is, how will rails handle it? currently Content.find 1 will return the text of contents table. and I will need to tell rails to grab it from content_english or content_spanish. btw, I looked at a gettext example and it uses only one table with locale field to determine what language to show. but I am not sure it''s a good solution for massive chunk of content and many languages. Thanks! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
HI oren, There was recent similar discussion about design for content translations and the answer I gave there may be useful to you: http://osdir.com/ml/RubyonRailsTalk/2010-04/msg02235.html I''m currently adding content translation to the Kete open source Rails app (http://github.com/kete/kete and http://kete.net.nz). You may find some example code there useful. A lot of people, including myself with http://github.com/kete/mongo_translatable, are starting to use a NoSQL backend for translation. The latest I18n gem just added Tokyo Cabinet support, too. Hope this helps, Walter On Sun, May 2, 2010 at 4:40 PM, oren <orengolan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am building a Web service that will provide content for different > client via Rest API. > > currently I have: content has_many :keys (since many keys can > reference the same content) > content table has only one field - text > keys table has name and content_id > > example for key: help_about > example for content: "This website is for blablabla.." > > I want to add support for translations. > is it reasonable to store the content in separate table for each > language? > for example - content_english, content_spanish, etc. > If it is, how will rails handle it? currently Content.find 1 will > return the text of contents table. > and I will need to tell rails to grab it from content_english or > content_spanish. > > btw, I looked at a gettext example and it uses only one table with > locale field to determine what language to show. but I am not sure > it''s a good solution for massive chunk of content and many languages. > > > Thanks! > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Thanks Walter. Kete looks like an awesome project. It looks like the simplest solution for me would be to add language_id field to my content table and maybe later on I''ll refactor it to other solution. mongo db sounds awesome, but I am not sure where to start - the github page doesn''t explain about installing/using it. On May 2, 4:50 am, Walter McGinnis <walter.mcgin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> HI oren, > > There was recent similar discussion about design for content > translations and the answer I gave there may be useful to you: > > http://osdir.com/ml/RubyonRailsTalk/2010-04/msg02235.html > > I''m currently adding content translation to the Kete open source Rails > app (http://github.com/kete/keteandhttp://kete.net.nz). You may > find some example code there useful. > > A lot of people, including myself withhttp://github.com/kete/mongo_translatable, are starting to use a NoSQL > backend for translation. The latest I18n gem just added Tokyo Cabinet > support, too. > > Hope this helps, > Walter > > > > On Sun, May 2, 2010 at 4:40 PM, oren <orengo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I am building a Web service that will provide content for different > > client via Rest API. > > > currently I have: content has_many :keys (since many keys can > > reference the same content) > > content table has only one field - text > > keys table has name and content_id > > > example for key: help_about > > example for content: "This website is for blablabla.." > > > I want to add support for translations. > > is it reasonable to store the content in separate table for each > > language? > > for example - content_english, content_spanish, etc. > > If it is, how will rails handle it? currently Content.find 1 will > > return the text of contents table. > > and I will need to tell rails to grab it from content_english or > > content_spanish. > > > btw, I looked at a gettext example and it uses only one table with > > locale field to determine what language to show. but I am not sure > > it''s a good solution for massive chunk of content and many languages. > > > Thanks! > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Thanks Walter. Kete looks like an awesome project. It looks like the simplest solution for me would be to add language_id field to my content table and maybe later on I''ll refactor it to other solution. mongo db sounds awesome, but I am not sure where to start - the github page doesn''t explain about installing/using it. On May 2, 4:50 am, Walter McGinnis <walter.mcgin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> HI oren, > > There was recent similar discussion about design for content > translations and the answer I gave there may be useful to you: > > http://osdir.com/ml/RubyonRailsTalk/2010-04/msg02235.html > > I''m currently adding content translation to the Kete open source Rails > app (http://github.com/kete/keteandhttp://kete.net.nz). You may > find some example code there useful. > > A lot of people, including myself withhttp://github.com/kete/mongo_translatable, are starting to use a NoSQL > backend for translation. The latest I18n gem just added Tokyo Cabinet > support, too. > > Hope this helps, > Walter > > > > On Sun, May 2, 2010 at 4:40 PM, oren <orengo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I am building a Web service that will provide content for different > > client via Rest API. > > > currently I have: content has_many :keys (since many keys can > > reference the same content) > > content table has only one field - text > > keys table has name and content_id > > > example for key: help_about > > example for content: "This website is for blablabla.." > > > I want to add support for translations. > > is it reasonable to store the content in separate table for each > > language? > > for example - content_english, content_spanish, etc. > > If it is, how will rails handle it? currently Content.find 1 will > > return the text of contents table. > > and I will need to tell rails to grab it from content_english or > > content_spanish. > > > btw, I looked at a gettext example and it uses only one table with > > locale field to determine what language to show. but I am not sure > > it''s a good solution for massive chunk of content and many languages. > > > Thanks! > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Mon, May 3, 2010 at 3:06 AM, oren <orengolan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks Walter. > Kete looks like an awesome project.Thanks. It''s been good to work on and useful.> > It looks like the simplest solution for me would be to add language_id > field to my content table and maybe later on > I''ll refactor it to other solution.I usually store locale in the table for the content without splitting out to a languages (or locales) table and storing a locale_id. Rails only stores i18n.locale as a symbol. I haven''t had a need for tighter constraints on the data for locale than that.> mongo db sounds awesome, but I am > not sure where to start - the github page doesn''t explain about > installing/using it.Yep, that''s in the works. In the meantime, check out http://github.com/kete/mongo_translatable/tree/master/test/full_2_3_5_app_with_tests which is a full (but simple) Rail 2.3.5 app for testing purposes. You can dig around there, including the tests, to see the basics about how to mongo_translatable works. I''ll get to the README before too long. Cheers, Walter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.