summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2012-02-09 18:58:17 +0000
committerJannis Leidel <jannis@leidel.info>2012-02-09 18:58:17 +0000
commit75c60e80536552125f014fde15e2964ec128c65c (patch)
treef7acc0d19a87eea11087a9d3bc5376a51c56c0bc
parentd6f9c1e7744f1c8eeb19c76d9c9b8ec04d1e96d2 (diff)
Fixed #17217 -- Use non breaking spaces for format localization in which spaces are used. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17478 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/conf/locale/cs/formats.py2
-rw-r--r--django/conf/locale/es_MX/formats.py4
-rw-r--r--django/conf/locale/fr/formats.py2
-rw-r--r--django/conf/locale/nb/formats.py2
-rw-r--r--django/conf/locale/nn/formats.py2
-rw-r--r--django/conf/locale/ru/formats.py2
-rw-r--r--django/conf/locale/sk/formats.py2
-rw-r--r--django/conf/locale/sv/formats.py2
-rw-r--r--django/contrib/localflavor/de_CH/formats.py2
-rw-r--r--docs/topics/i18n/formatting.txt7
10 files changed, 13 insertions, 14 deletions
diff --git a/django/conf/locale/cs/formats.py b/django/conf/locale/cs/formats.py
index 1c03615f8b..d4ebb52cd0 100644
--- a/django/conf/locale/cs/formats.py
+++ b/django/conf/locale/cs/formats.py
@@ -33,5 +33,5 @@ DATETIME_INPUT_FORMATS = (
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/es_MX/formats.py b/django/conf/locale/es_MX/formats.py
index fdedb0d06a..7f14b976bd 100644
--- a/django/conf/locale/es_MX/formats.py
+++ b/django/conf/locale/es_MX/formats.py
@@ -24,7 +24,7 @@ DATETIME_INPUT_FORMATS = (
'%d/%m/%y %H:%M:%S',
'%d/%m/%y %H:%M',
)
-DECIMAL_SEPARATOR = '.' # ',' is also official (less common): NOM-008-SCFI-2002
-THOUSAND_SEPARATOR = ' ' # white space
+DECIMAL_SEPARATOR = '.' # ',' is also official (less common): NOM-008-SCFI-2002
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/fr/formats.py b/django/conf/locale/fr/formats.py
index 2ad05b8947..58a2e09bce 100644
--- a/django/conf/locale/fr/formats.py
+++ b/django/conf/locale/fr/formats.py
@@ -37,5 +37,5 @@ DATETIME_INPUT_FORMATS = (
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/nb/formats.py b/django/conf/locale/nb/formats.py
index f20d712197..8c232dc132 100644
--- a/django/conf/locale/nb/formats.py
+++ b/django/conf/locale/nb/formats.py
@@ -39,5 +39,5 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y', # '25.10.06'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/nn/formats.py b/django/conf/locale/nn/formats.py
index f20d712197..8c232dc132 100644
--- a/django/conf/locale/nn/formats.py
+++ b/django/conf/locale/nn/formats.py
@@ -39,5 +39,5 @@ DATETIME_INPUT_FORMATS = (
'%d.%m.%y', # '25.10.06'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/ru/formats.py b/django/conf/locale/ru/formats.py
index f3a8f2be4d..430963a244 100644
--- a/django/conf/locale/ru/formats.py
+++ b/django/conf/locale/ru/formats.py
@@ -36,5 +36,5 @@ DATETIME_INPUT_FORMATS = (
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/sk/formats.py b/django/conf/locale/sk/formats.py
index 9eeee6685a..adc31746be 100644
--- a/django/conf/locale/sk/formats.py
+++ b/django/conf/locale/sk/formats.py
@@ -33,5 +33,5 @@ DATETIME_INPUT_FORMATS = (
'%Y-%m-%d', # '2006-10-25'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/conf/locale/sv/formats.py b/django/conf/locale/sv/formats.py
index c04abfa132..10a7e0016c 100644
--- a/django/conf/locale/sv/formats.py
+++ b/django/conf/locale/sv/formats.py
@@ -36,5 +36,5 @@ DATETIME_INPUT_FORMATS = (
'%m/%d/%y', # '10/25/06'
)
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = ' '
+THOUSAND_SEPARATOR = u' ' # non-breaking space
NUMBER_GROUPING = 3
diff --git a/django/contrib/localflavor/de_CH/formats.py b/django/contrib/localflavor/de_CH/formats.py
index 3993ef6fb7..3a6f440e6a 100644
--- a/django/contrib/localflavor/de_CH/formats.py
+++ b/django/contrib/localflavor/de_CH/formats.py
@@ -39,5 +39,5 @@ DATETIME_INPUT_FORMATS = (
# For details, please refer to http://www.bk.admin.ch/dokumentation/sprachen/04915/05016/index.html?lang=de
# (in German) and the documentation
DECIMAL_SEPARATOR = ','
-THOUSAND_SEPARATOR = " "
+THOUSAND_SEPARATOR = u' '
NUMBER_GROUPING = 3
diff --git a/docs/topics/i18n/formatting.txt b/docs/topics/i18n/formatting.txt
index 2ca96ed57e..4c80786edc 100644
--- a/docs/topics/i18n/formatting.txt
+++ b/docs/topics/i18n/formatting.txt
@@ -176,11 +176,10 @@ To customize the English formats, a structure like this would be needed::
where :file:`formats.py` contains custom format definitions. For example::
- THOUSAND_SEPARATOR = ' '
-
-to use a space as a thousand separator, instead of the default for English,
-a comma.
+ THOUSAND_SEPARATOR = u' '
+to use a non-breaking space (Unicode ``00A0``) as a thousand separator,
+instead of the default for English, a comma.
Limitations of the provided locale formats
==========================================