Translation templatetag aliases

254 views
Skip to first unread message

Mike Hansen

unread,
Jul 26, 2019, 10:34:55 AM7/26/19
to Django developers (Contributions to Django itself)
Hello all,

Recently I had a member of my team bring up that it was uncomfortable
for them to work in parts of our codebase where they regularly had to
see "blocktrans" in the template files.  To make our work environment
more inclusive, I wrote a Django package which adds "translate" and 
"blocktranslate" templatetag aliases so that we could update our own 
internal templates to use these.

We felt that this change would be in line with the Django community
so I made a ticket and pull request to Django at
https://code.djangoproject.com/ticket/30585 .  The ticket was closed as
"wontfix", and it was mentioned that I should bring it to django-developers
if I wanted to make further progress on the ticket.

Thanks,
--Mike

Aymeric Augustin

unread,
Jul 27, 2019, 4:51:35 AM7/27/19
to django-d...@googlegroups.com
Hello,

I'm in favor of adding support for {% translate %} and {% blocktranslate %} and switching the Django documentation to use these for two reasons:

- As stated by Mike, the mental associations that "block trans" creates for those who identify as trans are just bad — I can't believe it took us 12 years to notice :-/
- Even if we leave that aside, I'm not sure saving 4 characters (8 with the closing tag) is really worth the uncommon abbreviation of "translate".

Since this change brings mostly a social benefit rather than a technical benefit, we could keep the {% trans %} and {% blocktrans %} aliases forever. Also, this could minimize arguments between those who recognize the benefits of such changes and those who don't, as we've seen when we changed master / slave to primary / replica.

In my opinion, such debates mostly reflect the political rift that appeared in many Western countries in the recent years. It's completely predictable that they spill into our community. Since they aren't our main focus, we're trying to avoid spending too much time there. But we can't escape the fact that we're making Django first for people writing software, then for computers running that software.

As a community, we chose to state in our Code of Conduct that "we strive to be a community that welcomes and supports people of all backgrounds and identities [including] sexual orientation, gender identity and expression". I believe that the change proposed here is in line with this statement. I know that some community members will feel that we're doing too much here — and that others feel that we aren't doing enough in general — which is why I'm referencing something we already agreed upon.

Best regards,

-- 
Aymeric.



--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a43ec0ab-f73a-4c11-8fc1-b05d081b24c3%40googlegroups.com.

Adam Johnson

unread,
Jul 27, 2019, 6:15:24 AM7/27/19
to django-d...@googlegroups.com
+1 from me too for the reasons that Aymeric states.

Another small pro: "translate" is a few more characters to type, but it should make it easier to understand the purpose of the tags to newcomers. "trans" is a prefix used for many words - Wiktionary lists 609: https://en.wiktionary.org/wiki/Category:English_words_prefixed_with_trans- . I guess quite a few Django apps out there have *some* domain term on this list, so using the full word "translate" can help differentiate the tags from those other concepts.



--
Adam

Markus Holtermann

unread,
Jul 27, 2019, 7:03:25 AM7/27/19
to Django developers
Easy: +1 from me as well for reasons state before.

/Markus

