开发者

i18N messages from database tables - java spring 3.0

开发者 https://www.devze.com 2023-03-17 18:12 出处:网络
I have a requirement of showing translated messaged from database tables.Anybody please provide me java/spring3.0 sample code to implement this.

I have a requirement of showing translated messaged from database tables.Anybody please provide me java/spring3.0 sample code to implement this.

I have table structure something as below.On the ui screen,whenever the language is changed,i should be able to see corresponding translated message from PRODUCT_TL table.

CREATE T开发者_如何转开发ABLE PRODUCT ( product_id number );

CREATE TABLE PRODUCT_TL ( product_id number, locale varchar2(5) , description varchar(255), );


And so what the question?

In what format the UI need its localized data? Where I work we use XML for all data send to UI. Localization is done in business side. In other companies it's comon pratice to use use properties file load them as resources bundle and providing them to the UI. GWT prefer to compile a localized version for each locale, ensuring optimal performance.

You have a database, that's fine. But how do you plan to access it? JDBC by a direct SELECT? Calling a stored procedure? Using an ORM like JPA or hibernate? And how do you connect to the database? Will you have a caching strategy to reduce DB load?

You'll have to understand your needs, think about a solution, design it, try it.

Then if you have a specific problem, feel free to ask here.

0

精彩评论

暂无评论...
验证码 换一张
取 消