I have always wondered how OSs such as Windows or Mac OS X can just change languages in 1 click and all a sudden, all message boxes, buttons etc are changed.
How are these sorts of mechanisms implemented?
Thanks
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.
The key to internationalization is to avoid hard-coding any text that will be seen by the user. Instead, call a function that checks the locale and chooses the text appropriately.
A contrived example: