You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, February 8th 2011, 8:48pm

Changing Language - Menu and Text

Hi,

I'm trying to build a menu to choose the language.

- pop up effect on hovering over the current flag icon
- switch position between the current and chosen flag icon
- pop down effect on click

Attached is a picture of the situation.


Finally how to insert the new language interfaces?

1- a global.xml, map.xml, list.xml, ... for each language?
2- a language.xml for each language?
3- or only a single language.xml with all the translations?
4- what else?

What about the code?

Thanks in advance,
Marco
Marco

jpdeglet69

Intermediate

Posts: 212

Location: France

Occupation: VR Maker and Document Management Expert

  • Send private message

2

Wednesday, February 9th 2011, 1:34pm

Hi,

In my tours, to manage different languages (de, en, es, fr), I manage different XML ressources files which load only texts attributes for buttons, hotspots, html/textfields...(but today, I'm late to translate all my html:texfields *sad* )

http://www.jphd360.net/visites/LesOublis…s.html?m.lng=fr

http://www.jphd360.net/visites/LesOublis…s.html?m.lng=en

To try to be more efficient, I select the language directly from the user/browser properties.
So depending of these properties, the main page
http://www.jphd360.net/visites/LesOublis/LesOublis.html load "de", "en", "es" of "fr" texts ressources

and if the language code is not recognized by my main XML script, I load "en" default ressources.
Best regards,
JPhD
VR-Guide®/Eleana CEO
https://vr-guide.online

3

Thursday, February 10th 2011, 12:12pm

Hi,

JP, thanks for your suggestion: it might be a solution but I'd like most the dropdown menu solution.
Hope to find help in the forum.


So, using the following code I was able, at least, to show and hide the menu... but it happens only one time. There must be some problem with the code.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
	<plugin name="italy"   url="flags/italy.png"   parent="controlbar" keep="true" zorder="1" align="bottomleft" x="465" y="60" onhover="showtext(Italiano);" visible="false" />
	<plugin name="germany" url="flags/germany.png" parent="controlbar" keep="true" zorder="1" align="bottomleft" x="465" y="35" onhover="showtext(Deutsch);"  visible="false" />
	<plugin name="usa"     url="flags/usa.png"     parent="controlbar" keep="true" zorder="1" align="bottomleft" x="465" y="6"  onhover="showtext(English);" onclick="action(usa-showflag);" visible="true" />


    <action name="usa-showflag">
	set(plugin[usa].onclick,action(usa-hideflag););
	set(plugin[italy].alpha,0);
	set(plugin[italy].visible,true);
	tween(plugin[italy].alpha,1);
	set(plugin[germany].alpha,0);
	set(plugin[germany].visible,true);
	tween(plugin[germany].alpha,1);
    </action>
    <action name="usa-hideflag">
	tween(plugin[italy].alpha,0);
	tween(plugin[germany].alpha,0);
    </action>


I also tried:

Source code

1
2
3
4
5
    <action name="usa-hideflag">
	set(plugin[usa].onclick,action(usa-showflag););
	tween(plugin[italy].alpha,0);
	tween(plugin[germany].alpha,0);
    </action>


or

Source code

1
2
3
4
5
    <action name="usa-hideflag">
	tween(plugin[italy].alpha,0);
	tween(plugin[germany].alpha,0);
	set(plugin[usa].onclick,action(usa-showflag););
    </action>


... doesn't work either.


Actually I'd need help on coding a general rule for such a menu so that the chosen flag will take the place of the current flag in the controlbar.
It'd be nice also a dropdown effect on opening/closing the menu.

I tried but don't understand the krpano code when it comes to complex actions.

I don't know AS3 either, so I'm not sure if creating a plugin in Flash might be either easier or just possible.

Thanks,
Marco
Marco

4

Thursday, February 10th 2011, 1:59pm

The best solution it's 3

all in main xml with variable ;-)

egg

on each showtext you put a get() like this

Source code

1
onhover="showtext(get(park));


make any actions for each language and set()

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<action name="francais">
....
  set(park,'Informations Parking');
....
</action>

<action name="english">
....
  set(park,'Park Informations');
....
</action>

<action name="espagnol">
....
  set(park,'Informaciones Parking');
....
</action>


you can call a language by onstart and after with you flag call the language you want

5

Friday, February 11th 2011, 1:53am

Hi,

Job thank you very much now I have something at least partially working... I mean I can't return to english language; also, please, could someone help on coding a dropdown effect and repositioning of the flag of the chosen language in the controlbar?
By the way, it'd be great to have a general action for a dropdown icons menu or, better yet, a plugin. *smile*

Here's my pano:

http://www.marcolanciani.com/Test/vr/A%20VR.html


