Roundup Tracker - Issues

Issue 2551077

classification
In "jinja2" template: cannot login if German language is used
Type: behavior Severity: urgent
Components: Web interface Versions: devel
process
Status: fixed fixed
:
: rouilj : LudwigReiter, rouilj
Priority: high :

Created on 2019-12-16 14:02 by LudwigReiter, last changed 2019-12-23 22:55 by rouilj.

Messages
msg6833 Author: [hidden] (LudwigReiter) Date: 2019-12-16 14:02
roundup default  5987:ea3485c67f94
template "jinja2"

I cannot login if my browser uses German as language.
error message is  ['No such action "anmelden"']

If I use English as page language, it works.
msg6834 Author: [hidden] (rouilj) Date: 2019-12-16 15:13
Hi Ludwig:

In message <1576504943.17.0.466984505266.issue2551077@roundup.psfhosted.org>,
Ludwig Reiter writes:
>roundup default  5987:ea3485c67f94
>template "jinja2"
>
>I cannot login if my browser uses German as language.
>error message is  ['No such action "anmelden"']
>
>If I use English as page language, it works.

Eep. Can you check the value of the @action hidden field in the login
form. It should be the english word Login. It looks like it's
translating things it shouldn't be.

The jinja2 template is a work in progress and the person who
contributed it has been away for some time.

I hope this is not the tip of the iceberg.

So if you know how to fix it and can add a patch that would be great.
msg6846 Author: [hidden] (rouilj) Date: 2019-12-22 01:05
Ludwig, any more info about this?
msg6847 Author: [hidden] (rouilj) Date: 2019-12-22 01:33
Ludwig can you test this.

In html/layout/navigation.html this line look wrong I don't have jinja 
installed on my pi, so I can't test, but this looks broken:

    <input type="hidden" name="@action" value="{{ 
i18n.gettext('Login')|u }}">

Can you change this line (should be at line 142) to read:

    <input type="hidden" name="@action" value="Login">

there is no sense in translating a hidden field.

If this fixes things, I'll do a search and destroy for the use of 
i18n.gettext in a hidden field. E.G.

  file.index.html:27:            <input type="hidden" name="@action" 
value="{{ i18n.gettext('edit')|u }}">
msg6849 Author: [hidden] (LudwigReiter) Date: 2019-12-23 18:01
roundup default
template jinja2

Tested it, changed the line:
<input type="hidden" name="@action" value="{{i18n.gettext('Login')|u }}">
into:
<input type="hidden" name="@action" value="Login">
Then login with German as language works.

I think you are right, the action should not be translated.
msg6851 Author: [hidden] (rouilj) Date: 2019-12-23 22:55
Fixed on rev5994:0e04fcdd1ff2.

CHANGES.txt and doc/upgrading.txt updated.
History
Date User Action Args
2019-12-23 22:55:19rouiljsetstatus: open -> fixed
resolution: fixed
messages: + msg6851
2019-12-23 18:01:46LudwigReitersetmessages: + msg6849
2019-12-22 02:51:56rouiljsetpriority: high
2019-12-22 01:33:53rouiljsetstatus: new -> open
assignee: rouilj
messages: + msg6847
2019-12-22 01:05:27rouiljsetmessages: + msg6846
2019-12-16 15:13:51rouiljsetnosy: + rouilj
messages: + msg6834
2019-12-16 14:02:23LudwigReitercreate