Closed
Bug 939266
Opened 11 years ago
Closed 11 years ago
Implement global enabling languages to test all the languages from Transifex
Categories
(Webmaker Graveyard :: Localization, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: alicoding, Assigned: alicoding)
Details
Attachments
(1 file)
We want to be able to test all the languages or put them on staging by downloading all the langauges from Transifex and enable them all.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #833310 -
Flags: review?(david.humphrey)
Updated•11 years ago
|
Attachment #833310 -
Flags: review?(david.humphrey) → review-
Assignee | ||
Updated•11 years ago
|
Attachment #833310 -
Flags: review- → review?(david.humphrey)
Comment 2•11 years ago
|
||
Comment on attachment 833310 [details] [review] https://github.com/mozilla/node-webmaker-i18n/pull/21 So we setup our localizations like so: app.use( i18n.middleware({ /* options */ })); If you pass in a list of supported languages that are local, this will work synchronously. However, in your new '*' method, the operation will by async. This means that the app.js will start, and potentially not have any strings. We need to block the flow of app.js startup until the strings are really there. This means we need to give a callback for the middleware creation. One possible way to do this would be to use a function with a callback arg, like so: app.use( i18n.middleware({ /* options */ }, function callback(err) { /* app.js can keep going, all languages are setup and ready */ })); Another way to do this would be with an init call on i18n: var i18n = require("webmaker-i18n"); i18n.init(/*options*/, function callback(err) { /* all strings are loaded, keep going with rest of app.js startup */ ... }); One way or another, we have to re-work this code to be async now.
Attachment #833310 -
Flags: review?(david.humphrey) → review-
Comment 3•11 years ago
|
||
Lets not wrap the entire app.js file in a callback though
Comment 4•11 years ago
|
||
As long as we don't start the app before the languages are all there, that's all I'm worried about.
Assignee | ||
Comment 5•11 years ago
|
||
Comment on attachment 833310 [details] [review] https://github.com/mozilla/node-webmaker-i18n/pull/21 This is the transifex file to download https://github.com/alicoding/node-transifex/blob/eee9e30d6b4e3cd9dd08600c57abb4c3d224f8a1/bin/index.js From this repo which I did setup this to make it available globally like "bower" https://github.com/alicoding/node-transifex
Attachment #833310 -
Flags: review- → review?(david.humphrey)
Assignee | ||
Comment 6•11 years ago
|
||
Updated the script - https://github.com/alicoding/node-transifex/blob/8ae870b14c51ec2837ff1696b98db2ce0c057485/bin/index.js
Comment 7•11 years ago
|
||
Comment on attachment 833310 [details] [review] https://github.com/mozilla/node-webmaker-i18n/pull/21 A few more things. Looking good, almost there.
Attachment #833310 -
Flags: review?(david.humphrey) → review-
Assignee | ||
Updated•11 years ago
|
Attachment #833310 -
Flags: review- → review?(david.humphrey)
Comment 8•11 years ago
|
||
Comment on attachment 833310 [details] [review] https://github.com/mozilla/node-webmaker-i18n/pull/21 Couple more things.
Attachment #833310 -
Flags: review?(david.humphrey) → review-
Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 833310 [details] [review] https://github.com/mozilla/node-webmaker-i18n/pull/21 done :)
Attachment #833310 -
Flags: review- → review?(david.humphrey)
Comment 10•11 years ago
|
||
Comment on attachment 833310 [details] [review] https://github.com/mozilla/node-webmaker-i18n/pull/21 Awesome, r+
Attachment #833310 -
Flags: review?(david.humphrey) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Merged https://github.com/alicoding/node-webmaker-i18n/commit/226febd0f95a5d6756bee15d5758e855a6eb2b4c
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•