[Django] #31937: Can't translate strings properly to Hebrew and Arabic

41 views
Skip to first unread message

Django

unread,
Aug 24, 2020, 6:03:37 AM8/24/20
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
------------------------------------------------+------------------------
Reporter: אורי | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
I can't translate strings such as "2 weeks" to Hebrew and Arabic properly.
There is a word in Hebrew and a word in Arabic for 2 weeks, but I get an
error message "`The expression '%d' is not present in the translation`" in
Transifex and also `msgfmt -vc django.po` raises exceptions. In some
languages, with some plural forms, such as `n == 1` or `n == 2`, we don't
need `%d` to be present in the translation. Also "1 week" can be written
in words "one week", also in Hebrew, and I think it's a better translation
than "1 week". I also think English can use "one week" instead of "1 week"
(but in English, there is the issue of capital letters).

--
Ticket URL: <https://code.djangoproject.com/ticket/31937>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 24, 2020, 6:03:46 AM8/24/20
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------

Reporter: אורי | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by אורי):

* cc: אורי (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:1>

Django

unread,
Aug 24, 2020, 6:12:33 AM8/24/20
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------

Reporter: אורי | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by אורי:

Old description:

> I can't translate strings such as "2 weeks" to Hebrew and Arabic
> properly. There is a word in Hebrew and a word in Arabic for 2 weeks, but
> I get an error message "`The expression '%d' is not present in the
> translation`" in Transifex and also `msgfmt -vc django.po` raises
> exceptions. In some languages, with some plural forms, such as `n == 1`
> or `n == 2`, we don't need `%d` to be present in the translation. Also "1
> week" can be written in words "one week", also in Hebrew, and I think
> it's a better translation than "1 week". I also think English can use
> "one week" instead of "1 week" (but in English, there is the issue of
> capital letters).

New description:

I can't translate strings such as "2 weeks" to Hebrew and Arabic properly.
There is a word in Hebrew and a word in Arabic for 2 weeks, but I get an
error message "`The expression '%d' is not present in the translation`" in
Transifex and also `msgfmt -vc django.po` raises exceptions. In some
languages, with some plural forms, such as `n == 1` or `n == 2`, we don't
need `%d` to be present in the translation. Also "1 week" can be written
in words "one week", also in Hebrew, and I think it's a better translation

than "1 week". I also think English can use `"one week"` instead of `"%d
week"` ("1 week", but in English, there is the issue of capital letters).

--

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:2>

Django

unread,
Aug 24, 2020, 7:52:38 AM8/24/20
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: nobody
Type: Bug | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* status: new => closed
* resolution: => wontfix


Comment:

This is a "limitation" (or feature, depends on how you look at it) of
gettext, that a placeholder must be present on both parts (msgid and
msgstr) of a translatable string (with some exceptions, but they don't
apply here).

Read also: https://www.gnu.org/software/gettext/manual/gettext.html
#Translating-plural-forms-1

I don't see any solution, but if you find one , please reopen with a
concrete proposal.

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:3>

Django

unread,
Aug 24, 2020, 8:11:34 AM8/24/20
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: nobody

Type: Bug | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by אורי):

[https://savannah.gnu.org/bugs/index.php?59005 bug #59005: Can't translate
strings properly to Hebrew and Arabic]

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:4>

Django

unread,
Jan 18, 2021, 9:38:29 AM1/18/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: nobody

Type: Bug | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by אורי):

Replying to [comment:3 Claude Paroz]:


> This is a "limitation" (or feature, depends on how you look at it) of
gettext, that a placeholder must be present on both parts (msgid and
msgstr) of a translatable string (with some exceptions, but they don't
apply here).
>
> Read also: https://www.gnu.org/software/gettext/manual/gettext.html
#Translating-plural-forms-1
>
> I don't see any solution, but if you find one , please reopen with a
concrete proposal.

Hi Claude,

I submitted a bug report on https://savannah.gnu.org/bugs/?59005 and I
received a response. If Django uses the following format:

