Skip to content
Snippets Groups Projects
Commit 04d71ee2 authored by bgm's avatar bgm Committed by Aegir user
Browse files

getLastUpdateTime: use the first available non-en_US locale

parent dfb9d112
Branches
Tags
No related merge requests found
Pipeline #1927 passed
......@@ -34,9 +34,21 @@ class CRM_Uplang_Utils {
return $l10n;
}
public static function getNonUSLocale() {
$locales = CRM_Core_I18n::uiLanguages(TRUE);
foreach ($locales as $locale) {
if ($locale != 'en_US') {
return $locale;
}
}
throw new Exception(E::ts('Only en_US was found. Nothing to update.'));
}
public static function getLastUpdateTime() {
$l10n = CRM_Uplang_Utils::getDownloadDir();
$locale = 'fr_CA';
$locale = self::getNonUSLocale();
$localFile = "$l10n/$locale/LC_MESSAGES/civicrm.mo";
$mtime = filemtime($localFile);
return $mtime;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment