Sunny
Sunny

Reputation: 1983

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 different 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?

Upvotes: 1

Views: 1437

Answers (1)

deceze
deceze

Reputation: 522155

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.

Upvotes: 1

Related Questions