Closed
Bug 651579
Opened 13 years ago
Closed 13 years ago
Hardcoded strings in JS
Categories
(Websites :: webifyme.org, defect, P1)
Websites
webifyme.org
Tracking
(Not tracked)
RESOLVED
FIXED
1.0
People
(Reporter: ozten, Assigned: adam)
References
Details
(Keywords: l12y)
static/js/collage.js Change the Background? Up Down You can put HTML in the template, then clone from JS. url(/static/img/en/mozff4_presents.png) -- Will this image be used in all locales? If so, we are fine. Not sure why it's in a locale specific directory. If not, then you'll want to make this dynamic. You can pull the locale of the HTML attribute or use the in-page content trick from JS. static/js/quiz.js var ALPHABET = ['A','B','C','D','E','F','G','H','I','J','K','L']; -- Are these characters shown on the page? Valid email required.
Reporter | ||
Updated•13 years ago
|
Updated•13 years ago
|
Priority: -- → P1
Target Milestone: --- → 1.0
Django supports L18N in JS: http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/#javascript-catalog-view i.e. should we set this up instead?
Reporter | ||
Comment 2•13 years ago
|
||
Putting strings in the page and pulling them from the DOM with jquery is a much simpler, if less elegant solution. Javascript catalog view is cool, but depends on us fixing the locale middleware. AMO uses a similar trick, but it isn't javascript catalog view AFAIK. This also has implications for the number of JS external files and performance. I'd vote to keep it simple and use the DOM.
Assignee | ||
Comment 4•13 years ago
|
||
Fixed all of the strings I could find with these three commits: https://github.com/mozilla/webifyme/commit/c7c9c34dcc2b4a0a6dbf5893fc6dff4bd9e174e1 https://github.com/mozilla/webifyme/commit/0c81dc7468df4cf105a095885a06ff655269e628 https://github.com/mozilla/webifyme/commit/ce2a3547599e538de3e07d773aafe12cdec1bc93
Reporter | ||
Comment 5•13 years ago
|
||
static/js/quiz.js has the string ' More to go'. $('#question-container .progress .label span').text((questionCount - qIdx)+' More to go'); As someone goes through the quiz this updates to say 20 More to go 19 More to go etc I've done the L10n part of the fix, by adding a progress property to the quiz_json output in ff4/things/views.py I did this as we need to use ngettext. Feel free to implement in another way or in templates, but please use ngettext. I don't see an ajax request after each question, so this current "fix" won't work. One way to fix this is to pre-calculate the 20 strings (in Python) and put that into the JSON. Or to add another Ajax call that gets progress info. Your call. please see https://github.com/mozilla/webifyme/commit/5953f678ee01f1125088001e2599e4969533e5b1
Assignee | ||
Comment 6•13 years ago
|
||
This should have been addressed with this commit yesterday: https://github.com/mozilla/webifyme/commit/e2361987ae56160a1a08fc03bc7ce858927996b3
Comment 7•13 years ago
|
||
Adam, can I close this bug then?
Assignee | ||
Comment 8•13 years ago
|
||
Sure, or how about I just do it for you.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•