Rather than process the template with TT2 to specify the language in
which the Google Books Preview should be displayed, use the @lang
attribute on the <html> element--and fall back to 'en' if for some
reason that attribute has been removed from the template.
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <ben@evergreener.net>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
var GBPBadgelink;
var GBPreviewLink = '';
var GBPreviewShowing = false;
- var lang = '[% ctx.locale.substr(0,2) %]';
+ var lang = 'en';
+ if (document.documentElement.lang) {
+ lang = document.documentElement.lang.substr(0,2) || 'en';
+ }
var head = document.getElementsByTagName('head')[0];
/**