Reputation: 3582
I wrote a program in visual studio in English. Now I want to add a language selection to it, so that the user can change the program into other languages. I searched from the internet, but mostly they are about methods need to use a third-party program. Can I just create some kinds of files like .txt or .dll or whatever to load to do the translation??
Thank you!
Edit
The ideal way is to create an Microsoft Excel file with ids and corresponding language translations. Then when I change the language, it can do the conversion using this file. That is what I really want. Many thanks.
Upvotes: 0
Views: 644
Reputation: 1885
There are two parts to it
Writing your program so that it can display text in various languages. Sticking to just language issues, you will need to ensure that all texts in your program are collected into a separate file. Additionally all your text should be in Unicode characters. The details of externalization into external files depend on the compiler/framework. This thread suggests some - Resources for I18N in C++ Full internationalization is a bit more involved though - you need to take care of e.g. date formats and all.
And then there is the part about actually providing the needed translations. e.g. if your program has an display item (menu, output string etc) named 'foo', then you need to provide the translations for ALL languages that you want to support; e.g. foo == baz in say Hindi. You can use some machine translations for this; but usually it is done by humans.
The operating system itself would take care of standard menu items when the user changes the language. e.g. the 'copy' menu would be translated by the OS into the user language. But I think that also happens when you use some frameworks, like MFC, and stick to the framework guidelines.
Upvotes: 2