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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.