forked from wallabag/wallabag
Use lang attribute
This commit is contained in:
@ -787,6 +787,19 @@ class Entry
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the entry language to a valid html lang attribute.
|
||||
*/
|
||||
public function getHTMLLanguage()
|
||||
{
|
||||
$parsedLocale = \Locale::parseLocale($this->getLanguage());
|
||||
$lang = '';
|
||||
$lang .= $parsedLocale['language'] ?? '';
|
||||
$lang .= isset($parsedLocale['region']) ? '-' . $parsedLocale['region'] : '';
|
||||
|
||||
return $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user