There are a few possibilities to support translations in the software. Also in Visual Studio there are options to use different languages but I'm not sure if that is the best or most flexible system.
I thought of a way to support other languages in my software. How should I do that without the need to rewrite everything or to build different versions. Because I have experience with systems like WordPress, I thought of using the language system of WordPress. That is using functions to echo the tekst onto the screen ( i.e. "_e('Hello World!')" ), but if it finds a translation then it will print that line in another language.
So, I can use a function that does the same thing with strings, and use this also when a Form initializes, checking each text value of the existing controls and change that in the wanted language. In that way I can support different languages with just a text file or XML. People can create their own translations too.
But is it effective to loop through a lot of strings every time? Are there better ways? Do I miss some pros and cons?
Pro:
- translation files outside the software
- people can add/edit
- easy to translate texts on controls
- if no translation available it still shows readable text in original language
- no need to compile a lot of different versions
Con:
- not easy to control the text length (on controls)
- not all software is useful in other countries, so supporting a translation system might be overkill
- searching very long strings in a huge XML might not be efficient
- how to use different local date formats and seperators in numbers
Well, to be short, how do YOU do this?
