diff --git a/django/conf/locale/ar/LC_MESSAGES/django.mo b/django/conf/locale/ar/LC_MESSAGES/django.mo
index 77bc44d..9234d63 100644
Binary files a/django/conf/locale/ar/LC_MESSAGES/django.mo and b/django/conf/locale/ar/LC_MESSAGES/django.mo differ
diff --git a/django/conf/locale/ar/LC_MESSAGES/django.po b/django/conf/locale/ar/LC_MESSAGES/django.po
index 28e2153..2095a35 100644
a
|
b
|
msgstr "ديسمبر"
|
5022 | 5022 | msgid "or" |
5023 | 5023 | msgstr "أو" |
5024 | 5024 | |
| 5025 | #. Translators: This string is used as a separator between list elements |
| 5026 | #: utils/text.py:153 |
| 5027 | msgid ", " |
| 5028 | msgstr "، " |
| 5029 | |
5025 | 5030 | #: utils/timesince.py:21 |
5026 | 5031 | msgid "year" |
5027 | 5032 | msgid_plural "years" |
diff --git a/django/utils/text.py b/django/utils/text.py
index b054604..d5b3fce 100644
a
|
b
|
|
1 | 1 | import re |
2 | 2 | from django.utils.encoding import force_unicode |
3 | 3 | from django.utils.functional import allow_lazy |
4 | | from django.utils.translation import ugettext_lazy |
| 4 | from django.utils.translation import ugettext_lazy, ugettext as _ |
5 | 5 | from htmlentitydefs import name2codepoint |
6 | 6 | |
7 | 7 | # Capitalizes the first letter of a string. |
… |
… |
def get_text_list(list_, last_word=ugettext_lazy(u'or')):
|
148 | 148 | """ |
149 | 149 | if len(list_) == 0: return u'' |
150 | 150 | if len(list_) == 1: return force_unicode(list_[0]) |
151 | | return u'%s %s %s' % (', '.join([force_unicode(i) for i in list_][:-1]), force_unicode(last_word), force_unicode(list_[-1])) |
| 151 | return u'%s %s %s' % ( |
| 152 | # Translators: This string is used as a separator between list elements |
| 153 | _(', ').join([force_unicode(i) for i in list_][:-1]), |
| 154 | force_unicode(last_word), |
| 155 | force_unicode(list_[-1])) |
152 | 156 | get_text_list = allow_lazy(get_text_list, unicode) |
153 | 157 | |
154 | 158 | def normalize_newlines(text): |
diff --git a/tests/regressiontests/text/tests.py b/tests/regressiontests/text/tests.py
index fd02036..3036f8e 100644
a
|
b
|
from django.test import TestCase
|
4 | 4 | from django.utils.text import * |
5 | 5 | from django.utils.http import urlquote, urlquote_plus, cookie_date, http_date |
6 | 6 | from django.utils.encoding import iri_to_uri |
| 7 | from django.utils.translation import activate, deactivate |
7 | 8 | |
8 | 9 | class TextTests(TestCase): |
9 | 10 | """ |
10 | 11 | Tests for stuff in django.utils.text and other text munging util functions. |
11 | 12 | """ |
12 | 13 | |
| 14 | def test_get_text_list(self): |
| 15 | self.assertEqual(get_text_list(['a', 'b', 'c', 'd']), u'a, b, c or d') |
| 16 | self.assertEqual(get_text_list(['a', 'b', 'c'], 'and'), u'a, b and c') |
| 17 | self.assertEqual(get_text_list(['a', 'b'], 'and'), u'a and b') |
| 18 | self.assertEqual(get_text_list(['a']), u'a') |
| 19 | self.assertEqual(get_text_list([]), u'') |
| 20 | activate('ar') |
| 21 | self.assertEqual(get_text_list(['a', 'b', 'c']), u"a، b أو c") |
| 22 | deactivate() |
| 23 | |
13 | 24 | def test_smart_split(self): |
14 | 25 | |
15 | 26 | self.assertEquals(list(smart_split(r'''This is "a person" test.''')), |