Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the indentation of a ngettext example, added trailing commas while in the vicinity #13750

Merged
merged 1 commit into from Dec 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/topics/i18n/translation.txt
Expand Up @@ -204,7 +204,8 @@ For example::
page = ngettext(
'there is %(count)d object',
'there are %(count)d objects',
count) % {
count,
) % {
'count': count,
}
return HttpResponse(page)
Expand All @@ -228,7 +229,7 @@ sophisticated, but will produce incorrect results for some languages::
text = ngettext(
'There is %(count)d %(name)s available.',
'There are %(count)d %(name)s available.',
count
count,
) % {
'count': count,
'name': name
Expand All @@ -240,7 +241,7 @@ In a case like this, consider something like the following::
text = ngettext(
'There is %(count)d %(name)s object available.',
'There are %(count)d %(name)s objects available.',
count
count,
) % {
'count': count,
'name': Report._meta.verbose_name,
Expand All @@ -259,11 +260,11 @@ In a case like this, consider something like the following::
text = ngettext(
'There is %(count)d %(name)s available.',
'There are %(count)d %(plural_name)s available.',
count
count,
) % {
'count': Report.objects.count(),
'name': Report._meta.verbose_name,
'plural_name': Report._meta.verbose_name_plural
'plural_name': Report._meta.verbose_name_plural,
}

You would get an error when running :djadmin:`django-admin
Expand Down