You are not logged in.

Dear visitor, welcome to 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.


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 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.

- 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:…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!

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)



Posts: 509

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message


Tuesday, June 6th 2017, 10:28am

Nice you share it !

even there are other ways.. step beyond 360