Roundup Tracker - Issues

Issue 2550888

classification
Make classname translatable
Type: rfe Severity: normal
Components: Infrastructure, Interface Versions: devel
process
Status: new
Extending translation ability (for date at least)
View: 2550871
:
: : antmail, rouilj
Priority: : patch

Created on 2015-06-18 11:12 by antmail, last changed 2016-07-31 20:32 by rouilj.

Files
File name Uploaded Description Edit Remove
classtrans.patch antmail, 2015-06-18 11:12
Messages
msg5321 Author: [hidden] (antmail) Date: 2015-06-18 11:12
There is no posibility to make classname (such as 'issue') appear
translated.

I propose a patch (attached) which make additional calls to translator
(i18n).
With this patch one can make own locale file (in [tracker]/locale)
and add translation of every used classname:

msgid "issue"
msgstr "проблема"

P.S. This patch may(?) require patch from
http://issues.roundup-tracker.org/issue2550871
msg5334 Author: [hidden] (rouilj) Date: 2015-06-28 04:23
Hi Anthony:

I understand the idea of translating the url to be more
descriptive/friendly, but it worries me that the URI's for exactly the
same object are changing based on the locale.

What happens if a user from a Russian locale sends me a link that is
translated and I try to use it from an English locale?

What happens to load balancers/caches that see the url?  Will a cache
that has cached the responce to:

   GET http://issues.roundup-tracker.org/issue2550888

know that an update to

  http://issues.roundup-tracker.org/ausgabe2550888

(issue in german) should invalidate the cached copy?

I claim this is an issue with cool uri's shouldn't change:
   http://www.w3.org/Provider/Style/URI.html

What does this do to embedded references to issues?  If I take the
last component of the translated URL, and embed it in a message
(e.g. ausgabe2550888 rather than issue2550888 ). Will it be turned
into a link if viewed in a different locale? Will it even be turned
into a link if viewed in its own locale?

Comments?

-- rouilj
msg5335 Author: [hidden] (antmail) Date: 2015-06-29 09:06
Hello, John

This patch do nothing with url.
It just add translation call in message generating code:
from
                     m.append(self._('%(class)s %(id)s created')
                        % {'class':cn, 'id':newid})
to
                     m.append(self._('%(class)s %(id)s created')
                        % {'class':self._(cn), 'id':newid})

Without this patch you can only translate a message:
issue 25 создана

with this patch you can add
msgid issue
msgstr ошибка

to locale file and then get
ошибка 25 создана

> John Rouillard added the comment:

> Hi Anthony:

> I understand the idea of translating the url to be more
> descriptive/friendly, but it worries me that the URI's for exactly the
> same object are changing based on the locale.

> What happens if a user from a Russian locale sends me a link that is
> translated and I try to use it from an English locale?

> What happens to load balancers/caches that see the url?  Will a cache
> that has cached the responce to:

>    GET http://issues.roundup-tracker.org/issue2550888

> know that an update to

>   http://issues.roundup-tracker.org/ausgabe2550888

> (issue in german) should invalidate the cached copy?

> I claim this is an issue with cool uri's shouldn't change:
>    http://www.w3.org/Provider/Style/URI.html

> What does this do to embedded references to issues?  If I take the
> last component of the translated URL, and embed it in a message
> (e.g. ausgabe2550888 rather than issue2550888 ). Will it be turned
> into a link if viewed in a different locale? Will it even be turned
> into a link if viewed in its own locale?

> Comments?

> -- rouilj

> ----------
> nosy: +rouilj

> ________________________________________________
> Roundup tracker <issues@roundup-tracker.org>
> <http://issues.roundup-tracker.org/issue2550888>
> ________________________________________________
msg5341 Author: [hidden] (rouilj) Date: 2015-07-05 23:39
Anthony said:

> Without this patch you can only translate a message:
> issue 25 создана
>
> with this patch you can add
> msgid issue
> msgstr ошибка
>
> to locale file and then get
> ошибка 25 создана

Ah ok, now I understand the scope. So the second part of my question
(the non URL change part) from msg5334 still stands:

> What does this do to embedded references to issues?  ...

will issue25 entered into the message and then displayed as the translated:

  'ошибка 25'

still be shown show as a link to issue 25 with this patch?
I assume so, but it depends on where the translation occurs in the
processing pipeline.

What happens if the user in the russian locale types in:

 ошибка25

will this be shown as a link in russian? Will this be shown as a
link in other locales (e.g. english which should translate it back
to issue 25).

If the links show up in all cases above, I think we can go forward
and add any tests we need and get this merged.

If it doesn't create the links in all cases the patch needs to be
reworked so that the link is created.
msg5345 Author: [hidden] (antmail) Date: 2015-07-06 12:32
> What happens if the user in the russian locale types in:

>  ошибка25

> will this be shown as a link in russian? Will this be shown as a
> link in other locales (e.g. english which should translate it back
> to issue 25).

Links  remains  original.  This is only for a few ok|error messages. But if one want
translated message to have embedded link, such as:
msgid issue
msgid ошибка
msgid %class created
msgstr <a href="%class">%class</a> created
this may be a problem.

> If the links show up in all cases above, I think we can go forward
> and add any tests we need and get this merged.

I can't image what the tests should be.

> If it doesn't create the links in all cases the patch needs to be
> reworked so that the link is created.

> ________________________________________________
> Roundup tracker <issues@roundup-tracker.org>
> <http://issues.roundup-tracker.org/issue2550888>
> ________________________________________________
History
Date User Action Args
2016-07-31 20:32:49rouiljsettype: rfe
2015-07-06 12:32:05antmailsetmessages: + msg5345
2015-07-05 23:39:17rouiljsetmessages: + msg5341
2015-07-01 19:03:07jerrykansetdependencies: + Extending translation ability (for date at least)
2015-06-29 09:06:54antmailsetmessages: + msg5335
2015-06-28 04:23:18rouiljsetnosy: + rouilj
messages: + msg5334
2015-06-18 11:12:44antmailcreate