diff --git a/models/Message.php b/models/Message.php index 3ba1d98f..922adaf9 100644 --- a/models/Message.php +++ b/models/Message.php @@ -61,6 +61,11 @@ public function forLocale($locale = null, $default = null) $locale = self::DEFAULT_LOCALE; } + if (!array_key_exists($locale, $this->message_data)) { + // search parent locale (e.g. en-US -> en) before returning default + list($locale) = explode('-', $locale); + } + if (array_key_exists($locale, $this->message_data)) { return $this->message_data[$locale]; }