Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Commit

Permalink
webmaker-i18n to v0.3.20bug949106 - Update webmaker-i18n to v0.3.20
Browse files Browse the repository at this point in the history
  • Loading branch information
alicoding committed Apr 25, 2014
1 parent f7a9aa7 commit 7111661
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
43 changes: 24 additions & 19 deletions app.js
Expand Up @@ -83,25 +83,6 @@ app.use(middleware.addCSP({
togetherJS: env.get('TOGETHERJS')
}));

app.use( i18n.middleware({
supported_languages: env.get( "SUPPORTED_LANGS" ),
default_lang: "en-US",
mappings: require("webmaker-locale-mapping"),
translation_directory: path.resolve( __dirname, "locale" )
}));

i18n.addLocaleObject({
// Adding an external JSON file to our existing one for the specified locale
"en-US": require("./bower_components/webmaker-auth-client/locale/en_US/create-user-form.json")
}, function(){} );

app.locals({
GA_ACCOUNT: env.get("GA_ACCOUNT"),
GA_DOMAIN: env.get("GA_DOMAIN"),
languages: i18n.getSupportLanguages(),
newrelic: newrelic
});

// Express settings
app.disable('x-powered-by');
app.use(express.favicon(__dirname + '/public/img/favicon.ico'));
Expand Down Expand Up @@ -129,6 +110,30 @@ app.use(express.urlencoded());
app.use(webmakerAuth.cookieParser());
app.use(webmakerAuth.cookieSession());

app.use( i18n.middleware({
supported_languages: env.get( "SUPPORTED_LANGS" ),
default_lang: "en-US",
mappings: require("webmaker-locale-mapping"),
translation_directory: path.resolve( __dirname, "locale" )
}));

i18n.addLocaleObject({
// Adding an external JSON file to our existing one for the specified locale
"en-US": require("./bower_components/webmaker-auth-client/locale/en_US/create-user-form.json")
}, function (err, res) {
if (err) {
console.error(err);
}
});

app.locals({
GA_ACCOUNT: env.get("GA_ACCOUNT"),
GA_DOMAIN: env.get("GA_DOMAIN"),
languages: i18n.getSupportLanguages(),
newrelic: newrelic,
bower_path: "bower_components"
});

app.use(express.csrf());
app.use(helmet.xframe());
app.use(app.router);
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Expand Up @@ -5,8 +5,8 @@
"open-sans-fontface": "1.0.4",
"persona-btn": "0.0.11",
"webmaker-analytics": "0.0.4",
"webmaker-auth-client": "0.0.28",
"webmaker-auth-client": "0.0.29",
"webmaker-i18n": "https://github.com/mozilla/node-webmaker-i18n/archive/v0.3.8.tar.gz",
"webmaker-language-picker": "0.0.20"
"webmaker-language-picker": "0.0.22"
}
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"sequelize": "1.6.0",
"uslug": "1.0.3",
"webmaker-download-locales": "0.1.2",
"webmaker-i18n": "https://github.com/mozilla/node-webmaker-i18n/archive/v0.3.15.tar.gz",
"webmaker-i18n": "0.3.20",
"webmaker-locale-mapping": "latest",
"webmaker-translation-stats": "0.0.1",
"webmaker-auth": "0.0.11"
Expand Down
3 changes: 2 additions & 1 deletion public/scripts/friendlycode.js
Expand Up @@ -12,10 +12,11 @@
/**
* ...
*/
define("hackpub", ["jquery"], function($) {
define("hackpub", ["jquery", "selectize"], function($, selectize) {

// set up CSRF handling
var csrf_token = $("meta[name='csrf-token']").attr("content");
$("#supportedLocales").selectize();

return function Hackpub(options) {
return {
Expand Down

0 comments on commit 7111661

Please sign in to comment.