Sometimes it is convenient to change the language definition of a website without the installation/configuration of extra modules/languages. For example if you create a copy of a very simple informational website and you want to change its language without touching language settings/modules.
The language attributes typically can be found in the following file:
/core/includes/theme.inc
$variables['html_attributes']['lang'] = $language_interface->getId();
If you manually want to change it just put the language code (de for German in our example).
$variables['html_attributes']['lang'] = "de";
It is always better not to hack core, so optimally you add this line of code to the function mythemename_preprocess_html(&$variables) in the mythemename.theme
Read more articles
- Log in to post comments