We have a problem here.
We need to translate a website into multiple language. We already use gettext to translate the static content. But we have to translate some text content in multiple language.
The ui isn't a problem.
We found 2 ways to translate the text. 1. use JSON inside our text input Why this solution is bad. Every text input will need to be bigger because we can't guess the real size of the attribute.
Use the a translating table that keep reference to the original model and translate every field. It will still need big field because we cant define the field size by record.
Finally, the best solution I came with is creating a translating table. The table will keep foreign key of other tables. For each translation, we copy the record that need to be translated. Inside the translation table, there is 4 field, model_name(primary), reference_id(primary), translated_id(primary), locale(primary). This solution make it impossible to have multiple translation for the same model in the same language.
Last but not least, we could use something like someone proposed...a database gettext. We have a table that contain strings and only string (key, text, locale) so we can search for a model, a string that is the same as the one used in the model and then use the we found instead.
My opinion is that all of these solutions are hack, the 4 solution is probably the one that looks better.
As I didn't found any good documentation, I would really like to make this question shine.