Author Topic: Conceptual thinking: support different translations  (Read 1641 times)

0 Members and 1 Guest are viewing this topic.

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Conceptual thinking: support different translations
« on: June 24, 2013, 04:32:56 PM »
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? :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Conceptual thinking: support different translations
« Reply #1 on: June 24, 2013, 08:50:14 PM »
I saw this on Through The Interface once, it used resources to hold strings. I'll try to find the post for you.
I haven't crossed this road personally http://through-the-interface.typepad.com/through_the_interface/2009/06/registering-autocad-commands-with-localized-names-using-net.html .
« Last Edit: June 24, 2013, 10:08:58 PM by WILL HATCH »

huiz

  • Swamp Rat
  • Posts: 919
  • Certified Prof C3D
Re: Conceptual thinking: support different translations
« Reply #2 on: June 25, 2013, 02:22:53 AM »
Thanks Will, I found that too. But it is not quite the easy solution I had in mind :-)
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.