Opened 2 months ago

Closed 2 months ago

#35352 closed Bug (invalid)

Unable to continue using custom languages with Django

Reported by: Barney Szabolcs Owned by: nobody
Component: Internationalization Version: 5.0
Severity: Normal Keywords: custom languages
Cc: Barney Szabolcs Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Barney Szabolcs)

with gettext version 0.22.5, Somali (so) and Cantonese (yue) stopped working.
If I remove language files for these two languages, the runserver works fine,
if I add back these two languages, error: ValueError: invalid token in plural form: EXPRESSION

Also, makemessages results in CommandError: Type 'manage.py help makemessages' for usage information.

Whereas, if I run makemessages -l so -l yue it works fine, but still the project does not start, yielding the same error.
What's even weirder: if I set makemessages -x de (that should be irrelevant), then makemessages runs also fine.
Compilemessages runs also just fine.

This is a weird regression. Tested with python 3.9, 3.11, 3.12, all the same, Django 3.2.19, 4.2.11, 5.0.2.

Quick fix: if needed, I can generate a quick translation for the Django .po files, using ChatGPT, but I don't know anyone who speaks Somali or Cantonese.

Change History (4)

comment:1 by Barney Szabolcs, 2 months ago

Description: modified (diff)
Easy pickings: unset
Version: 4.25.0

comment:2 by Barney Szabolcs, 2 months ago

Description: modified (diff)

comment:3 by Barney Szabolcs, 2 months ago

Description: modified (diff)

comment:4 by Sarah Boyce, 2 months ago

Resolution: invalid
Severity: Release blockerNormal
Status: newclosed

Hi Barney, thank you for your report.
Looks like this ticket explains the issue here best #29587, and #34297 is a duplicate.

Django supports many languages and you can add new languages to be supported by Django (following this guide: https://docs.djangoproject.com/en/dev/internals/contributing/localizing/). Uyguhr was added recently https://github.com/django/django/pull/17163 for example.
However, I cannot find anything stating that Django supports custom languages as a feature. Everything I see are workarounds suggested by individuals (on StackOverflow for example).

If you want Django to support custom languages, I think this request should go to the Django forum to get feedback from the community that this is a desirable addition to Django core. See https://docs.djangoproject.com/en/5.0/internals/contributing/bugs-and-features/#requesting-features

In short, this is not a bug as this is not something Django supports officially and so I will close the ticket.

Note: See TracTickets for help on using tickets.
Back to Top