Hi,
First of all please excuse me if this is not the right place for posting this question. But i am sure that the Hibernate community has loads of developers with experience in DB and OOP issues.
So here is my story:
we have to develop a framework for storing and gathering i18n data in a database. The requirement is to support translations in any number of languages. The sistem will have some hundreds of tables, part of them will be i18n able others not.
So my idea is to create a table with all the columns which are i18n able(COLUMN_NAMES), having FK to a table which holds the tables with i18n columns(TABLE_NAMES).
The main data in the tables will be in English. The translated data will be stored into another table that has foreign keys
1. to the column that is internationalized
2. to the id(PK) of the row with that data
3. to the languages table.
I would prefer to give you an example:
There are 2 tables COLORS and ITEMS that have i18n columns
COLORS
----------
Code:
id name
1 black
2 red
3 blue
ITEMS
-------
Code:
id name description
1 vegetables something
LANGUAGES
--------------
Code:
id code description
1 de German
2 fr French
TABLE_NAMES(this table will hold the tables that have i18n fields)
-----------------
Code:
id name
1 colors
2 items
COLUMN_NAMES(holds the columns that support i18n)
-------------------
Code:
id name id_table_names
1 name 1
2 name 2
3 description 2
I18NDATA
------------
Code:
id idrow id_column_name id_lang translation
1 1 1 1 schwartz
2 1 1 2 noir
3 1 3 1 etwas
4 1 2 1 gemuse
So in my opinion this schema allows me to store and gather data according to a specific language. The problem I think resides in implementing the preprocessing of all the SQL(HQL) queries.
Anyone any better ideas regarding this issue? Is there any open source framework for such an i18n issue? How this issue would be handled by an Hibernate guru?
Thanks in advance,
Florin