summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/session.php2
-rw-r--r--library/WT/I18N.php6
2 files changed, 5 insertions, 3 deletions
diff --git a/includes/session.php b/includes/session.php
index 344c77ffc5..f9462945b9 100644
--- a/includes/session.php
+++ b/includes/session.php
@@ -404,6 +404,8 @@ define('WT_USER_ID', getUserId());
// With no parameters, init() looks to the environment to choose a language
define('WT_LOCALE', WT_I18N::init());
+// Non-latin languages may need non-latin digits
+define('WT_NUMBERING_SYSTEM', Zend_Locale_Data::getContent(WT_LOCALE, 'defaultnumberingsystem'));
// Application configuration data - things that aren't (yet?) user-editable
require WT_ROOT.'includes/config_data.php';
diff --git a/library/WT/I18N.php b/library/WT/I18N.php
index a415d8a5fe..e6e96261b4 100644
--- a/library/WT/I18N.php
+++ b/library/WT/I18N.php
@@ -259,9 +259,9 @@ class WT_I18N {
static public function number($n, $precision=0) {
// Add "punctuation"
$n=Zend_Locale_Format::toNumber($n, array('locale'=>WT_LOCALE, 'precision'=>$precision));
- // Convert digits
- if (WT_LOCALE=='ar' || WT_LOCALE=='fa') {
- $n=Zend_Locale_Format::convertNumerals($n, 'Latn', 'Arab');
+ // Convert digits.
+ if (WT_NUMBERING_SYSTEM!='latn') {
+ $n=Zend_Locale_Format::convertNumerals($n, 'latn', WT_NUMBERING_SYSTEM);
}
return $n;
}