+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
class CRM_Core_I18n {
return $this->_nativegettext;
}
-
+ /**
+ * Set native locale for getText.
+ *
+ * @param string $locale
+ */
protected function setNativeGettextLocale($locale) {
$locale .= '.utf8';
}
+ /**
+ * Set getText locale.
+ *
+ * @param string $locale
+ */
protected function setPhpGettextLocale($locale) {
// we support both the old file hierarchy format and the new:
}
-
/**
* Return languages available in this instance of CiviCRM.
*
return strtr($str, $tr);
}
+ /**
+ * Get the directory for l10n resources.
+ *
+ * @return string
+ */
public static function getResourceDir() {
static $dir = NULL;
if ($dir === NULL) {
*/
public static function getLocale() {
global $tsLocale;
- return $tsLocale;
+ return $tsLocale ? $tsLocale : 'en_US';
}
}