For my project, I need to store translations in the database, for which I've implemented doctrine data sour开发者_JAVA技巧ce. However, I would like to leave standard translations (sf_admin and messages) in xml and keep them under source control. Is it possible to have 2 i18n instances that use different data sources? Or maybe one instance that can load data from different sources according to dictionary name?
I don't think there is a solution that doesn't require overriding sfI18n. An sfMessageSource_Aggregate exists but it seems nearly impossible to configure factories.yml to initialize it correctly.
You probably need to implement your own sfI18n::createMessageSource, that constructs the Aggregate passing the different sources in the constructor.
精彩评论