Closed
Bug 1419466
Opened 8 years ago
Closed 8 years ago
On 404, 500 page, <h1> title is not localized
Categories
(developer.mozilla.org Graveyard :: Localization, enhancement, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jwhitlock, Unassigned, Mentored)
Details
(Keywords: in-triage, Whiteboard: [specification][type:bug])
What did you do?
================
When logged out, visit https://developer.mozilla.org/fr/docs/MissingDoc
What happened?
==============
The <head< <title> is Introuvable, but the in-page <h1> is "Not Found"
What should have happened?
==========================
The <h1> should also be "Introuvable"
Is there anything else we should know?
======================================
The 403 page appears to be fully marked for localization.
On the 500 page, only the head title is marked for localization.
| Reporter | ||
Updated•8 years ago
|
Mentor: jwhitlock
Hey, I'm taking an opensource module to university and am new to the bug fixing so I was wondering if I could give this bug a go?
| Reporter | ||
Comment 2•8 years ago
|
||
Calum, yes feel free to give it a try. The templates are at:
https://github.com/mozilla/kuma/blob/master/jinja2/404.html
https://github.com/mozilla/kuma/blob/master/jinja2/500.html
Comment 3•8 years ago
|
||
Hey, is this issue taken up? If not then can I give a try to this bug as my first bug? I went through this links but still could not understand what the bug is..!?
(In reply to John Whitlock [:jwhitlock] from comment #2)
> Calum, yes feel free to give it a try. The templates are at:
>
> https://github.com/mozilla/kuma/blob/master/jinja2/404.html
> https://github.com/mozilla/kuma/blob/master/jinja2/500.html
Flags: needinfo?(jwhitlock)
| Reporter | ||
Comment 4•8 years ago
|
||
Hritvi, yes, the bug is still open.
In the 404 template, this line sets the <head> <title>:
{% block title %}{{ page_title(_('Not Found')) }}{% endblock %}
The underscore function _('Not Found') is a short name for the (new-style) gettext function, that translates the string into the user's language.
http://jinja.pocoo.org/docs/2.10/extensions/#id2
There are other translation methods, like the {% trans %} block for multiple lines of text.
The in-page title in 404 is this line:
<h1>Not Found</h1>
It should be changed to:
<h1>_('Not Found')</h1>
Flags: needinfo?(jwhitlock)
Comment 5•8 years ago
|
||
I have solved the 404.html bug and created a pull request in the github repository.
Comment 6•8 years ago
|
||
Commits pushed to master at https://github.com/mozilla/kuma
https://github.com/mozilla/kuma/commit/3daffb2ff45aef851cfbfc3c8b7d49980aa149b3
fix bug 1419466 - added jinja2 extension of translating the 404 page
https://github.com/mozilla/kuma/commit/dfbd80de469e87e9f27cbb3a2231fcd4bb381fdc
fix bug 1419466 - added jinja2 extension of translating the 500-error page
https://github.com/mozilla/kuma/commit/71ce2417c4bc23682b220e7733790f1c6ab7e234
Merge pull request #4655 from hritvi/new-issue-1419466
fix bug 1419466 - added jinja2 extension of translating the 404 page
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 7•8 years ago
|
||
Thanks Hritvi! This code will go to production soon.
There are still non-localized strings on the 500 page, but I don't think it is as important on that page, which should be rare. But, there is further (more complex) work to do, if someone wants to do it.
Updated•6 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•