开发者

Using database for Internationalization & Localization

The CakePHP book has a section on Internationalization & Localization. Bascially what it says is Cake will generate a pot file and we have to create a .po for differ开发者_Python百科ent language file from the pot file.

My problem is I want the user to be able to edit these localized text so instead of storing the localized text in the .po file I want to store them in the database.

So how can I store the localized text in the database?


There's a Behavior for that.

Personally I find the TranslateBehavior to be rather inflexible though, so I usually just go with a separate table connected to the main model via a belongsTo relationship which contains all the translations. I then pick the one to display in the View.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