Browser language
Author: anelk
Publication Date: 6/18/2018 15:31
Hi Community,
I would like to ask is it possible in FirstSpirit (page template for example) to get language of browser?
When user come to page, I need to detect his browser language, and regarding that information I need to display site in that language (or default if language of his browser is not supported in FS).
Any kind of help will be appreciated.
Kind regards,
Anel
Tags: browser, language
-
Author: jan_bogutzki - 6/20/2018 14:30
Hi Anel,
when generating your site, include all available translations as
<link rel="alternate" hreflang="de-DE" href="https://www.domain.tld/site/">
On your site include a javascript that check the browser.language and match against the hreflang values. When you have found a page, ask your user if he would like to switch to that page.
Maybe there is a better solution for this.
best regards
Jan Bogutzki
0 -
Author: kohlbrecher - 6/27/2018 8:48
Hi Anel,
like Jan already said you need a solution extended from FirstSpirit (JavaScript for example). Because FirstSpirit is pre-generating the website you have no browser information in FirstSpirit.
Best regards
Jan
0 -
Author: anelk - 6/27/2018 9:02
Hi guys,
thank you for answers, I tought that we have something in FirstSpirit which can be used in this case.
Anyway, old good friend JavaScript will do the job. :smileyhappy:
Kind regards,
Anel0
Please sign in to leave a comment.
Comments
3 comments