Daniel
Daniel

Reputation: 418

Symfony translate database value before output

I have a table for 'alerts'. I would like to store there the alerts for the users in Engligh, and translate the alert into the users' culture before showing it. Like an usual message which is translated with the __() function.

Is this thing possible in Symfony 1.4?

Upvotes: 1

Views: 238

Answers (2)

thomas
thomas

Reputation: 2308

Should be no problem if you have messages.en.xml and messages.xx.xml which reflect the entries in the db. I haven't done it but I don't see why it should work ...

Upvotes: 0

Vadim Samokhin
Vadim Samokhin

Reputation: 3456

How many alerts do you have? Doubt that more than 100, no? It is normal to store stuff this size in xml translation files, anyway they are cached. And it is more simple to add new items in xml files than in database.

Upvotes: 1

Related Questions