views:

44

answers:

1

Hello There,

I am currently working on my own implementation of a MVC framework. I would like to know how to add language layer to my framework so that it could support multiple languages other than english. What's the role of unicode in this case?

+1  A: 

Frameworks frequently utilize a concept of "localization files" (.po files as a standard) to do UI translation. In your view and controllers, whenever you want to show a piece of text, instead of calling

echo "Hello"

You'd do

echo MyFramework::Translate("Hello")

That Translate() function just looks up the right .po file, and based on the passed in "ID" of the phrase, returns the desired localized text.

Alex