Attached a small example, based on yours, how I did it.
I use text files instead of a database. I leave it up to you to adapt the principle to your requirements with the database.
All the texts in the program are changed, but all messages generated by the operating system are in it's language.