Function getLangAttributeLocale
Converts underscore locales like "en_US" to valid IANA/BCP 47 hyphen locales like "en-US" Needed for example in JS or HTML "lang" attributes.
string |
$locale = NULL |
a locale like "en_US", if empty the current locale is used |
string
|
string |