title tag localisation

  • Hello,

    What do I want to achieve?
    I try to build a multilingual tour by using the KRPano standard skin. Apart from more detailed illustrations, which I will provide, I'm fighting with setting the title tag of the scenes properly according to the chosen language.

    What did I do so far?

    step 1: I created an onstart event, which is calling an action, "a_setlanguage(gb);"

    step 2: I created the action

    (The user shall be able to select the language by changing the variable).

    step 3: I wanted to edit the title tag accordingly

    <scene name="scene_01" title="get(tit_01)" onstart="" thumburl="panos/01.tiles/thumb.jpg" lat="" lng="" heading="">


    But all I get is a title like "Virtual Tour - get(tit_01)". Where is my mistake? Which way to go?


    All help appreciated,
    Michael

  • Hi mstoss

    You can not do that in a dynamic way.

    <scene name="scene_01" title="get(tit_01)" onstart="" thumburl="panos/01.tiles/thumb.jpg" lat="" lng="" heading="">

    There is another way, it may not be too smart but working.

    You can switch languages using the lang variable.

    Code
    set(lang,de)

    or

    Code
    set(lang,en);

    You can modify the code to your needs.

    regards *thumbup*

    Piotr

  • Thank you very much Piotr,

    anyhow, this seems not to do, what I need, at least not immediately.

    In this way, I can produce a language version of the title tag. E.g.

    <scene name="scene_01" title="tit_01" onstart="a_setlanguage(scene_01); action(activatespot,mp_01, 0);"

    can be resolved to any language related value for the titel in this way, but I don't know how I can continue using the standard skin xml. There you need to refer e.g. to

    "... showtext(get(scene[get(linkedscene)].title)... "

    And the title remains still the same... *sad*

    Yours,
    Michael

  • Amazing. I did not try that item stuff before and I did not try with the actual example here yet, but I remembered your approach, when I tried to figure out a similar problem when setting onhover-events for map-hotspots. I managed to do that your way there! Tomorrow I will try the title-tag stuff then *smile*

    (Switching showtext according to chosen language?)

    Great help already now, THANKS A LOT

    edit: uuups. That was a bit too early - the hover information is not being refreshed properly.

    Michael

    Edited once, last by mstoss (January 23, 2013 at 11:59 PM).

  • Hi Piotr and all,

    I used the proposed solution by Piotr with success:

    First you need to define a list of the descriptions to be used in the desired languages:

    then you need a variable for the language switch, in my case I called it "v_lang"
    I added a custom-tag to the scenes, called "langtit", eg. <scene name="scene_01" title="Better title of scene 01" langtit="01"... >
    This seems not necessary, it was only a result of my proscess and I did not want to strip it for this additional tag, once it all was running. Obviously, you can fill the name="" parameter in s_tit with e.g. "scene_01", "scene_02" etc instead.

    then you locate the "skin_hotspotstyle" and edit the hover-parameter:


    In the "skin_addthumbs"-action (at the end) and in the "skin_update_scene_infos"-action (at the beginning) you need to edit the code as well:

    Code
    showtext( get(   s_tit[get(v_lang)].item[get(scene[get(linkedscene)].langtit)].val   )  
    	   								,SKIN_TOOLTIPS
    	   								);    );
    Code
    if(title, txtadd(layer[skin_title].html, get(title), ' - ', get(scene[get(xml.scene)].title) ); , copy(layer[skin_title].html, 
    
    
    		    s_tit[get(v_lang)].item[get(scene[get(xml.scene)].langtit)].val ); );

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!