Browse Source

default the env locale to en_US

otherwise it can lead to some out of sync problems whereby this
method returns "" and defaultLocale returns "en_US" making direct
comparison of "is the locale the env default" not possible
AD7six 11 years ago
parent
commit
8df31b0124
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/I18n/I18n.php

+ 1 - 1
src/I18n/I18n.php

@@ -229,7 +229,7 @@ class I18n {
  */
 	public static function environmentLocale() {
 		if (static::$_environmentLocale === null) {
-			static::$_environmentLocale = Locale::getDefault();
+			static::$_environmentLocale = Locale::getDefault() ?: 'en_US';
 		}
 		return static::$_environmentLocale;
 	}