Set language from meta

Page: 1

Author Post
Member
Registered: Sep 2017
Posts: 6
Is there any chance to get the language for floatbox from one of the website's following declarations:

<meta name="language" content="de" />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">


My website is available in German and English. Currently I have to add

fbPageOptions = {
language: &#039;de&#039;
}


to each page to declare its language. It would be nice if Floatbox could grab this info from one of the tags mentioned on top instead of having to declare it on each page. The 'auto' entry for language is no option as it doesn't use the page's language but the user's browser language.
Administrator
Registered: Aug 2008
Posts: 3382
The language:auto option was removed as of 7.4.1 because, as you point out, it didn't do what page authors wanted it to do. Now the language defaults to 'en'glish unless otherwise specified somewhere in the global options.

So yes, currently the best way to set the Floatbox language on non-English pages is with the fbPageOptions inside a script element on the page.
Or, preferred with newer versions to maintain consistency with the fbOptions.js file syntax...
fbOptions {
global: {
language: &#039;de&#039;
}
}

Pulling language in from the <html> tag's lang attribute is a good idea. I'll look into adding that to a future release.
Member
Registered: Sep 2017
Posts: 6
Thanks for considering!
Administrator
Registered: Aug 2008
Posts: 3382
https://floatboxjs.com/download

Page: 1