Hello. I have one idea for a dynamic localization and I really would like to hear what you think about it.
Well the idea is pretty simple there should be added on table that will hold the translated values for the locales. These values can be Tab names, module names, module description, text content whatever you like. The key to link the localized information will be the ID of the tab or module, the type of the entity for which the localized value is stored and the type of the property that should be localized (such as name, description, etc.). So the table will look like this:
- TranslationID (Identifier)
- EntityID
- EntityType
- EntityColumn
- Value
- Locale
So let's say we have a module with name: "module1" and ID: 4. In the translation table we add a record with the ID of the module (in EntityID), we set the type as Module (I have a Type table which holds all the types of entities), the EntityColumn is Name, Value will hold the localized value and locale the English locale ID.
In my application I decorate each property (of the Info class) that should be localized (such as name) with an attribute [Localize] and another showing the name of the column that holds the value. So when the dataprovider retrieves the information (e.g. ModuleInfo) it will check if there is attribute for localization if so it will get the information from the Module table but also from the Translation table. Because it has the ID of the entity, its type and for which column it needs the value it can be safelly retrieved. If there is no translated value it will use the value from the Module table (System-Default) if there is a translated value it will used the translated one.
This way I have only one table for translated strings that holds all the various types of translated properties in different locales.