In the process of designing an engine which will be used to translate phrases that are processed by the application.
The ideal is to look for a set element in the XML, identify it by its category and then submit it to a translation engine that will check to see if the phrase has already been converted or needs to be. If it does it will be placed into a translation table.
The basic structure of the table A is:
element_id | element_type | category_type | value | language_id
Now there is a GUI that will be used to do the translation. User will select a given element and category from drop downs along with the from language and the to language.
Using the element, category and language a list will be display of those items that have not been converted.
User then will enter in the converted phrase.
The thought to manage all this is to use a mapping table:
mapping_id | element_from_id | element_to_id | from_language | to_language
So lets say we have the following in the first table
1 | DMG_AREA | DAMAGE | Quarter Panel - Left | EN
User translates it into FR using the GUI
Now table looks like this:
1 | DMG_AREA | DAMAGE | Quarter Panel - Left | EN
2 | DMG_AREA | DAMAGE | QPL | FR
The second table looks like this
1 | 1 | 2 | EN | FR
2 | 2 | 1 | FR | EN
So that we can then build the resource bundles by doing a simple query of Table B to determine the key/value pair for a "resource bundle" hashmap that will be placed into memory for on the fly translation.
Suggestions for improvement - does it make sense - is there a simpler way - open source solution already out there?