You are not logged in.

1

Tuesday, June 6th 2017, 12:04am

Multilingual/multi-language support for krpano viewer = internationalization = i18n

Please find enclosed the multi-language support for krpano viewer.
You can check it when downloading the demotour-corfu-i18n.zip and unzip it in the ..krpano/viewer/examples/ folder
It creates the subfolder ..krpano/viewer/examples/demotour-corfu-i18n
When starting the demotour-corfu-i18n/index.html file you can see the original demotour-corfu virtual tour available in 4(3) languages (en, en-US, de, sk). The language selector is among the krpano buttons and in the context menu, too.

Features:
- krpano viewer translated (contextmenu, skins, tooltips, VR menus) without change of original code;
- no need to mark strings in advance;
- no need to create a master list;
- possible to add a new language version to the existing krpano virtual tour;
- possible to enhance with the next language without performance overhead;
- language specific code enhancement;
- you can reuse one phrase on multiple places;
- you can set the language from outside of the krpano viewer using initvars:{i18n_lang:"de"}
- scene/hotspot title change without changing the original xml file;
How to use it:
- add i18n folder to your vtour folder;
- add <include url="i18n.xml" /> into your tour.xml (at the end);
- start your tour.html with initvars:{i18n_lang:"de"} in the embedpano or in the starting URL add the parameter ?initvars.i18n_lang=de
- edit your language dictionary with your translation.

Files in the i18n folder:
i18n.xml for includes and language selector code;
i18n.vskin.xml enhances skin\vtourskin.xml with i18n skin and functionality;
i18n__.xml set your scene and hotspot titles with the language dictionary fields;
i18n__en.xml, i18n__en-US.xml, i18n__de.xml... are placeholders for a particular language dictionary;
please note, that the English is my coding language, so the i18n__en.xml has just reset task.
The i18n__en-US.xml is a language enhancement when different from basic (e.g. pt and pt-BR).
The German i18n__de.xml dictionary has English texts from the code as a comment. When you can translate it into your language and append to the post, we can expand krpano.
/flags/ is for language/country flag images;

The i18n does not support locale date, plurals, number, units available via Javascript and browser support.

The running example with some more features is here:
http://pavel.ursiny.sk/pano/at/Millstatt…rs.i18n_lang=en
If you like it and want to have it in your language let me know. I can upload your translation there.

Have a great internationalization!
Pavel

I uploaded the update for 1.19pr13. The dynamic skin selector works, too.
pur has attached the following files:

This post has been edited 3 times, last edit by "pur" (Oct 10th 2017, 8:48pm)


jordi

Professional

Posts: 583

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

2

Tuesday, June 6th 2017, 10:28am

Nice you share it !

even there are other ways..
everpano.com step beyond 360

3

Saturday, July 31st 2021, 2:06am

does anyone have a french translation file ? *squint*

4

Tuesday, February 8th 2022, 10:42am

Hello,

do you know if i can do the same switch language at the begining of a tour ? I want that user choise his language in a welcome popup, when click on flag, i just want that the language_1.xml load, it's not important if it's not possible to change after. I do some tries but without success if someone can help me, thanks.

Philippe

5

Sunday, February 20th 2022, 9:37pm

Hi Philippe,

You can set the initvars.i18n_lang in the URL

Source code

1
- start your tour.html with initvars:{i18n_lang:"de"} in the embedpano or in the starting URL add the parameter ?initvars.i18n_lang=de 


See my example
https://pavel.ursiny.sk/pano/Art/Reforma…rs.i18n_lang=fr

By default it starts as a Slovak version.

Thanks and have a great day!

Pavel