Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mathlib.py
diff options
context:
space:
mode:
authorReinier Heeres <reinier@heeres.eu>2007-11-30 11:02:19 (GMT)
committer Reinier Heeres <reinier@heeres.eu>2007-11-30 11:02:19 (GMT)
commitcdc7cfd24f22245ed6b565f23db5717c88552b3b (patch)
treeee73ea7da7c53ed554243634a116270cef582c25 /mathlib.py
parent5acbca906319215efdd2b6d2a65760e22affcd9c (diff)
i18n of help functions; not the final solution!
Diffstat (limited to 'mathlib.py')
-rw-r--r--mathlib.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/mathlib.py b/mathlib.py
index 71deb65..1edeab0 100644
--- a/mathlib.py
+++ b/mathlib.py
@@ -27,6 +27,7 @@ import logging
_logger = logging.getLogger('MathLib')
from gettext import gettext as _
+import locale
class MathLib:
ANGLE_DEG = math.pi/180
@@ -55,22 +56,20 @@ class MathLib:
self.setup_i18n()
def setup_i18n(self):
+ loc = locale.localeconv()
+
# The separator to mark thousands (default: ',')
- self.thousand_sep = _('thousand_sep')
- if self.thousand_sep == 'thousand_sep':
- self.thousand_sep = ','
+ self.thousand_sep = loc['thousands_sep']
# The separator to mark fractions (default: '.')
- self.fraction_sep = _('fraction_sep')
- if self.fraction_sep == 'fraction_sep':
- self.fraction_sep = '.'
+ self.fraction_sep = loc['decimal_point']
- # The multiplication symbol (default: '*')
+ # TRANS: multiplication symbol (default: '*')
self.mul_sym = _('mul_sym')
if self.mul_sym == 'mul_sym':
self.mul_sym = '*'
- # The division symbol (default: '/')
+ # TRANS: division symbol (default: '/')
self.div_sym = _('div_sym')
if self.div_sym == 'div_sym':
self.div_sym = '/'