Commits

Branko Vukelic  committed f8b27aa

Do not write native label twice if it's in English

  • Participants
  • Parent commits 864263b

Comments (0)

Files changed (2)

File international/models.py

             languages_english.append((l_id, _(l.english_name)))
             if l.display_name:
                 languages_native.append((l_id, l.display_name))
-                languages.append(
-                    (l_id, "%s (%s)" % (l.display_name, l.english_name))
-                )
+                if l.display_name == l.english_name:
+                    label = '%s' % l.english_name
+                else:
+                    label = '%s (%s)' % (l.display_name, l.english_name)
+                languages.append((l_id, label))
 
 
 class Country(models.Model):

File tests/tests.py

     def test_language_list(self):
         self.assertIn(('ja', '日本語 (Japanese)'), languages)
 
+    def test_english_name_has_no_parens(self):
+        self.assertIn(('en_US', 'U.S. English'), languages)
+
     def test_language_native_list(self):
         self.assertIn(('ja', '日本語'), languages_native)