{{{
msgid "%d year"
msgid_plural "%d years"
}}}

Then the number `%d` should be present in every language. However, by
using the following format with named paramters:

{{{
msgid "%(number)d year"
msgid_plural "%(number)d years"
}}}

Then languages such as Hebrew and Arabic are allowed to omit the number
`%d`, which makes more sense since in those languages there is a word for
"2 years" (and also 2 weeks, 2 months etc.). So if Django will name the
number of years, in this example, then it will be possible to use the
correct word in Hebrew and Arabic (using the number "2" in these
translations is possible, but it's not the correct translation). Also,
when translating "one year", I think also English as well as other
languages would prefer to use the word "one" in words, and not in digits
(`1`).

What do you think?

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:5>

Django

unread,
Jan 18, 2021, 9:39:28 AM1/18/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------

Reporter: אורי | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by אורי):

* status: closed => new
* resolution: wontfix =>


--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:6>

Django

unread,
Jan 18, 2021, 1:06:07 PM1/18/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
--------------------------------------+------------------------------------

Reporter: אורי | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Claude Paroz):

* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Thanks for exploring, I guess we have now a way forward.

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:7>

Django

unread,
Jan 30, 2021, 8:15:09 PM1/30/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: Ryan
| Cheley
Type: Bug | Status: assigned
Component: | Version: master
Internationalization |

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ryan Cheley):

* owner: nobody => Ryan Cheley
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:8>

Django

unread,
Apr 6, 2021, 7:16:32 AM4/6/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
--------------------------------------+------------------------------------
Reporter: אורי | Owner: (none)
Type: Bug | Status: new
Component: Internationalization | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Ryan Cheley => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:9>

Django

unread,
Apr 6, 2021, 10:04:01 AM4/6/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
--------------------------------------+------------------------------------
Reporter: אורי | Owner: אורי
Type: Bug | Status: assigned

Component: Internationalization | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by אורי):

* owner: (none) => אורי


* status: new => assigned


Comment:

I want to create a draft PR for this ticket. Please see the discussion in
the developers mailing list. And I would like to receive feedback from
@Claude - what is the right direction for this ticket and how should the
PR look like?

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:10>

Django

unread,
Apr 6, 2021, 10:25:06 AM4/6/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
--------------------------------------+------------------------------------
Reporter: אורי | Owner: אורי
Type: Bug | Status: assigned
Component: Internationalization | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by אורי):

PR: https://github.com/django/django/pull/14226

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:11>

Django

unread,
Apr 8, 2021, 7:02:26 AM4/8/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: | Version: dev
Internationalization |

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: אורי => Claude Paroz
* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/14233 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:12>

Django

unread,
Apr 10, 2021, 12:43:26 PM4/10/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:13>

Django

unread,
Apr 10, 2021, 2:44:25 PM4/10/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"e4430f22c8e3d29ce5d9d0263fba57121938d06d" e4430f22]:
{{{
#!CommitTicketReference repository=""
revision="e4430f22c8e3d29ce5d9d0263fba57121938d06d"
Fixed #31937 -- Eased translation of time strings in some languages.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:14>

Django

unread,
Dec 2, 2021, 9:21:34 AM12/2/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by אורי):

@Claude Paroz I tried to translate the strings to Hebrew in Transifex but
I still can't see the proper strings in Hebrew in main branch:

https://github.com/django/django/blob/main/django/conf/locale/he/LC_MESSAGES/django.po#L1111-L1157

(The strings for one and two years/weeks etc. should not contain digits)

What is the problem?

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:15>

Django

unread,
Dec 2, 2021, 4:35:28 PM12/2/21
to django-...@googlegroups.com
#31937: Can't translate strings properly to Hebrew and Arabic
-------------------------------------+-------------------------------------
Reporter: אורי | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: | Version: dev
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

Most probably because translations from Transifex will be push to stable
and main branches just before the release, so in the days to come.

--
Ticket URL: <https://code.djangoproject.com/ticket/31937#comment:16>

Reply all
Reply to author
Forward
0 new messages