You are not logged in.

1

Saturday, December 21st 2013, 5:48pm

Please help in building a multilingual interface

Hi!

Change language by pressing the (flag):

Source code

1
2
onclick="set(currentlanguage, russian);
onclick="set(currentlanguage, english);



Names panoramas, hotspots and descriptions in a separate file.
Example, text_data_en.xml:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<krpano>
<language name="english">

<text name="main_title"				value="City Walk" />
<text name="menu"					value="Main menu" />
<text name="skin_load"				value="Loading..." />
<text name="skin_sc_discr_on"		value="Show description" />
<text name="skin_sc_discr_off"		value="Hide" />

<text name="scene_021" 	
		sc_title="Memorial complex “Walk of Fame”" 
		sc_discr="...1"
	  spot-00-01=""	/>
...

</language>
</krpano>


Displays the name of the current scene:

Source code

1
2
txtadd(layer[skin_scene_title].html, get(language[get(currentlanguage)].text[main_title].value), '[br]', get(language[get(currentlanguage)].text[get(xml.scene)].sc_title) ); , 
copy(layer[skin_scene_title].html, language[get(currentlanguage)].text[get(xml.scene)].sc_title );

It works.

Name hotspot:

Source code

1
onhover="if(skin_settings.tooltips_hotspots, if(linkedscene, showtext(get(language[get(currentlanguage)].text[get(linkedscene)].sc_title),SKIN_TOOLTIPS)) );"

It works too.

Function skin_addmapspots():

Source code

1
2
3
4
5
6
7
...
if(skin_settings.tooltips_mapspots, 
escape(spottitle,get(language[get(currentlanguage)].text[get(scene[get(i)].name)].sc_title)); 
txtadd(spothoverevent,'showtext(',get(spottitle),',SKIN_TOOLTIPS)'); , set(spothoverevent,null); 
				);
addspot(get(spotname), get(scene[get(i)].lat), get(scene[get(i)].lng), get(scene[get(i)].heading), false, get(spotclickevent), get(spothoverevent));
...


get(language[get(currentlanguage)].text[get(scene[get(i)].name)].sc_title)
Displays the name of the mapspot only on default language. Language select dont work.


As I understand it, the call skin_addmapspots(); occurs only once. By event onmapready.

I tried to call this function when changing the language:

Source code

1
2
onclick="set(currentlanguage, russian); skin_addmapspots();
onclick="set(currentlanguage, english); skin_addmapspots();

It did not work Mapspot signed only on the default language.


What do I need to change the language of signatures mapspot?

This post has been edited 1 times, last edit by "localhostroot" (Dec 21st 2013, 6:00pm)