Hello,

I'm writing some back-end code to automate translations. I would like to 
populate a Unit object with a target multistring. I would like to learn 
more about the multistring object in relation to translations; 
unfortunately, the API doesn't provide me with enough information about 
the behavior of multistrings.

How should I create a multistring to store a translation? Should I 
construct it with the following:

s = "hello world"
ms = multistring(s)

What about multiple translations? Is this correct?
ss = ["hello world", "hi world", "hello earth"]
ms = multistring(ss)

How do I access each of the translations? If I use ms.strings, I get the 
following:

[multistring([u'hello world',u'hi world',u'hello earth']), u'hi world', 
u'hello earth']

I see that I can get the alternative translations by referencing 
ms.strings[1] and ms.strings[2], but how should I access the first 
string (e.g. "hello world")? If I use unicode(ms), I can get "hello 
world", but is this the best approach?

If I want to add another translation, should I use ms.strings.append("hi 
earth")?

What are your recommendations for best practices for working with 
multistring? I want to make sure that my code follows the use of your 
patterns correctly.

Thanks for your help,
Nick

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle

Reply via email to