I am building a php web app that requires internationalization. I have decided to use get-text for system related strings and perhaps some database tables for user generated content.
For example, a user might be able to post a blog post. He should be able to post different versions of that post in different languages. I can implement this by storing all the posts in the posts table with an extra column denoting the language.
The difficult bit is trying to internationalize system strings stored in the database.
For example, I have a table that stores privileges. Each privilege should have a string that describes what this privilege does.
At the moment, it is stored in a table like this:
app_privileges
- id
- privilege
- Some other columns
- Description
I plan to use an application like PoEdit to generate gettext files. It is able to search through all the php files to grab the strings. But in the cases like this where the string is stored in the database, it can be a fair bit of work to extract the string for transation. What are some tricks and solutions to handling this?
Finally, lets say I have some data types and forms that users can create and define in the app. For example, defining a "product type" for a shopping cart. This means that the product will have its own unique set of attributes and descriptions. These attributes will require translating along with the description.
The same case with forms. The user can create a form which might be stored in a set of tables. These forms then need to be translated.
What are some database models I can use to store translations for forms and product types?
Cheers :)