Hi Fumito,

Good idea !

Question : the attribute lang must be set on html tag or body tag ?

For extract the lang code from context, use \Nos\Tools_Context::localeCode($page->get_context())

We can add this in the _handleHead method of the Controller_Front
https://github.com/novius-os/core/blob/master/dubrovka/framework/classes/controller/front.ctrl.php#L585
Par Gilles FELIX , 22 avril 2014 ·
Hello, Gilles,

> Question : the attribute lang must be set on html tag or body tag ?

I'm not sure.

http://www.w3.org/TR/2011/WD-html5-20110113/elements.html#the-lang-and-xml:lang-attributes
says "The lang attribute in no namespace may be used on any HTML element."

I checked some websites, and found that;
Twitter : html lang="***"
Facebook : html lang="***"
Google: html lang="***" & body lang="***"

The fact that all the Twitter/Facebook/Google use html lang="***" implies html lang="***" is commonly used.
Par Fumito MIZUNO , 24 avril 2014 ·
>For extract the lang code from context, use \Nos\Tools_Context::localeCode($page->get_context())

Thanks for this info. I will update my template.
Par Fumito MIZUNO , 24 avril 2014 ·
Thanks for you're investigation on html lang="***" !
Par Gilles FELIX , 25 avril 2014 ·
À
    ou Annuler
<html lang="***">
Par Fumito MIZUNO , 22 avril 2014
À

I create a template.

I change the lang attribute, according to the page context.


<html lang="<?php echo substr($page->get_context(),6,2);?>">

https://github.com/ounziw/foundation/blob/master/views/subviews/header.view.php#l2

 

I hope it is helpful to many users. I propose to add this functionality to Novius OS Core. (maybe Controller_Front class.)