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)

x86
macOS
defect
Not set
normal

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.
Attachment #833310 - Flags: review?(david.humphrey)
Attachment #833310 - Flags: review?(david.humphrey) → review-
Attachment #833310 - Flags: review- → review?(david.humphrey)
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-
Lets not wrap the entire app.js file in a callback though
As long as we don't start the app before the languages are all there, that's all I'm worried about.
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)
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-
Attachment #833310 - Flags: review- → review?(david.humphrey)
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-
Comment on attachment 833310 [details] [review]
https://github.com/mozilla/node-webmaker-i18n/pull/21

done :)
Attachment #833310 - Flags: review- → review?(david.humphrey)
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.

Attachment

General

Created:
Updated:
Size: