+
+ /**
+ * Set the system date locale for localized date formatting.
+ * Will try both the standard locale name and the UTF8 variant.
+ * @param string $locale
+ */
+ protected function setSystemDateLocale(string $locale)
+ {
+ $systemLocale = $this->localeMap[$locale] ?? $locale;
+ $set = setlocale(LC_TIME, $systemLocale);
+ if ($set === false) {
+ setlocale(LC_TIME, $systemLocale . '.utf8');
+ }
+ }