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.

Birdseye

Trainee

  • "Birdseye" started this thread

Posts: 124

Location: De Haan

Occupation: Freelance Photographer

  • Send private message

1

Monday, April 30th 2018, 5:55am

Detecting country code

Is it possible in Krpano to do a browser-level country ánd language check,
and display the tour in the language accordingly?


Yvan.

VRW_Phil

Trainee

Posts: 65

Location: London

Occupation: Krpano Custom Coding. Responsive Websites.

  • Send private message

2

Monday, April 30th 2018, 9:47am

Hi Yvan

I'm not sure about Krpano detecting country but I used a Json call and then passed the results to Krpano environment. Which worked well for my self as I only needed to test for two languages..

I used https://ipdata.co/ you can also make specific calls by passing IP address to it.
Example Twitter : https://api.ipdata.co/199.59.149.165
I'm sure there are many other APIs out there.

Anyway hope that Is some help, or at least a possible option.

Birdseye

Trainee

  • "Birdseye" started this thread

Posts: 124

Location: De Haan

Occupation: Freelance Photographer

  • Send private message

3

Monday, April 30th 2018, 5:14pm

Thank you for your reply. We will check this.

Grts,
Yvan

spacerywirtualne

Professional

Posts: 866

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

4

Monday, April 30th 2018, 5:53pm

ipdata.co shows the server address but not necessarily the user's country.

I think it's best to check the browser language.


Source code

1
2
3
4
  <action name="getlanguagebrowser" type="Javascript"><![CDATA[
    var language = window.navigator.userLanguage || window.navigator.language;
    actions.trace('a new language: '+language);
  ]]></action>



PIotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

Birdseye

Trainee

  • "Birdseye" started this thread

Posts: 124

Location: De Haan

Occupation: Freelance Photographer

  • Send private message

5

Tuesday, May 1st 2018, 6:02am

This is an interesting approach too, thank you PIotr.

But we need the country code because the purpose is to direct the visitor to a website in his own country.
F.ex. Here in Belgium we speak 2 languages (3 in fact ;). If the browser detects dutch, the visitor can be directed to Holland or Belgium, If he speaks french, he can be directed to Belgium or France. Therefore the country code is important for us.
Another option is to let the visitor choose his own country at the start of the Vtour. But automating this would be great.

Grts,
Yvan

spacerywirtualne

Professional

Posts: 866

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

6

Tuesday, May 1st 2018, 12:35pm

I understand. I'm just writing that ipdata.co will not solve your problems.

The country where the server is located does not have to match the location of the user. I have my own servers in a different country than I live.

ipdata.co would falsify my location due to the location of the server.
I would use JS because for me it is more important what language the user uses, not what country he lives in.


You can use both methods.


Piotr
You own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: facebook group :: youtube

cms4vr team *thumbsup*

jordi

Intermediate

Posts: 427

Location: Barcelona

Occupation: creating ideas & coding them

  • Send private message

7

Tuesday, May 1st 2018, 9:15pm

Multilingual troubles !! Hard at the begining, making you evolve easily ;)
everpano.com smart virtual tours