[L10n] Django templates should always make Dekiwiki links gettext strings

VERIFIED FIXED in 0.9.3

Status

Mozilla Developer Network
Wiki pages
--
blocker
VERIFIED FIXED
7 years ago
5 years ago

People

(Reporter: ozten, Assigned: groovecoder)

Tracking

unspecified
0.9.3
Dependency tree / graph

Details

(Reporter)

Description

7 years ago
Because locales often localize page names, a link path may vary from the English path name. Linking to Dekiwiki should always:
* be relative
* be a gettext string

Psuedo Code example:
<a href="{{_('/en/JavaScript')}}">{{_('JavaScript')}}</a>

We can use trans blocks or sprintf or whatever, but localizers need control over the full href value.

Comment 1

7 years ago
This is probably a good idea for most cases, but we should make sure this doesn't break any of the Deki l10n dependencies for en-US docs and their relationship with localized versions of those docs.
Assignee: nobody → lcrouch
(Assignee)

Comment 2

7 years ago
I think localizing the href's actually FIXES Deki stuff. Right now if I set my browser to Deutsch and go to /docs/ I'm correctly forwarded to https://developer.mozilla.org/de/docs by django.

But, because the href's are hard-coded to /en/* deki doesn't honor my browser language preference. I even tried setting my DekiWiki language preference to Deutsch and the hard-coded href's override even Deki's own preference!

What are Deki's dependencies for en-US docs?

This will be important to fix if/when 0.9.3 goes out touting localization features. Should we make this a 0.9.3 bug then?
(Assignee)

Comment 3

7 years ago
bump.

Jay: want to make this a 0.9.3 blocker? should I start slogging away at the /en/ links?
(Assignee)

Comment 4

7 years ago
(In reply to comment #0)

Should we make the href's a gettext string, or should we just auto-detect language for the request and auto-replace 'en' with the language code? (via the devmo_url helper)
(Assignee)

Comment 5

7 years ago
I'll see how tricky it would be to auto-detect the language for the request, check the dekiwiki database for a localized version of the page to serve either the localized URL or default to 'en'.

If that's going to be too much, I'll make the href's into gettext strings so localizers can manually check the wiki and change the url's by locale.
(Assignee)

Updated

7 years ago
Target Milestone: --- → 0.9.3
(Assignee)

Comment 6

7 years ago
This will need memcache on staging and production so we don't make dozens of
http requests to dekiwiki for every mdn page.

And we will want to change the CACHE_BACKEND in settings[_local].py to
memcached.
Depends on: 630938
(Assignee)

Updated

7 years ago
Severity: normal → blocker
(Assignee)

Updated

7 years ago
Severity: blocker → normal
(Assignee)

Updated

7 years ago
Depends on: 631234

Comment 7

7 years ago
Let's get IT to help get this blocker fixed for 0.9.3.  It's an important release for l10n and this will be a huge win for us.
Severity: normal → blocker
(Assignee)

Updated

7 years ago
Depends on: 632100
(Assignee)

Comment 8

7 years ago
cronjob and memcache are good.

href strings are ready for localizers in verbatim.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
verified fixed https://developer.mozilla.org/en-US/
Status: RESOLVED → VERIFIED
Component: Website → Landing pages
Product: Mozilla Developer Network → Mozilla Developer Network
You need to log in before you can comment on or make changes to this bug.