-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate custom type for internationalization
PostPosted: Thu May 16, 2013 7:34 am 
Newbie

Joined: Wed May 04, 2011 3:33 pm
Posts: 4
Hello,

We're trying to add content translation to an existing application without changing the database layout too much.
The idea is to use a hibernate custom string type that will store the content in the default language in the current table and will use another table to store/retrieve the translated content in other languages (a single table for all entity translations).

We're stuck and don't know if we can do a custom type that can use two tables or how to approach this differently!
Has anyone attempted anything similar or has a better idea on this?

Thanks in advance,
Alex


Top
 Profile  
 
 Post subject: Re: Hibernate custom type for internationalization
PostPosted: Thu May 16, 2013 8:20 am 
Newbie

Joined: Sun Oct 02, 2005 12:49 am
Posts: 15
One of my colleagues attempted a similar thing, but not at the database level. He used a library called gettext. Seems to be quite the popular approach.

http://www.gnu.org/software/gettext/


Top
 Profile  
 
 Post subject: Re: Hibernate custom type for internationalization
PostPosted: Fri May 17, 2013 4:43 am 
Newbie

Joined: Wed May 04, 2011 3:33 pm
Posts: 4
Thanks for the reply, but we're trying to translate the content that the user is entering like titles, descriptions, etc.
Our interface is fully translatable right now.

Right now we're thinking to implement a custom UserType and load the translation for the current locale in the nullSafeGet method, but we're searching for a better solution.
Has anyone implemented a custom hibernate type that can pull the data from two tables? Or maybe have a better solution for this internationalization problem?

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.