Merge pull request #607 from chilts/more-lang-clean-up

Fixes #606 : Add back in it-CH as default, remove en-AU, fix tests
This commit is contained in:
Danny Coates 2014-03-09 13:53:36 -07:00
Родитель eef043aad6 87d290f795
Коммит 1ec61245d9
6 изменённых файлов: 55 добавлений и 62 удалений

Просмотреть файл

@ -90,18 +90,6 @@ var template = {
text : 'Firefox Accounts\n\nA request to reset the password for {{{email}}} has been made.\nReset password: {{{link}}}\n\nIf you received this email in error, no action is required.\n',
},
},
'en-AU' : {
verify : {
subject : 'Confirm Your Account',
html : '<p>GDay<br>Firefox Accounts<br><br>Congratulations! {{{email}}}, you are seconds away from verifying your Firefox Account.<br>Verify: {{{link}}}<br><br>If you received this email in error, no action is required.</p>',
text : 'GDay\n\nFirefox Accounts\n\nCongratulations! {{{email}}}, you are seconds away from verifying your Firefox Account.\nVerify: {{{link}}}\n\nIf you received this email in error, no action is required.',
},
reset : {
subject : 'Reset Password Request',
html : '<p>Firefox Accounts<br><br>A request to reset the password for {{{email}}} has been made.\nReset password: {{{link}}}<br><br>If you received this email in error, no action is required.</p>',
text : 'Firefox Accounts\n\nA request to reset the password for {{{email}}} has been made.\nReset password: {{{link}}}\n\nIf you received this email in error, no action is required.\n',
},
},
'it-CH' : {
verify : {
subject : 'ʇunoɔɔ∀ ɹno⅄ ɯɹıɟuoↃ',

Просмотреть файл

@ -252,7 +252,7 @@ module.exports = function (fs, path, url, convict) {
supportedLanguages: {
doc: "List of languages this deployment should detect and display localized strings.",
format: Array,
default: ['en-US', 'es-MX'],
default: ['en-US', 'it-CH'],
env: 'I18N_SUPPORTED_LANGUAGES'
},
translationDirectory: {

Просмотреть файл

@ -12,7 +12,8 @@ var config = require('../config').root()
console.log(config)
console.log(config.i18n.supportedLanguages)
// This list is from fxa-content-server/locale/* (minus README.md, templates/, linux/ and win32/).
// This list is from fxa-content-server/locale/* (minus README.md, templates/, linux/ and win32/)
// and includes the debug language it-CH.
//
// The reason we do this is because if we were to read our own config, it wouldn't
// be what is running in production and is actually used. Therefore, for now, we need
@ -21,6 +22,8 @@ console.log(config.i18n.supportedLanguages)
// So, when running fxa-content-server, you need to have all of these set up in
// the fxa-content-server/server/config/local.json.
var langs = [
'it-CH',
'af',
'an',
'ar',

Просмотреть файл

@ -0,0 +1 @@
{"subject":"ʇsǝnbǝᴚ pɹoʍssaԀ ʇǝsǝᴚ","html":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>sʇunoɔɔ∀ xoɟǝɹıℲ</title>\n <style type=\"text/css\">\n #outlook a{padding:0;} /* Force Outlook to provide a \"view in browser\" button. */\n body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */\n body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */\n\n body{\n background: #f2f2f2;\n margin:0;\n padding:0;\n width:100% !important;\n -webkit-text-size-adjust:none;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 14px;\n color: #424f5a;\n }\n img{\n border:0;\n height:auto;\n line-height:100%;\n outline:none;\n text-decoration:none;\n }\n a{\n color: #3b9bda;\n text-decoration: none;\n }\n a:hover{\n text-decoration: underline;\n }\n p{\n margin: 0 0 15px;\n line-height: 1.5;\n }\n\n h1 {\n color: #45505b;\n }\n\n h2{\n font-size: 18px;\n margin: 20px 0 15px;\n }\n\n p:last-child{\n margin-bottom: 0;\n }\n table td{\n border-collapse:collapse;\n }\n </style>\n </head>\n <body style=\"-webkit-text-size-adjust: none;margin: 0;padding: 0;background-color: #f2f2f2;width: 100% !important;\">\n <center>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\">\n <tr style=\"margin: 0;\n padding: 0;\n height: 100% !important;\n width: 100% !important;\n background: #f2f2f2;\n -webkit-text-size-adjust:none;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 14px;\n text-align:center\n color: #424f5a;\">\n <td align=\"center\" valign=\"top\" style=\"border-collapse: collapse;\">\n\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tr class=\"spacer\">\n <td height=\"60px\"></td>\n </tr>\n </table><!-- #header -->\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" style=\"background-color: #fff; border-radius: 3px; margin-bottom: 60px; border-bottom:1px solid #AABBC8; border-left:1px solid #CADBD8; border-right:1px solid #CADBD8; border-top:1px solid #DDD; padding-bottom:20px\">\n <tr>\n <td align=\"center\" valign=\"top\" style=\"border-collapse: collapse; color: white;\">\n <h1 style=\"font-weight:lighter;padding:40px 0 0 0; margin:0; font-size:28px\">sʇunoɔɔ∀ xoɟǝɹıℲ</h1>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" class=\"email-content\" style=\"border-collapse: collapse; padding: 30px;\">\n <p>.ǝpaɯ uǝǝq saɥ {{{email}}} ɹoɟ pɹoʍssad ǝɥʇ ʇǝsǝɹ oʇ ʇsǝnbǝɹ ∀</p>\n <p style=\"padding:10px;\"><a\n style=\"\n padding:10px 0;\n background: #0095dd;\n width:300px;\n display:block;\n color:#fff;\n font-size:20px;\n border-radius:5px\"\n href=\"{{{link}}}\">pɹoʍssad ʇǝsǝᴚ</a></p>\n\n <p style=\"color:#8A9BA8;font-size:10px\">.pǝɹınbǝɹ sı uoıʇɔa ou ´ɹoɹɹǝ uı ʅıaɯǝ sıɥʇ pǝʌıǝɔǝɹ noʎ ɟI</p>\n </td>\n </tr>\n </table><!-- #content -->\n\n </td>\n </tr>\n </table><!-- #container table -->\n </center>\n\n </body>\n</html>\n","text":"sʇunoɔɔ∀ xoɟǝɹıℲ\n\n.ǝpaɯ uǝǝq saɥ {{{email}}} ɹoɟ pɹoʍssad ǝɥʇ ʇǝsǝɹ oʇ ʇsǝnbǝɹ ∀\n:pɹoʍssad ʇǝsǝᴚ {{{link}}}\n\n.pǝɹınbǝɹ sı uoıʇɔa ou ´ɹoɹɹǝ uı ʅıaɯǝ sıɥʇ pǝʌıǝɔǝɹ noʎ ɟI\n"}

Просмотреть файл

@ -0,0 +1 @@
{"subject":"ʇunoɔɔ∀ ɹno⅄ ɯɹıɟuoↃ","html":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n <title>sʇunoɔɔ∀ xoɟǝɹıℲ</title>\n <style type=\"text/css\">\n #outlook a{padding:0;} /* Force Outlook to provide a \"view in browser\" button. */\n body{width:100% !important;} .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} /* Force Hotmail to display emails at full width */\n body{-webkit-text-size-adjust:none;} /* Prevent Webkit platforms from changing default text sizes. */\n\n body{\n background: #f2f2f2;\n margin:0;\n padding:0;\n width:100% !important;\n -webkit-text-size-adjust:none;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 14px;\n color: #424f5a;\n }\n img{\n border:0;\n height:auto;\n line-height:100%;\n outline:none;\n text-decoration:none;\n }\n a{\n color: #3b9bda;\n text-decoration: none;\n }\n a:hover{\n text-decoration: underline;\n }\n p{\n margin: 0 0 15px;\n line-height: 1.5;\n }\n\n h1 {\n color: #45505b;\n }\n\n h2{\n font-size: 18px;\n margin: 20px 0 15px;\n }\n\n p:last-child{\n margin-bottom: 0;\n }\n table td{\n border-collapse:collapse;\n }\n </style>\n </head>\n <body style=\"-webkit-text-size-adjust: none;margin: 0;padding: 0;background-color: #f2f2f2;width: 100% !important;\">\n <center>\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" height=\"100%\" width=\"100%\">\n <tr style=\"margin: 0;\n padding: 0;\n height: 100% !important;\n width: 100% !important;\n background: #f2f2f2;\n -webkit-text-size-adjust:none;\n font-family: Helvetica, Arial, sans-serif;\n font-size: 14px;\n text-align:center\n color: #424f5a;\">\n <td align=\"center\" valign=\"top\" style=\"border-collapse: collapse;\">\n\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n <tr class=\"spacer\">\n <td height=\"60px\"></td>\n </tr>\n </table><!-- #header -->\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" style=\"background-color: #fff; border-radius: 3px; margin-bottom: 60px; border-bottom:1px solid #AABBC8; border-left:1px solid #CADBD8; border-right:1px solid #CADBD8; border-top:1px solid #DDD; padding-bottom:20px\">\n <tr>\n <td align=\"center\" valign=\"top\" style=\"border-collapse: collapse; color: white;\">\n <h1 style=\"font-weight:lighter;padding:40px 0 0 0; margin:0; font-size:28px\">sʇunoɔɔ∀ xoɟǝɹıℲ</h1>\n </td>\n </tr>\n <tr>\n <td align=\"center\" valign=\"top\" class=\"email-content\" style=\"border-collapse: collapse; padding: 30px;\">\n <p>.ʇunoɔɔ∀ xoɟǝɹıℲ ɹnoʎ ƃuıʎɟıɹǝʌ ɯoɹɟ ʎaʍa spuoɔǝs ǝɹa noʎ ´{{{email}}} ¡suoıʇaʅnʇaɹƃuoↃ</p>\n <p style=\"padding:10px;\"><a\n style=\"\n padding:10px 0;\n background: #0095dd;\n width:300px;\n display:block;\n color:#fff;\n font-size:20px;\n border-radius:5px\"\n href=\"{{{link}}}\">ʎɟıɹǝɅ</a></p>\n\n <p style=\"color:#8A9BA8;font-size:10px\">.pǝɹınbǝɹ sı uoıʇɔa ou ´ɹoɹɹǝ uı ʅıaɯǝ sıɥʇ pǝʌıǝɔǝɹ noʎ ɟI</p>\n </td>\n </tr>\n </table><!-- #content -->\n\n </td>\n </tr>\n </table><!-- #container table -->\n </center>\n\n </body>\n</html>\n","text":"sʇunoɔɔ∀ xoɟǝɹıℲ\n\n.ʇunoɔɔ∀ xoɟǝɹıℲ ɹnoʎ ƃuıʎɟıɹǝʌ ɯoɹɟ ʎaʍa spuoɔǝs ǝɹa noʎ ´{{{email}}} ¡suoıʇaʅnʇaɹƃuoↃ\n:ʎɟıɹǝɅ {{{link}}}\n\n.pǝɹınbǝɹ sı uoıʇɔa ou ´ɹoɹɹǝ uı ʅıaɯǝ sıɥʇ pǝʌıǝɔǝɹ noʎ ɟI\n"}

Просмотреть файл

@ -149,54 +149,54 @@ TestServer.start(config)
}
)
// test(
// 'create account allows localization of emails',
// function (t) {
// var email = server.uniqueEmail()
// var password = 'allyourbasearebelongtous'
// var client = null
// return Client.create(config.publicUrl, email, password)
// .then(
// function (x) {
// client = x
// }
// )
// .then(
// function () {
// return server.mailbox.waitForEmail(email)
// }
// )
// .then(
// function (emailData) {
// t.assert(emailData.text.indexOf('Welcome') !== -1, 'is en')
// t.assert(emailData.text.indexOf('GDay') === -1, 'not en-AU')
// return client.destroyAccount()
// }
// )
// .then(
// function () {
// return Client.create(config.publicUrl, email, password, { lang: 'en-AU' })
// }
// )
// .then(
// function (x) {
// client = x
// }
// )
// .then(
// function () {
// return server.mailbox.waitForEmail(email)
// }
// )
// .then(
// function (emailData) {
// t.assert(emailData.text.indexOf('Welcome') === -1, 'not en')
// t.assert(emailData.text.indexOf('GDay') !== -1, 'is en-AU')
// return client.destroyAccount()
// }
// )
// }
// )
test(
'create account allows localization of emails',
function (t) {
var email = server.uniqueEmail()
var password = 'allyourbasearebelongtous'
var client = null
return Client.create(config.publicUrl, email, password)
.then(
function (x) {
client = x
}
)
.then(
function () {
return server.mailbox.waitForEmail(email)
}
)
.then(
function (emailData) {
t.assert(emailData.text.indexOf('Verify') !== -1, 'is en-US')
t.assert(emailData.text.indexOf('ʎɟıɹǝɅ') === -1, 'not it-CH')
return client.destroyAccount()
}
)
.then(
function () {
return Client.create(config.publicUrl, email, password, { lang: 'it-CH' })
}
)
.then(
function (x) {
client = x
}
)
.then(
function () {
return server.mailbox.waitForEmail(email)
}
)
.then(
function (emailData) {
t.assert(emailData.text.indexOf('Verify') === -1, 'not en-US')
t.assert(emailData.text.indexOf('ʎɟıɹǝɅ') !== -1, 'is it-CH')
return client.destroyAccount()
}
)
}
)
test(
'Unknown account should not exist',