For example, for Spanish language, the translation is: "sí, no, quizás",
which adds an extra space before "no" and before "quizás". That makes the
"no" and "maybe" translations to be wrong because they add an extra space
at the beggining so "capfirst" won't work properly because it capitalizes
the first letter, which is an space.
I've detected it in 2.2.9 and I've checked that this is still an issue in
"master".
The affected languages in 2.2.9 are:
"bg"
"br"
"cs"
"es"
"es_CO"
"es_MX"
"es_VE"
"fr"
"ga"
"hi"
"mk"
"ml"
"ne"
"te"
"vi"
I will try to fix it by myself as it's quite easy to fix but I don't have
time at the moment (as it would be my first fix and I should have to read
all documentation related with contributing).
--
Ticket URL: <https://code.djangoproject.com/ticket/31172>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
New description:
I will try to fix it by myself if nobody does in several weeks as it's
quite easy to fix but I don't have time at the moment (as it would be my
first fix and I should have to read all documentation related with
contributing).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:1>
Old description:
> Hi, I've just discovered by doing something like this in a template: {{
> I will try to fix it by myself if nobody does in several weeks as it's
> quite easy to fix but I don't have time at the moment (as it would be my
> first fix and I should have to read all documentation related with
> contributing).
New description:
I will try to fix it by myself if nobody does in several weeks as it's
quite easy to fix but I don't have time at the moment (as it would be my
first fix and I should have to read all documentation related with
contributing).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:2>
Old description:
> I've just discovered by doing something like this in a template: {{
> I will try to fix it by myself if nobody does in several weeks as it's
> quite easy to fix but I don't have time at the moment (as it would be my
> first fix and I should have to read all documentation related with
> contributing).
New description:
Edit 1: for spanish translation, the extra spaces where added 7 years ago
in this commit: 6ca475d540361090e8b28154ce5391de718d5c63 but I've using
this without a problem after that so maybe there was some change anywhere
else.
I will try to fix it by myself if nobody does in several weeks as it's
quite easy to fix but I don't have time at the moment (as it would be my
first fix and I should have to read all documentation related with
contributing).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:3>
Old description:
> I've just discovered by doing something like this in a template: {{
> Edit 1: for spanish translation, the extra spaces where added 7 years ago
> in this commit: 6ca475d540361090e8b28154ce5391de718d5c63 but I've using
> this without a problem after that so maybe there was some change anywhere
> else.
>
> I will try to fix it by myself if nobody does in several weeks as it's
> quite easy to fix but I don't have time at the moment (as it would be my
> first fix and I should have to read all documentation related with
> contributing).
New description:
Edit 1: for spanish translation, the extra spaces where added 7 years ago
in this commit: 6ca475d540361090e8b28154ce5391de718d5c63.
I will try to fix it by myself if nobody does in several weeks as it's
quite easy to fix but I don't have time at the moment (as it would be my
first fix and I should have to read all documentation related with
contributing).
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:4>
* component: Internationalization => Template system
* stage: Unreviewed => Accepted
Comment:
Hi and thanks for the report.
This does appear to be a bug. I guess it's not a problem most of the time
because HTML doesn't care too much about spaces but the interaction with
`capfirst` makes it more obvious.
Rather than fixing all the broken `.po` file, I think it might be better
to change the code so it automatically removes spaces before and after
each yes/no/maybe string.
For backwards compatibility with users who might deliberately want spaces,
maybe we should only strip the spaces from the translated string, but not
from ay user-provided string.
The code for the `yesno` filter is in django/templates/defaultfilters [1]
if you'd like to take a look and try a pull request (make sure you assign
the ticket to yourself once you start working on it).
[1]
https://github.com/django/django/blob/master/django/template/defaultfilters.py#L773
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:5>
* owner: nobody => José Antonio Ruiz
* status: new => assigned
Comment:
I've already been checking the code for "yesno" filter and it hasn't
changed much after those translations error were made so the code is (and
was) OK.
I'll try to fix it as soon as possible (maybe next week if I have a couple
of free hours).
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:6>
* cc: Claude Paroz (added)
Comment:
I think we shouldn't strip anything from translated strings. I would
correct them via Transifex and close this ticket.
Claude, What do you think?
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:7>
Comment (by Baptiste Mispelon):
If we only fix the translation then I'd suggest adding a comment [1] to
the `yesno` code so that the problem doesn't keep re-surfacing.
[1] https://docs.djangoproject.com/en/dev/topics/i18n/translation
/#comments-for-translators
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:8>
Comment (by Claude Paroz):
+1 for the comment as Baptiste suggested.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:9>
* version: 2.2 => master
* component: Template system => Documentation
* easy: 0 => 1
Comment:
Agreed.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:10>
Comment (by SamuelNoB):
Does someone is fixing it? i think i've solved the problem and i'd like to
contribute by just adding a few things in the capfirst and yesno
functions.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:11>
Comment (by Claude Paroz):
The decision was to not touch the code and add a translator comment. Do
you want to prepare a pull request for that?
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:12>
Comment (by José Antonio Ruiz):
I was going to fix it in a couple of weeks as I don't have any spare time
right now.
Feel free to fix it yourself.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:13>
Comment (by Samuel Nogueira Bacelar):
I would apreciate if I could try to fix it. As soon I get accepted in the
django transifex I will fix the translations myself and add the comment in
the code.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:14>
Comment (by Juan Carlos Gómez):
Hi, I would like to solve this issue (bc I am noob). I see that the issue
is still open.
I found that the files to modify can be selected by the following `grep`
command.
`grep -w django/conf/locale/*/*/django.po -e 'yes,no,maybe' -A 1 | grep
msgstr | awk '{print NF,$1,$2,$3,$4,$5}' | grep -v 2 | grep -v 3`
Which shows that the affected strings are:
5 django/conf/locale/bg/LC_MESSAGES/django.po-msgstr "да, не, може би"
4 django/conf/locale/br/LC_MESSAGES/django.po-msgstr "ya, ket, marteze"
4 django/conf/locale/cs/LC_MESSAGES/django.po-msgstr "ano, ne, možná"
4 django/conf/locale/es_CO/LC_MESSAGES/django.po-msgstr "sí, no, quizás"
4 django/conf/locale/es/LC_MESSAGES/django.po-msgstr "sí, no, quizás"
5 django/conf/locale/es_MX/LC_MESSAGES/django.po-msgstr "sí, no, tal vez"
4 django/conf/locale/es_VE/LC_MESSAGES/django.po-msgstr "sí, no, quizás"
4 django/conf/locale/ga/LC_MESSAGES/django.po-msgstr "tá, níl, b'fhéidir"
4 django/conf/locale/hi/LC_MESSAGES/django.po-msgstr "हाँ, नहीं, शायद"
4 django/conf/locale/mk/LC_MESSAGES/django.po-msgstr "да, не, можеби"
4 django/conf/locale/ml/LC_MESSAGES/django.po-msgstr "ഉണ്ട്, ഇല്ല,
ഉണ്ടായേക്കാം"
4 django/conf/locale/ne/LC_MESSAGES/django.po-msgstr "हो, होइन, सायद"
4 django/conf/locale/ta/LC_MESSAGES/django.po-msgstr "ஆம், இல்லை,
இருக்கலாம்"
5 django/conf/locale/te/LC_MESSAGES/django.po-msgstr "అవును, కాదు , ఏమొ"
4 django/conf/locale/uz/LC_MESSAGES/django.po-msgstr "ha, yo'q, ehtimol"
5 django/conf/locale/vi/LC_MESSAGES/django.po-msgstr "Có, Không, Có thể"
I've got the corresponding change in the files, should I submit the PR?
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:15>
Comment (by felixxm):
Juan, thanks. Translations are handled at
[https://docs.djangoproject.com/en/dev/internals/contributing/localizing/#translations
Transifex] so you can fix them via Transifex, not via GitHub PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:16>
Comment (by Juan Carlos Gómez):
Well, I am not a translator in those 20+ languages , I do not if they
going to accept the changes in there.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:17>
* status: assigned => closed
* resolution: => fixed
Comment:
Many thanks Juan, I used your list to fix the translations in Transifex,
as I'm authorized to edit all languages.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:18>
* status: closed => new
* resolution: fixed =>
Comment:
Oh sorry, I closed too quickly, we still need the translator comment in
the code.
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:19>
* owner: José Antonio Ruiz => Hasan Ramezani
* status: new => assigned
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:20>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:21>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0538da08c576a5528312ade546c2f7c63489b811" 0538da0]:
{{{
#!CommitTicketReference repository=""
revision="0538da08c576a5528312ade546c2f7c63489b811"
Fixed #31172 -- Added note to translators for yesno filter.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31172#comment:22>