Add comment blocks
[civicrm-core.git] / CRM / Admin / Form / Setting / Localization.php
index ead6d55efcf64c45fecd1cf2988a7b8bf667337a..bb7b40d87eab587e86335ccc960fce05ec3766aa 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
+ * @copyright CiviCRM LLC (c) 2004-2017
  */
 
 /**
@@ -37,6 +37,7 @@
 class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
 
   protected $_settings = array(
+    'contact_default_language' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'countryLimit' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'customTranslateFunction' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
     'defaultContactCountry' => CRM_Core_BAO_Setting::LOCALIZATION_PREFERENCES_NAME,
@@ -94,11 +95,8 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
         );
       }
     }
-    $this->addElement('select', 'contact_default_language', ts('Default Language for users'), array(
-      '*default*' => ts('Use default site language'),
-      'undefined' => ts('Leave undefined'),
-      'current_site_language' => ts('Use language in use at the time'),
-    ));
+    $this->addElement('select', 'contact_default_language', ts('Default Language for users'),
+      CRM_Admin_Form_Setting_Localization::getDefaultLanguageOptions());
 
     $includeCurrency = &$this->addElement('advmultiselect', 'currencyLimit',
       ts('Available Currencies') . ' ', self::getCurrencySymbols(),
@@ -279,6 +277,8 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
   }
 
   /**
+   * Get the default locale options.
+   *
    * @return array
    */
   public static function getDefaultLocaleOptions() {
@@ -338,4 +338,15 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
     }
   }
 
+  /**
+   * @return array
+   */
+  public static function getDefaultLanguageOptions() {
+    return array(
+      '*default*' => ts('Use default site language'),
+      'undefined' => ts('Leave undefined'),
+      'current_site_language' => ts('Use language in use at the time'),
+    );
+  }
+
 }