On Sat, Jul 27, 2019, at 6:15 PM, Adam Johnson wrote:
> +1 from me too for the reasons that Aymeric states.
>
> Another small pro: "translate" is a few more characters to type, but it
> should make it easier to understand the purpose of the tags to
> newcomers. "trans" is a prefix used for many words - Wiktionary lists
> 609:
> https://en.wiktionary.org/wiki/Category:English_words_prefixed_with_trans- . I guess quite a few Django apps out there have *some* domain term on this list, so using the full word "translate" can help differentiate the tags from those other concepts.
>
> On Sat, 27 Jul 2019 at 09:51, Aymeric Augustin
> <aymeric....@polytechnique.org> wrote:
> > Hello,
> >
> > I'm in favor of adding support for {% translate %} and {% blocktranslate %} and switching the Django documentation to use these for two reasons:
> >
> > - As stated by Mike, the mental associations that "block trans" creates for those who identify as trans are just bad — I can't believe it took us 12 years to notice :-/
> > - Even if we leave that aside, I'm not sure saving 4 characters (8 with the closing tag) is really worth the uncommon abbreviation of "translate".
> >
> > Since this change brings mostly a social benefit rather than a technical benefit, we could keep the {% trans %} and {% blocktrans %} aliases forever. Also, this could minimize arguments between those who recognize the benefits of such changes and those who don't, as we've seen when we changed master / slave to primary / replica.
> >
> > In my opinion, such debates mostly reflect the political rift that appeared in many Western countries in the recent years. It's completely predictable that they spill into our community. Since they aren't our main focus, we're trying to avoid spending too much time there. But we can't escape the fact that we're making Django first for people writing software, then for computers running that software.
> >
> > As a community, we chose to state in our Code of Conduct that "we strive to be a community that welcomes and supports people of all backgrounds and identities [including] sexual orientation, gender identity and expression". I believe that the change proposed here is in line with this statement. I know that some community members will feel that we're doing too much here — and that others feel that we aren't doing enough in general — which is why I'm referencing something we already agreed upon.
> >
> > Best regards,
> >
> > --
> > Aymeric.
> >
> >
> >
> >> On 26 Jul 2019, at 13:17, 'Mike Hansen' via Django developers (Contributions to Django itself) <django-d...@googlegroups.com> wrote:
> >>
> >> Hello all,
> >>
> >> Recently I had a member of my team bring up that it was uncomfortable
> >> for them to work in parts of our codebase where they regularly had to
> >> see "blocktrans" in the template files. To make our work environment
> >> more inclusive, I wrote a Django package <https://pypi.org/project/django-translation-aliases/> which adds "translate" and
> >> "blocktranslate" templatetag aliases so that we could update our own
> >> internal templates to use these.
> >>
> >> We felt that this change would be in line with the Django community
> >> so I made a ticket and pull request to Django at
> >> https://code.djangoproject.com/ticket/30585 . The ticket was closed as
> >> "wontfix", and it was mentioned that I should bring it to django-developers
> >> if I wanted to make further progress on the ticket.
> >>
> >> Thanks,
> >> --Mike
> >>
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
> >> To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/a43ec0ab-f73a-4c11-8fc1-b05d081b24c3%40googlegroups.com <https://groups.google.com/d/msgid/django-developers/a43ec0ab-f73a-4c11-8fc1-b05d081b24c3%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >
>
> > --
> > You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/EF4EE680-BBA1-40EB-979E-2671349186D6%40polytechnique.org <https://groups.google.com/d/msgid/django-developers/EF4EE680-BBA1-40EB-979E-2671349186D6%40polytechnique.org?utm_medium=email&utm_source=footer>.
>
>
> --
> Adam
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-develop...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAMyDDM2APGm53KYUQoTTPOBBKofUdASCbpWTri%2BeB_XWAszeHQ%40mail.gmail.com <https://groups.google.com/d/msgid/django-developers/CAMyDDM2APGm53KYUQoTTPOBBKofUdASCbpWTri%2BeB_XWAszeHQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Andrew Godwin

unread,
Jul 27, 2019, 1:06:42 PM7/27/19
to Django developers (Contributions to Django itself)
I agree too. Let's change it.

Andrew

Florian Apolloner

unread,
Jul 27, 2019, 2:01:16 PM7/27/19
to Django developers (Contributions to Django itself)
Not opposed to changing it, but would make {% translateblock %} more sense than {% blocktranslate %}?
-- 
Aymeric.



To unsubscribe from this group and stop receiving emails from it, send an email to django-d...@googlegroups.com.

James Bennett

unread,
Jul 27, 2019, 2:04:14 PM7/27/19
to django-d...@googlegroups.com
On Sat, Jul 27, 2019 at 11:01 AM Florian Apolloner <f.apo...@gmail.com> wrote:
Not opposed to changing it, but would make {% translateblock %} more sense than {% blocktranslate %}?

I'm in favor of the change to using the full word "translate". I don't have a strong opinion on which variant to use for the block translate tag; if there's no other reason advanced for picking "translateblock" I'd point out that "blocktranslate" may make life slightly easier for people using autocomplete since it ensures you don't accidentally complete into "translate" when you wanted "translateblock" (or vice versa).

1337 Shadow Hacker

unread,
Jul 27, 2019, 6:41:29 PM7/27/19
to django-d...@googlegroups.com
If you use autocomplete then typing "{% tr" should propose both translate and translateblock which reduces the chances to pick the wrong one because the other choice did not show up
Reply all
Reply to author
Forward
0 new messages