Is it possible in Krpano to do a browser-level country ánd language check,
and display the tour in the language accordingly?
Yvan.
Detecting country code
-
-
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.
-
Thank you for your reply. We will check this.
Grts,
Yvan -
ipdata.co shows the server address but not necessarily the user's country.
I think it's best to check the browser language.
Code<action name="getlanguagebrowser" type="Javascript"><![CDATA[ var language = window.navigator.userLanguage || window.navigator.language; actions.trace('a new language: '+language); ]]></action>
PIotr
-
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 -
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
-
Multilingual troubles !! Hard at the begining, making you evolve easily ;)
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!