And here's the code, which is not fully working:


Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
****************************************************************************************************
<!-- Languanges -->
****************************************************************************************************

    <plugin name="italy"   url="flags/italy.png"   parent="controlbar" keep="true" zorder="1" align="bottomleft" x="465" y="60" onhover="showtext(Italiano);" onclick="action(italy-showflag); action(italiano);" visible="false" />
    <plugin name="germany" url="flags/germany.png" parent="controlbar" keep="true" zorder="1" align="bottomleft" x="465" y="35" onhover="showtext(Deutsch);"  onclick="action(germany-showflag); action(deutsch);"  visible="false" />
    <plugin name="usa"     url="flags/usa.png"     parent="controlbar" keep="true" zorder="1" align="bottomleft" x="465" y="6"  onhover="showtext(English);"  onclick="action(usa-showflag); action(english);"  visible="true" />



****************************************************************************************************
<!-- Actions to Change Text Language -->
****************************************************************************************************

    <action name="italiano">

        set(switch,'Alterna Visibilità Interfaccia');

        set(up,'Muovi In Alto');
        set(down,'Muovi In Basso');
        set(left,'Muovi A Destra');
        set(right,'Muovi A Sinistra');

        set(in,'Avvicina');
        set(out,'Allontana');

        set(initialview,'Schermata Iniziale');
        set(autoron,'Avvia Autorotazione');
        set(autoroff,'Ferma Autorotazione');
        set(openfs,'Apri Vista Schermo Intero');
        set(closefs,'Chiudi Vista Schermo Intero');
        set(dragmode,'Cambia Cursore - Modalità “Trascina”');
        set(movemode,'Cambia Cursore - Modalità “Muovi”');

    </action>
    <action name="deutsch">

        set(switch,'Info');

        set(up,'Info');
        set(down,'Info');
        set(left,'Info');
        set(right,'Info');

        set(in,'Info');
        set(out,'Info');

        set(initialview,'Info');
        set(autoron,'Info');
        set(autoroff,'Info');
        set(openfs,'Info');
        set(closefs,'Info');
        set(dragmode,'Info');
        set(movemode,'Info');

    </action>
    <action name="english">

        set(switch,'Switch Interface Visibility');

        set(up,'Move Up');
        set(down,'Move Down');
        set(left,'Move Left');
        set(right,'Move Right');

        set(in,'Zoom In');
        set(out,'Zoom Out');

        set(initialview,'Initial View');
        set(autoron,'Start Autorotation');
        set(autoroff,'Stop Autorotation');
        set(openfs,'Enter Fullscreen');
        set(closefs,'Exit Fullscreen');
        set(dragmode,'Change Cursor - “Drag” Mode');
        set(movemode,'Change Cursor - “Move To” Mode');

    </action>
    


****************************************************************************************************
<!-- Actions to Change Flag Language And Icon -->
****************************************************************************************************

    <action name="usa-showflag">
	set(plugin[usa].onclick,action(usa-hideflag););
	set(plugin[italy].alpha,0);
	set(plugin[italy].visible,true);
	tween(plugin[italy].alpha,1);
	set(plugin[germany].alpha,0);
	set(plugin[germany].visible,true);
	tween(plugin[germany].alpha,1);
    </action>
    <action name="usa-hideflag">
	tween(plugin[italy].alpha,0);
	tween(plugin[germany].alpha,0);
	set(plugin[usa].onclick,action(usa-showflag););
    action(english);
	set(plugin[usa].visible,true);
    </action>
    <action name="italy-showflag">
	set(plugin[usa].onclick,action(italy-hideflag););
	set(plugin[usa].alpha,0);
	set(plugin[usa].visible,true);
	tween(plugin[usa].alpha,1);
	set(plugin[germany].alpha,0);
	set(plugin[germany].visible,true);
	tween(plugin[germany].alpha,1);
    </action>
    <action name="italy-hideflag">
	tween(plugin[italy].alpha,0);
	tween(plugin[germany].alpha,0);
	set(plugin[usa].onclick,action(italy-showflag););
    action(italiano);
    </action>
    <action name="germany-showflag">
	set(plugin[usa].onclick,action(germany-hideflag););
	set(plugin[italy].alpha,0);
	set(plugin[italy].visible,true);
	tween(plugin[italy].alpha,1);
	set(plugin[usa].alpha,0);
	set(plugin[usa].visible,true);
	tween(plugin[usa].alpha,1);
    </action>
    <action name="germany-hideflag">
	tween(plugin[italy].alpha,0);
	tween(plugin[germany].alpha,0);
	set(plugin[usa].onclick,action(germany-showflag););
    action(Deutsch);
    </action>


Regards,
Marco
Marco

6

Friday, February 11th 2011, 5:22pm

Hi,

maybe I've found a solution for my drop down menu, but I need still a bit of help to code the action. This is the action I need:

Source code

1
	set(plugin[pluginname].position);


Where "position" is the x,y position on the controlbar as a parent.
I think it should work. Any suggestion?
I't's almost a week I'm on this: any help is welcome and really appreciated.

Regards,
Marco
Marco

7

Friday, February 11th 2011, 6:17pm

Source code

