You are not logged in.

1

Friday, September 9th 2016, 5:38pm

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:

Source code

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:

Source code

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:

Source code

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:

Source code

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


and language data like this:

Source code

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>

This post has been edited 2 times, last edit by "Muxi" (Sep 9th 2016, 6:31pm)


spacerywirtualne

Professional

Posts: 907

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Saturday, September 10th 2016, 10:15am

Try this code


Source code

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));" />


Source code

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 online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

3

Saturday, September 10th 2016, 3:09pm

thanks, Piotr.

It was only a matter of

Source code

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

Source code

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


is working.

best regards