Skip to content

Commit

Permalink
Checkstyle and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelsov committed Jun 8, 2016
1 parent e16e96c commit 5c0d57a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Civi/Core/LocalizationInitializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
class LocalizationInitializer {

/*
/**
* Load the locale settings based on the installation language
*
* @param \Civi\Core\Event\SystemInstallEvent $event
Expand All @@ -47,7 +47,9 @@ public static function initialize(SystemInstallEvent $event) {
// get the current installation language
global $tsLocale;
$seedLanguage = $tsLocale;
if (!$seedLanguage) return;
if (!$seedLanguage) {
return;
}

// get the corresponding settings file if any
$localeDir = \CRM_Core_I18n::getResourceDir();
Expand Down Expand Up @@ -99,6 +101,12 @@ public static function initialize(SystemInstallEvent $event) {

}

/**
* Enable provided languages and disable all others
*
* @param $languages array of languages (locale code) ['fr_CA', 'en_CA']
* @throws \CiviCRM_API3_Exception
*/
protected static function updateLanguages($languages) {
$result = civicrm_api3('OptionValue', 'get', array(
'option_group_id' => "languages",
Expand All @@ -109,7 +117,8 @@ protected static function updateLanguages($languages) {
$params = $language;
if (in_array($language['name'], $languages)) {
$params['is_active'] = 1;
} else {
}
else {
// disable every language that is not in the given list
$params['is_active'] = 0;
}
Expand All @@ -118,6 +127,12 @@ protected static function updateLanguages($languages) {

}

/**
* Replace available currencies by the ones provided
*
* @param $currencies array of currencies ['USD', 'CAD']
* @param $default default currency
*/
protected static function updateCurrencies($currencies, $default) {

// sort so that when we display drop down, weights have right value
Expand Down

0 comments on commit 5c0d57a

Please sign in to comment.