1
2
3
set(plugin[pluginname].x, position you want egg: 20);
or
set(plugin[pluginname].y, position you want egg: 20);

8

Saturday, February 12th 2011, 3:59am

Hi,

at last it's working! *smile*
Please, have a look:

http://www.marcolanciani.com/Test/vr/A%20VR.html

Also I noticed that the last letter of the text in the info box sometime is partially visible. Can I correct this?

Now any suggestion on how to translate the text on the contextmenu?

Thanks,
Marco
Marco

9

Saturday, February 12th 2011, 4:09pm

Yes working well !

with somes fonts i get the same issue, put your font normal and not italic, normally it's better

10

Saturday, February 12th 2011, 4:25pm

... and what about changing language on the context menu?
Anyone, any suggestion? I'm trying with no success...

Regards,
Marco
Marco

11

Saturday, February 12th 2011, 4:38pm

...no try yet

12

Saturday, February 12th 2011, 4:48pm

I changed the font to "normal": it works now... but I'd prefer "italic". Any chance?

Also I was able to change contextmenu language for my custom items (you can check the xml), but have no idea on how to change the language for "Enter Fullscreen" and "Exit Fullscreen" and other standard items like krpano and flash settings...
Any idea?

Thanks again for the support.
Regards,
Marco
Marco

13

Saturday, February 12th 2011, 4:55pm

try


Source code

1
2
3
4
5
6
7
8
9
10
<contextmenu fullscreen="false">
		<item name="copyright"     caption="© Marco Lanciani"                onclick="openurl(http://www.marcolanciani.com)" />
		<item name="Normal"        caption="get(Projection View - Normal)"        onclick="action(view_normal);"             separator="true" />
		<item name="Fisheye"       caption="get(Projection View - Fisheye)"       onclick="action(view_fisheye);"       />
		<item name="Architectural" caption="get(Projection View - Architectural)" onclick="action(view_architectural);" />
		<item name="Stereographic" caption="get(Projection View - Stereographic)" onclick="action(view_stereographic);" />
		<item name="Pannini"       caption="get(Projection View - Pannini)"       onclick="action(view_pannini);"       />
		<item name="Planet"        caption="get(Projection View - Little Planet)" onclick="action(view_littleplanet);"  />
        <item name="fullscreen"    caption="get(Enter Fullscreen)"                onclick="switch(fullscreen);"              separator="true" />
	</contextmenu>


and set in the action language

I never try, but perhaps it's working ;-)

14

Saturday, February 12th 2011, 5:40pm

Hi,

I already tried with

caption="get()"

It doesn't work: what I get in the actual context menu is

get()

By the way, have a look at the online xml: I've found a solution for my custom menu, but don't have a solution for translating Enter Fullscreen and Exit Fullcreen when changing language.

Regards,
Marco
Marco

15

Saturday, February 12th 2011, 6:27pm

Yes ! ! ! *thumbsup*

it's a good way, I think you'll find also for Enter Fullscreen

16

Saturday, February 12th 2011, 6:32pm

Keep this method to translate also combobox *w00t* *thumbup*

17

Saturday, February 12th 2011, 7:25pm

Thanks, *smile*

Marco
Marco

Destiny

Trainee

Posts: 61

Location: Australia

Occupation: Primary School Teacher and Freelance Photographer

  • Send private message

18

Monday, March 23rd 2015, 9:45am

Hi .. Are you able to update your url.. Its seems it is out of date.. I would like to see it working...

There seems to be a few options to get a change language, but some seem not to work to well.. Or if they do they seem a bit hard to get to work.. I like the options where the language has popup tab..

I have an option working but I am not entirely happy with it. if you hold your mouse over the menu it will change to the given language. The Desecration text also changes.., but is not alway accurate, but thats not my fault, its Google..

http://www.destinyvirtualtours.com/PTPV2…ml?html5=prefer

Are you able to share your final working option for me to play around with..

I do not come to this forum too often since PMs seem to take forever or never answered..

Destiny...

Hi,

at last it's working! *smile*
Please, have a look:

http://www.marcolanciani.com/Test/vr/A%20VR.html

Also I noticed that the last letter of the text in the info box sometime is partially visible. Can I correct this?

Now any suggestion on how to translate the text on the contextmenu?

Thanks,
Marco
Sometimes I might come across as being stupid; But I have an IQ of 137 *tongue*

Tuur

Sage

Posts: 3,173

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

19

Monday, March 23rd 2015, 5:06pm

Interesting you have going on here destiny.
Can you point us to how we can implement this in our tours?
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Destiny

Trainee

Posts: 61

Location: Australia

Occupation: Primary School Teacher and Freelance Photographer

  • Send private message

20

Monday, March 30th 2015, 10:36am

Hi, sorry for the delay.. I don't often come to this forum..

Its just the free Google Language widget placed in a div..

I will try to send you the how to do it..

Destiny..
Sometimes I might come across as being stupid; But I have an IQ of 137 *tongue*