use only first two chars of language in html lang attribute

This commit is contained in:
Uwe Steinmann 2024-10-31 18:03:58 +01:00
parent 6849ccd34d
commit b65322ab54
2 changed files with 8 additions and 4 deletions

View File

@ -101,9 +101,11 @@ class SeedDMS_Theme_Style extends SeedDMS_View_Common {
echo "<!DOCTYPE html>\n";
echo "<html lang=\"";
if(!empty($this->params['session']) && ($slang = $this->params['session']->getLanguage())) {
echo str_replace('_', '-', $slang);
echo substr($slang, 0, 2);
// echo str_replace('_', '-', $slang);
} else {
echo str_replace('_', '-', $this->params['settings']->_language);
echo substr($this->params['settings']->_language, 0, 2);
// echo str_replace('_', '-', $this->params['settings']->_language);
}
echo "\">\n<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";

View File

@ -103,9 +103,11 @@ class SeedDMS_Theme_Style extends SeedDMS_View_Common {
echo "<!DOCTYPE html>\n";
echo "<html lang=\"";
if(!empty($this->params['session']) && ($slang = $this->params['session']->getLanguage())) {
echo str_replace('_', '-', $slang);
echo substr($slang, 0, 2);
// echo str_replace('_', '-', $slang);
} else {
echo str_replace('_', '-', $this->params['settings']->_language);
echo substr($this->params['settings']->_language, 0, 2);
// echo str_replace('_', '-', $this->params['settings']->_language);
}
echo "\">\n<head>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";