﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36579	yesno filter broken for translations that do not respect the ascii comma	Klaas van Schelven	Klaas van Schelven	"2 related problems:

1: Some languages do not translate the ""yes,no,maybe"" string including comma's

{{{
$ find -name ""*.po"" | x grep yes,no,maybe -A1 | grep msgstr | grep -v , | grep -v '""""' 
./django/conf/locale/km/LC_MESSAGES/django.po-msgstr ""យល់ព្រម មិនយល់ព្រម​ ប្រហែល""
./django/conf/locale/zh_Hant/LC_MESSAGES/django.po-msgstr ""是、否、也許""
./django/conf/locale/fa/LC_MESSAGES/django.po-msgstr ""بله،خیر،شاید""
./django/conf/locale/ur/LC_MESSAGES/django.po-msgstr ""ھاں،نہیں،ھوسکتاہے""
./django/conf/locale/ug/LC_MESSAGES/django.po-msgstr ""ھەئە، ياق، بەلكىىم""
./django/conf/locale/ckb/LC_MESSAGES/django.po-msgstr ""بەڵێ،نەخێر،لەوانەیە""
./django/conf/locale/zh_Hans/LC_MESSAGES/django.po-msgstr ""是、否、也许""
}}}


2. the filter returns the value when the arg is incorrect: https://github.com/django/django/blob/main/django/template/defaultfilters.py#L881

IMHO this is wrong, because it breaks the Maybe(bool) => str type of the function. For the broken arg, it should either:
[a] override the arg to the default ""yes,no,maybe""
[b] raise an exception

these 2 things combined make it so that when any of the broken languages is activated, the filter is broken. Consider e.g. yesno(True).capitalize() which will now raise an exception in Chinese."	Cleanup/optimization	assigned	Template system	dev	Normal		yesno	Claude Paroz	Accepted	1	1	0	0	0	0
