public static function match($firstLocale, $secondLocale)
{
if (empty($firstLocale) || empty($secondLocale)) {
return false;
}
$firstLocale = str_replace('-', '_', strtolower($firstLocale));
$firstLocaleParts = explode('_', $firstLocale);
$secondLocale = str_replace('-', '_', strtolower($secondLocale));
$secondLocaleParts = explode('_', $secondLocale);
// Language codes must match.
if ($firstLocaleParts[0] != $secondLocaleParts[0]) {
return false;
}
// @todo Match scripts, if found.
return true;
}