Sie sind nicht angemeldet.

1

Donnerstag, 23. August 2012, 05:09

multi language option using text field

I have been trying to use multiple languages in a text field as follows:


text1="Hello"
text2="This text is written in English."
text3="Another English line"
/>

text1="Nederlands"
text2="Dit is nederlands"
text3="Nog een nederlandse zin"
/>

I set the language and test using the trace routine that the principle works:



set(language,english);
trace('data version - startup language=', get(language));
trace('text1=', get(data[english].text1) );
trace('text2=', get(data[get(language)].text2) );
</action>

which works as expected

and then here's the text field (I have tried a host of ways to try and get some text to display in the HTML field...

url="%SWFPATH%/plugins/textfield.swf"
align="leftbottom" x="50" y="150" width="300"
children="false"
html="data:get(data[[get(language)]].text2) )"
css="text-align:left; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:14px;"
autoheight="true"
... etc

the result ... is a display of -1 in the text field. I was rather hoping to see english message #2...

Any ideas, anyone??

Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »MJE« (23. August 2012, 06:55)


2

Donnerstag, 23. August 2012, 12:08

Hi,

first - I have moved your post to this separate thread, because it has nothing to do with the 1.0.8.15 release itself .


about your problem - what you are trying to do is not possible!
with 'data:' only the whole content of a <data> element can be addressed,

as alternative you could use the onloaded event and set the html attribute manually,
e.g.

Quellcode

1
2
html=""
onloaded="copy(html, data[get(language)].text2);"


best regards,
Klaus

3

Donnerstag, 23. August 2012, 17:18

Hi Klaus,
Sorry about the wrong location for the post - I'm not much of a forum user. Thank you very much for your suggestion - that seems to do the trick, I now need to figure out how to re-fresh that text field(s) on the screen if the user changes the text field, but that's a more manageable problem.
best regards
Maris