Sie sind nicht angemeldet.

1

Freitag, 9. September 2016, 17:38

switch languages

Hi, I have a tour with textfield-info-window for each pano which you can see in different languages.
But I don't get the language to change. The first choosen language is staying no matter what language I click. And changing a scene also doesn't show the new but the old info from first pano.
I thought maybe the keep="true" is responsible but I don't know what to do to get it working...
any hints?

3 language switchers:

Quellcode

1
2
3
<plugin name="lang_de" url="plugins/textfield.swf" html="de" onclick="txtadd(lang, get(xml.scene),_de);show_info();" />
	<plugin name="lang_en"  url="plugins/textfield.swf" html="en" onclick="txtadd(lang, get(xml.scene),_en);show_info();" />
	<plugin name="lang_es" url="plugins/textfield.swf" html="es" onclick="txtadd(lang, get(xml.scene),_es);show_info();" />


info-window:

Quellcode

1
2
3
4
5
<plugin name="text_pano" url="plugins/textfield.swf" keep="true" visible="false"
		html=""
...
   	onclick="show_info();"
  	


action to show window:

Quellcode

1
2
3
4
<action name="show_info">
		set(plugin[text_pano].html, data:get(lang));
	switch(plugin[text_pano].visible); 
	</action>


scenes like this:

Quellcode

1
2
3
<scene name="pano1" ...</scene>
<scene name="pano2" ...</scene>
<scene name="pano3" ...</scene>


and language data like this:

Quellcode

1
2
3
4
5
6
7
8
9
<data name="pano1_de">...</data>
<data name="pano2_de">...</data>
<data name="pano3_de">...</data>
<data name="pano1_en">...</data>
<data name="pano2_en">...</data>
<data name="pano3_en">...</data>
<data name="pano1_es">...</data>
<data name="pano2_es">...</data>
<data name="pano3_es">...</data>

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »Muxi« (9. September 2016, 18:31)


Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Samstag, 10. September 2016, 10:15

Try this code


Quellcode

1
    <plugin name="lang_de" url="plugins/textfield.swf" html="de" onclick="txtadd(lang, get(sccene[get(xml.scene)].name),'_de');show_info(get(lang));" />  <plugin name="lang_en" url="plugins/textfield.swf" html="en" onclick="txtadd(lang, get(sccene[get(xml.scene)].name),'_en');show_info(get(lang));" />  <plugin name="lang_es" url="plugins/textfield.swf" html="es" onclick="txtadd(lang, get(sccene[get(xml.scene)].name),'_es');show_info(get(lang));" />


Quellcode

1
2
<action name="show_info">  	copy(plugin[text_pano].html, data[%1].content);  	switch(plugin[text_pano].visible);   </action>
  ...



Piotr


p.s. I dont know why "Insert Code" not accept my line brakes...
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Samstag, 10. September 2016, 15:09

thanks, Piotr.

It was only a matter of

Quellcode

1
copy(plugin[text_pano].html, data[%1].content); 



the transfer of the variable worked already in my example, so no need to change the other things.

also

Quellcode

1
copy(plugin[text_pano].html, data[get(lang)].content); 


is working.

best regards