Re: [Django] #34297: ValueError: invalid token in plural form: EXPRESSION when adding new language

15 views
Skip to first unread message

Django

unread,
Apr 3, 2024, 6:36:07 PM4/3/24
to django-...@googlegroups.com
#34297: ValueError: invalid token in plural form: EXPRESSION when adding new
language
-------------------------------------+-------------------------------------
Reporter: Azat | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 4.1
Severity: Normal | Resolution: invalid
Keywords: gettext, i18n, l10n | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Barney Szabolcs):

I used to be able to add any unsupported language to Django (so and yue)
(and I even deployed to prod yesterday), now I can't even run
makemessages, and runserver does not start, with the exact same message.
Probably it is because gettext got updated on homebrew and it does
something differently.

I think we should still be able to add unsupported languages without any
hustle, like we used to do. (I just had to add the language to locale
directory and I didn't even have to change settings.py). I know, for a
proper bug I should be able to pin down the exact version numbers, but it
seems to be wrong since django 3, and I was just lucky to have been using
the right version of gettext.🤷🏻
--
Ticket URL: <https://code.djangoproject.com/ticket/34297#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 4, 2024, 11:17:51 AM4/4/24
to django-...@googlegroups.com
#34297: ValueError: invalid token in plural form: EXPRESSION when adding new
language
-------------------------------------+-------------------------------------
Reporter: Azat | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 4.1
Severity: Normal | Resolution: invalid
Keywords: gettext, i18n, l10n | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

I'm not sure how this should be considered a regression given nothing
points at Django being misconfigured here.

Until someone can pinpoint how Django might be to blame and what exactly
the problem is then everything seems to point at a `gettext`/ Python
problem.
--
Ticket URL: <https://code.djangoproject.com/ticket/34297#comment:5>

Django

unread,
Apr 5, 2024, 2:22:09 AM4/5/24
to django-...@googlegroups.com
#34297: ValueError: invalid token in plural form: EXPRESSION when adding new
language
-------------------------------------+-------------------------------------
Reporter: Azat | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 4.1
Severity: Normal | Resolution: invalid
Keywords: gettext, i18n, l10n | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Azat):

Replying to [comment:5 Simon Charette]:
> I'm not sure how this should be considered a regression given nothing
points at Django being misconfigured here.
>
> Until someone can pinpoint how Django might be to blame and what exactly
the problem is then everything seems to point at a `gettext`/ Python
problem.

To be honest, one important thing you can do before commenting on other
people's ticket is simply try and check if that is the case. Python not
displaying enough information but it dose not mean, you saw the whole
world from that console info.

The problem I mentioned 14 months ago, has been resolved by "Adding the
language to django officially". That was the solution, yes, except your
language is being added to the django source code, the problem above
occurs when you try to add a new one yourself.

I ma not sure, from which version Django behaves like this, but in
earlier versions, you could actually add a new language yourself, by
changing proper settings and providing local translation files.
--
Ticket URL: <https://code.djangoproject.com/ticket/34297#comment:6>

Django

unread,
Apr 5, 2024, 7:49:39 AM4/5/24
to django-...@googlegroups.com
#34297: ValueError: invalid token in plural form: EXPRESSION when adding new
language
-------------------------------------+-------------------------------------
Reporter: Azat | Owner: nobody
Type: Bug | Status: closed
Component: Utilities | Version: 4.1
Severity: Normal | Resolution: invalid
Keywords: gettext, i18n, l10n | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

Replying to [comment:6 Azat]:
> To be honest, one important thing you can do before commenting on other
people's ticket is simply try and check if that is the case. Python not
displaying enough information but it dose not mean, you saw the whole
world from that console info.

While we appreciate your input, and while we understand that you may feel
frustrated by the response, the sentence above is confrontational. We
kindly remind you to maintain a respectful and constructive tone in your
communications. Please follow the [https://www.djangoproject.com/conduct/
Django Code of Conduct] when commenting on tickets.

> I ma not sure, from which version Django behaves like this, but in
earlier versions, you could actually add a new language yourself, by
changing proper settings and providing local translation files.

It has been said that Django does not support the feature you are
describing (adding new custom language), and that if it has worked before,
it was by chance. The proper procedure at this stage was completed, which
is to close this ticket as invalid following the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets ticket triaging process].

Everyone is welcomed to seek further help in the
[https://www.djangoproject.com/community/ user support channels].
--
Ticket URL: <https://code.djangoproject.com/ticket/34297#comment:7>
Reply all
Reply to author
Forward
0 new messages