1
0
mirror of https://github.com/django/django.git synced 2025-04-04 13:36:42 +00:00

Fixed #35278 -- Tested fixed versions of and functions.

This commit is contained in:
Piotr Kawula 2024-03-07 11:11:59 +01:00
parent 76f4b0c0f3
commit 54fa8b5693
4 changed files with 25 additions and 0 deletions

View File

@ -42,3 +42,11 @@ msgstr[1] "%s Resultate"
msgid "Image"
msgstr "Bild"
msgid "empty"
msgid_plural "empty"
msgstr[0] ""
msgid "%s element"
msgid_plural "%s element"
msgstr[0] ""

View File

@ -18,6 +18,12 @@
</script>
</p>
<p id="gettext_empty_array">
<script>
document.write(gettext("empty"));
</script>
</p>
<p id="ngettext_sing">
<script>
document.write(interpolate(ngettext("%s item", "%s items", 1), [1]));
@ -37,6 +43,13 @@
</script>
</p>
<p id="ngettext_plural_empty_array">
<!-- The po file contains empty array on "%s element" id. -->
<script>
document.write(interpolate(npgettext("%s element", "%s element", "%s elements", 455), [455]));
</script>
</p>
<p id="pgettext">
<script>
document.write(pgettext("verb", "May"));

View File

@ -540,12 +540,16 @@ class I18nSeleniumTests(SeleniumTestCase):
self.selenium.get(self.live_server_url + "/jsi18n_template/")
elem = self.selenium.find_element(By.ID, "gettext")
self.assertEqual(elem.text, "Entfernen")
elem = self.selenium.find_element(By.ID, "gettext_empty_array")
self.assertEqual(elem.text, "empty")
elem = self.selenium.find_element(By.ID, "ngettext_sing")
self.assertEqual(elem.text, "1 Element")
elem = self.selenium.find_element(By.ID, "ngettext_plur")
self.assertEqual(elem.text, "455 Elemente")
elem = self.selenium.find_element(By.ID, "ngettext_onnonplural")
self.assertEqual(elem.text, "Bild")
elem = self.selenium.find_element(By.ID, "ngettext_plural_empty_array")
self.assertEqual(elem.text, "455 element")
elem = self.selenium.find_element(By.ID, "pgettext")
self.assertEqual(elem.text, "Kann")
elem = self.selenium.find_element(By.ID, "npgettext_sing")