From 3403ea60f6f4fbd82e5f4e95f00de1d013ca89bc Mon Sep 17 00:00:00 2001 From: Adrien Courty Date: Fri, 30 Nov 2018 18:51:19 +0100 Subject: [PATCH] add t9n support --- README.md | 17 +- __tests__/_client/forms/baseForm.test.js | 2 + lib/AccountsReact.js | 203 ++-- lib/AccountsReactComponent/baseForm.js | 14 +- lib/AccountsReactComponent/changePwd.js | 4 +- lib/AccountsReactComponent/enrollAccount.js | 4 +- lib/AccountsReactComponent/forgotPwd.js | 6 +- .../methods/ARCreateAccount.js | 5 +- .../methods/ARResendVerificationEmail.js | 5 +- .../resendVerification.js | 6 +- lib/AccountsReactComponent/resetPwd.js | 4 +- lib/AccountsReactComponent/signIn.js | 8 +- lib/AccountsReactComponent/signUp.js | 6 +- lib/t9n.js | 48 + package-lock.json | 917 +----------------- package.json | 3 +- 16 files changed, 245 insertions(+), 1007 deletions(-) create mode 100644 lib/t9n.js diff --git a/README.md b/README.md index a54dd22..c58435a 100644 --- a/README.md +++ b/README.md @@ -488,12 +488,27 @@ This functionality is not implemented yet, You can [help](https://github.com/roy #### Edit Fields This functionality is not implemented yet, You can [help](https://github.com/royGil/accounts-react/issues/4) + + +### Translation + +Configuring the language of the texts to be used by the forms is done via the `AccountsReact.configure` function. + + +```javascript +import { AccountsReact } from 'meteor/meteoreact:accounts' +AccountsReact.configure({ + language: 'de' +}) +``` + +The supported languages are those defined in the [meteor-accounts-t9n](https://github.com/softwarerero/meteor-accounts-t9n) package. ### Texts -Configuring the text to be used by the forms is done via the `AccountsReact.configure` function. +In addition to configuring the language for texts to be used by the forms, they can also be configured independently via the `AccountsReact.configure` function. The default configuration object contains a `texts` property which you can view [here](https://github.com/royGil/accounts-react/blob/master/lib/AccountsReact.js#L206) diff --git a/__tests__/_client/forms/baseForm.test.js b/__tests__/_client/forms/baseForm.test.js index 79b6620..95234d5 100644 --- a/__tests__/_client/forms/baseForm.test.js +++ b/__tests__/_client/forms/baseForm.test.js @@ -2,6 +2,7 @@ import React from 'react' import { shallow, mount } from 'enzyme' import { expect } from 'chai' import sinon from 'sinon' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from '../../../lib/AccountsReactComponent/baseForm' import AccountsReact from '../../../lib/AccountsReact' @@ -40,6 +41,7 @@ describe('', () => { }) it('should not render the title of the current state if not defined', () => { + props.defaults.translations.title[props.currentState] = '' // remove translation for the title props.defaults.texts.title[props.currentState] = '' // remove text for the title const wrapper = mount() diff --git a/lib/AccountsReact.js b/lib/AccountsReact.js index 4147d4f..d21cc03 100644 --- a/lib/AccountsReact.js +++ b/lib/AccountsReact.js @@ -1,9 +1,10 @@ import { Meteor } from 'meteor/meteor' import { Accounts } from 'meteor/accounts-base' +import { T9n } from 'meteor-accounts-t9n' +import { setLanguage } from './t9n' import regExp from './utils/regExp' import merge from './utils/deepmerge' import './AccountsReactComponent/methods' - class AccountsReact_ { constructor () { this._init = false @@ -38,6 +39,7 @@ class AccountsReact_ { showResendVerificationLink: false, showLabels: true, showPlaceholders: true, + language: 'en', /* ----------------------------- Client Side Validation @@ -88,20 +90,20 @@ class AccountsReact_ { signIn: [ { _id: 'username', - displayName: 'Username', - placeholder: 'Enter your username' + displayName: 'username', // 'Username', + placeholder: 'enterUsername', // 'Enter your username' }, { _id: 'email', - displayName: 'Email', - placeholder: 'Enter your email', + displayName: 'email', // 'Email', + placeholder: 'enterEmail', // 'Enter your email', re: regExp.Email }, { _id: 'password', - displayName: 'Password', + displayName: 'password', // 'Password', type: 'password', - placeholder: 'Enter your password', + placeholder: 'enterPassword', // 'Enter your password', autocomplete: 'current-password' } ], @@ -111,36 +113,36 @@ class AccountsReact_ { signUp: [ { _id: 'username', - displayName: 'Username', - placeholder:'Enter your username', + displayName: 'username', // 'Username', + placeholder: 'enterUsername', // 'Enter your username', minLength: 4, maxLength: 22, re: regExp.Username, - errStr: 'Username must be between 4 and 22 characters', + errStr: 'error.accounts.user_validation_failed', // 'Username must be between 4 and 22 characters', }, { _id: 'email', - displayName: 'Email', - placeholder: 'Enter your email', + displayName: 'email', // 'Email', + placeholder: 'enterEmail', // 'Enter your email', re: regExp.Email, - errStr: 'Please enter a valid email' + errStr: 'error.accounts.incorrect_email', // 'Please enter a valid email' }, { _id: 'password', - displayName: 'Password', + displayName: 'password', // 'Password', type: 'password', - placeholder: 'Enter your password', + placeholder: 'enterPassword', // 'Enter your password', minLength: 6, maxLength: 32, - errStr: 'Please enter a strong password between 6 and 32 characters', + errStr: 'error.accounts.incorrect_password', // 'Please enter a strong password between 6 and 32 characters', autocomplete: 'new-password' }, { _id: 'confirmPassword', - displayName: 'Confirm password', + displayName: 'passwordAgain', // 'Confirm password', type: 'password', - placeholder: 'Re-enter your password', - errStr: 'Password doesn\'t match', + placeholder: 'passwordAgain', // 'Re-enter your password', + errStr: 'error.accounts.incorrect_password', // 'Password doesn\'t match', exclude: true, autocomplete: 'new-password', func: (fields, fieldObj, value, model, errorsArray) => { @@ -169,10 +171,10 @@ class AccountsReact_ { forgotPwd: [ { _id: 'email', - displayName: 'Email', - placeholder: 'Enter your email', + displayName: 'email', // 'Email', + placeholder: 'enterEmail', // 'Enter your email', re: regExp.Email, - errStr: 'Please enter a valid email' + errStr: 'error.accounts.email_doesnt_match_the_criteria', // 'Please enter a valid email' } ], @@ -181,19 +183,19 @@ class AccountsReact_ { changePwd: [ { _id: 'currentPassword', - displayName: 'Current password', + displayName: 'currentPassword', // 'Current password', type: 'password', - placeholder: 'Enter your current password', + placeholder: 'enterPassword', // 'Enter your current password', autocomplete: 'current-password' }, { _id: 'password', - displayName: 'Password', + displayName: 'password', // 'Password', type: 'password', - placeholder: 'Enter a new password', + placeholder: 'enterNewPassword', // 'Enter a new password', minLength: 6, maxLength: 32, - errStr: 'Please enter a strong password between 6 and 32 characters', + errStr: 'error.accounts.incorrect_password', // 'Please enter a strong password between 6 and 32 characters', autocomplete: 'new-password' } ], @@ -203,9 +205,9 @@ class AccountsReact_ { resetPwd: [ { _id: 'password', - displayName: 'New password', + displayName: 'newPassword', //'New password', type: 'password', - placeholder: 'Enter a new password', + placeholder: 'enterNewPassword', // 'Enter a new password', autocomplete: 'new-password' } ], @@ -215,10 +217,10 @@ class AccountsReact_ { resendVerification: [ { _id: 'email', - displayName: 'Email', - placeholder: 'Enter your email', + displayName: 'email', // 'Email', + placeholder: 'enterEmail', re: regExp.Email, - errStr: 'Please enter a valid email' + errStr: 'error.accounts.email_doesnt_match_the_criteria', // 'Please enter a valid email' } ], @@ -226,75 +228,129 @@ class AccountsReact_ { enrollAccount: [ { _id: 'password', - displayName: 'Password', + displayName: 'password', // 'Password', type: 'password', - placeholder: 'Enter your password', + placeholder: 'enterPassword', // 'Enter your password', minLength: 6, maxLength: 32, - errStr: 'Please enter a strong password between 6 and 32 characters', + errStr: 'error.accounts.incorrect_password', // 'Please enter a strong password between 6 and 32 characters', autocomplete: 'new-password' }, { _id: 'confirmPassword', - displayName: 'Confirm password', + displayName: 'passwordAgain', // 'Confirm password', type: 'password', - placeholder: 'Re-enter your password', - errStr: 'Password doesn\'t match', + placeholder: 'enterPassword', // 'Re-enter your password', + errStr: 'error.accounts.incorrect_password', // 'Password doesn\'t match', exclude: true, autocomplete: 'new-password', } ] }, + /* ----------------------------- + Translations + ----------------------------- */ + + translations: { + button: { + changePwd: 'updateYourPassword', // Update New Password + forgotPwd: 'emailResetLink', // 'Send Reset Link', + resetPwd: 'updateYourPassword', // 'Save New Password', + signIn: 'signIn', // 'Login', + signUp: 'signUp', // 'Register', + resendVerification: 'resendVerificationEmail', // 'Send Verification Link', + enrollAccount: 'createAccount', // 'Save Password', + }, + title: { + changePwd: 'changePassword', // 'Change Password', + forgotPwd: 'forgotPassword', // 'Forgot Password', + resetPwd: 'resetYourPassword', // 'Reset Password', + signIn: 'signIn', // 'Login', + signUp: 'createAccount', // 'Create Your Account', + resendVerification: 'resendVerificationEmail', // 'Resend Verification Link', + enrollAccount: 'setPassword', // 'Set Your Account Password', + }, + links: { + toChangePwd: 'changePassword', // 'Change your password', + toResetPwd: 'resetYourPassword', // 'Reset your password', + toForgotPwd: 'forgotPassword', // 'Forgot your password?', + toSignIn: 'signIn', // 'Already have an account? Sign in!', + toSignUp: 'signUp', // 'Don\'t have an account? Register', + toResendVerification_pre: 'resendVerificationEmailLink_pre', // 'Verification email lost? Resend' + toResendVerification_link: 'resendVerificationEmailLink_link', // 'Verification email lost? Resend' + }, + info: { + emailSent: 'info.emailSent', // 'An email has been sent to your inbox', + emailVerified: 'info.emailVerified', // 'Your email has been verified', + pwdChanged: 'info.passwordChanged', // 'Your password has been changed', + pwdReset: 'info.passwordReset', // 'A password reset link has been sent to your email!', + pwdSet: 'info.passwordChanged', // 'Password updated!', + signUpVerifyEmail: 'info.emailSent', // 'Successful Registration! Please check your email and follow the instructions', + verificationEmailSent: 'info.emailSent', // 'A new email has been sent to you. If the email doesn\'t show up in your inbox, be sure to check your spam folder.', + accountEnrolled: 'info.passwordChanged', // 'Your password has been set, you can now login', + }, + errors: { + loginForbidden: 'error.accounts.login_forbidden', // 'There was a problem with your login', + captchaVerification: 'error.accounts.user_validation_failed', // 'There was a problem with the recaptcha verification, please try again', + userNotFound: 'error.accounts.user_not_found', // 'User not found', + userAlreadyVerified: 'error.accounts.already_verified', // 'User already verified!' + }, + forgotPwdSubmitSuccess: 'info.emailSent', // 'A password reset link has been sent to your email!', + loginForbiddenMessage: 'error.accounts.login_forbidden', // 'There was a problem with your login' + }, + /* ----------------------------- Texts ----------------------------- */ + /* texts are empty be default because traanslations are used. */ + texts: { button: { - changePwd: 'Update New Password', - forgotPwd: 'Send Reset Link', - resetPwd: 'Save New Password', - signIn: 'Login', - signUp: 'Register', - resendVerification: 'Send Verification Link', - enrollAccount: 'Save Password', + changePwd: null, + forgotPwd: null, + resetPwd: null, + signIn: null, + signUp: null, + resendVerification: null, + enrollAccount: null, }, title: { - changePwd: 'Change Password', - forgotPwd: 'Forgot Password', - resetPwd: 'Reset Password', - signIn: 'Login', - signUp: 'Create Your Account', - resendVerification: 'Resend Verification Link', - enrollAccount: 'Set Your Account Password', + changePwd: null, + forgotPwd: null, + resetPwd: null, + signIn: null, + signUp: null, + resendVerification: null, + enrollAccount: null, }, links: { - toChangePwd: 'Change your password', - toResetPwd: 'Reset your password', - toForgotPwd: 'Forgot your password?', - toSignIn: 'Already have an account? Sign in!', - toSignUp: 'Don\'t have an account? Register', - toResendVerification: 'Verification email lost? Resend' + toChangePwd: null, + toResetPwd: null, + toForgotPwd: null, + toSignIn: null, + toSignUp: null, + toResendVerification: null, }, info: { - emailSent: 'An email has been sent to your inbox', - emailVerified: 'Your email has been verified', - pwdChanged: 'Your password has been changed', - pwdReset: 'A password reset link has been sent to your email!', - pwdSet: 'Password updated!', - signUpVerifyEmail: 'Successful Registration! Please check your email and follow the instructions', - verificationEmailSent: 'A new email has been sent to you. If the email doesn\'t show up in your inbox, be sure to check your spam folder.', - accountEnrolled: 'Your password has been set, you can now login', + emailSent: null, + emailVerified: null, + pwdChanged: null, + pwdReset: null, + pwdSet: null, + signUpVerifyEmail: null, + verificationEmailSent: null, + accountEnrolled: null, }, errors: { - loginForbidden: 'There was a problem with your login', - captchaVerification: 'There was a problem with the recaptcha verification, please try again', - userNotFound: 'User not found', - userAlreadyVerified: 'User already verified!' + loginForbidden: null, + captchaVerification: null, + userNotFound: null, + userAlreadyVerified: null, }, - forgotPwdSubmitSuccess: 'A password reset link has been sent to your email!', - loginForbiddenMessage: 'There was a problem with your login' + forgotPwdSubmitSuccess: null, + loginForbiddenMessage: null, }, showReCaptcha: false, @@ -324,6 +380,7 @@ class AccountsReact_ { this.overrideLoginErrors() this.disableMethods() this.setDenyRules() + if (Meteor.isClient) setLanguage(this.config.language) this._init = true } @@ -424,7 +481,7 @@ class AccountsReact_ { if (attempt.error) { var reason = attempt.error.reason if (reason === 'User not found' || reason === 'Incorrect password') { - throw new Meteor.Error('Login Forbidden', this.config.texts.errors.loginForbidden) // Throw generalized error for failed login attempts + throw new Meteor.Error('Login Forbidden', this.config.texts.errors.loginForbidden || T9n.get(this.config.translations.errors.loginForbidden)) // Throw generalized error for failed login attempts } } return attempt.allowed diff --git a/lib/AccountsReactComponent/baseForm.js b/lib/AccountsReactComponent/baseForm.js index 2a54e69..9b5bf61 100644 --- a/lib/AccountsReactComponent/baseForm.js +++ b/lib/AccountsReactComponent/baseForm.js @@ -2,6 +2,7 @@ import { Meteor } from 'meteor/meteor' import React, { Component } from 'react' import PropTypes from 'prop-types' +import { T9n } from 'meteor-accounts-t9n' import AccountsReact from '../AccountsReact' import { handleInputChange } from './commonUtils' @@ -38,6 +39,7 @@ class BaseForm extends Component { // Defaults const { + translations, texts, showReCaptcha, confirmPassword @@ -47,8 +49,8 @@ class BaseForm extends Component { const fields = confirmPassword ? _fields : _fields.filter(field => field._id !== 'confirmPassword') // texts - const title = texts.title[currentState] - const button = texts.button[currentState] + const title = texts.title[currentState] || T9n.get(translations.title[currentState]) + const button = texts.button[currentState] || T9n.get(translations.button[currentState]) // Components const { @@ -72,20 +74,24 @@ class BaseForm extends Component { {/* Fields */}
- {fields.map((f, i) => { + {fields.map((fld, i) => { let Field = InputField // Defaults to input - switch (f.type) { + switch (fld.type) { case 'select': Field = SelectField; break; case 'radio': Field = RadioField; break; } + const { displayName, placeholder, errStr, ...f } = fld; // extract translated props from field props const props = { key: i, values, defaults, onChange: this.handleInputChange, error: errors ? errors.find((errField) => errField._id === f._id) : [], + displayName: T9n.get(displayName), + placeholder: T9n.get(placeholder), + errStr: errStr ? T9n.get(errStr) : null, ...f } diff --git a/lib/AccountsReactComponent/changePwd.js b/lib/AccountsReactComponent/changePwd.js index fb4899d..6bb2cca 100644 --- a/lib/AccountsReactComponent/changePwd.js +++ b/lib/AccountsReactComponent/changePwd.js @@ -1,4 +1,5 @@ import React, { Component, Fragment } from 'react' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from './baseForm' import { validateForm } from '../utils/' import { getModel, redirect } from './commonUtils' @@ -30,6 +31,7 @@ class ChangePwd extends Component { } = this.props const { + translations, texts } = defaults @@ -52,7 +54,7 @@ class ChangePwd extends Component { errors={errors} /> - {passwordUpdated &&

{texts.info.pwdChanged}

} + {passwordUpdated &&

{texts.info.pwdChanged || T9n.get(translations.info.pwdChanged)}

} ) diff --git a/lib/AccountsReactComponent/enrollAccount.js b/lib/AccountsReactComponent/enrollAccount.js index c2de599..496b19a 100644 --- a/lib/AccountsReactComponent/enrollAccount.js +++ b/lib/AccountsReactComponent/enrollAccount.js @@ -1,4 +1,5 @@ import React, { Component, Fragment } from 'react' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from './baseForm' import { validateForm } from '../utils/' import { getModel, redirect } from './commonUtils' @@ -24,6 +25,7 @@ class EnrollAccount extends Component { } = this.props const { + translations, texts } = defaults @@ -46,7 +48,7 @@ class EnrollAccount extends Component { errors={errors} /> - {passwordSet &&

{texts.info.accountEnrolled}

} + {passwordSet &&

{texts.info.accountEnrolled || T9n.get(translations.info.accountEnrolled)}

} ) diff --git a/lib/AccountsReactComponent/forgotPwd.js b/lib/AccountsReactComponent/forgotPwd.js index 15aaa81..6cdfbad 100644 --- a/lib/AccountsReactComponent/forgotPwd.js +++ b/lib/AccountsReactComponent/forgotPwd.js @@ -1,4 +1,5 @@ import React, { Component, Fragment } from 'react' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from './baseForm' import { validateForm } from '../utils/' import { getModel, redirect } from './commonUtils' @@ -23,6 +24,7 @@ class ForgotPassword extends Component { } = this.props const { + translations, texts, hideSignInLink } = defaults @@ -46,11 +48,11 @@ class ForgotPassword extends Component { errors={errors} /> - {emailSent &&

{texts.forgotPwdSubmitSuccess}

} + {emailSent &&

{texts.forgotPwdSubmitSuccess || T9n.get(translations.forgotPwdSubmitSuccess)}

} {!hideSignInLink && (
- {texts.links.toSignIn} + {texts.links.toSignIn || T9n.get(translations.links.toSignIn)} )} diff --git a/lib/AccountsReactComponent/methods/ARCreateAccount.js b/lib/AccountsReactComponent/methods/ARCreateAccount.js index c7e66bf..d8da589 100644 --- a/lib/AccountsReactComponent/methods/ARCreateAccount.js +++ b/lib/AccountsReactComponent/methods/ARCreateAccount.js @@ -1,5 +1,6 @@ import { Accounts } from 'meteor/accounts-base' import { ValidatedMethod } from 'meteor/mdg:validated-method' +import { T9n } from 'meteor-accounts-t9n' import AccountsReact from '../../AccountsReact' import validateField from '../../utils/validateField' @@ -22,7 +23,7 @@ const ARCreateAccount = new ValidatedMethod({ // Check that recaptcha token is included if necessary if (AccountsReact.config.showReCaptcha && !profile.tempReCaptchaResponse) { - throw new Meteor.Error('ReCaptchaError', AccountsReact.config.texts.errors.captchaVerification) + throw new Meteor.Error('ReCaptchaError', AccountsReact.config.texts.errors.captchaVerification || T9n.get(AccountsReact.config.translations.errors.captchaVerification)) } const newUser = { @@ -77,7 +78,7 @@ const ARCreateAccount = new ValidatedMethod({ }).data if (!res.success) { - throw new Meteor.Error('ReCaptchaError', AccountsReact.config.texts.errors.captchaVerification) + throw new Meteor.Error('ReCaptchaError', AccountsReact.config.texts.errors.captchaVerification || T9n.get(AccountsReact.config.translations.errors.captchaVerification)) } delete userObject.profile.tempReCaptchaResponse diff --git a/lib/AccountsReactComponent/methods/ARResendVerificationEmail.js b/lib/AccountsReactComponent/methods/ARResendVerificationEmail.js index 86f01bf..af09929 100644 --- a/lib/AccountsReactComponent/methods/ARResendVerificationEmail.js +++ b/lib/AccountsReactComponent/methods/ARResendVerificationEmail.js @@ -1,5 +1,6 @@ import { Accounts } from 'meteor/accounts-base' import { ValidatedMethod } from 'meteor/mdg:validated-method' +import { T9n } from 'meteor-accounts-t9n' import { check } from 'meteor/check' import AccountsReact from '../../AccountsReact' @@ -21,7 +22,7 @@ const ARResendVerificationEmail = new ValidatedMethod({ // Send the standard error back to the client if no user exist with this e-mail if (!user) { - throw new Meteor.Error('UserNotFound', AccountsReact.config.texts.errors.userNotFound); + throw new Meteor.Error('UserNotFound', AccountsReact.config.texts.errors.userNotFound || T9n.get(AccountsReact.config.translations.errors.userNotFound)); } try { @@ -32,7 +33,7 @@ const ARResendVerificationEmail = new ValidatedMethod({ } else { // Handle error when email already verified // https://github.com/dwinston/send-verification-email-bug - throw new Meteor.Error('UserAlreadyVerified', AccountsReact.config.texts.errors.userAlreadyVerified); + throw new Meteor.Error('UserAlreadyVerified', AccountsReact.config.texts.errors.userAlreadyVerified || T9n.get(AccountsReact.config.translations.errors.userAlreadyVerified)); } } } diff --git a/lib/AccountsReactComponent/resendVerification.js b/lib/AccountsReactComponent/resendVerification.js index 39ef29e..b075a7e 100644 --- a/lib/AccountsReactComponent/resendVerification.js +++ b/lib/AccountsReactComponent/resendVerification.js @@ -1,4 +1,5 @@ import React, { Component, Fragment } from 'react' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from './baseForm' import { validateForm } from '../utils/' import { getModel, redirect } from './commonUtils' @@ -23,6 +24,7 @@ class ResendVerification extends Component { } = this.props const { + translations, texts, hideSignInLink } = defaults @@ -46,11 +48,11 @@ class ResendVerification extends Component { errors={errors} /> - {emailSent &&

{texts.info.emailSent}

} + {emailSent &&

{texts.info.emailSent || T9n.get(translations.info.emailSent)}

} {!hideSignInLink && ( - {texts.links.toSignIn} + {texts.links.toSignIn || T9n.get(translations.links.toSignIn)} )} diff --git a/lib/AccountsReactComponent/resetPwd.js b/lib/AccountsReactComponent/resetPwd.js index 86ee42b..afb82bd 100644 --- a/lib/AccountsReactComponent/resetPwd.js +++ b/lib/AccountsReactComponent/resetPwd.js @@ -1,4 +1,5 @@ import React, { Component, Fragment } from 'react' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from './baseForm' import { validateForm } from '../utils/' import { getModel, redirect } from './commonUtils' @@ -23,6 +24,7 @@ class ResetPwd extends Component { } = this.props const { + translations, texts } = defaults @@ -45,7 +47,7 @@ class ResetPwd extends Component { errors={errors} /> - {passwordUpdated &&

{texts.info.pwdSet}

} + {passwordUpdated &&

{texts.info.pwdSet || T9n.get(translations.info.pwdSet)}

} ) diff --git a/lib/AccountsReactComponent/signIn.js b/lib/AccountsReactComponent/signIn.js index 6bd2663..b02c655 100644 --- a/lib/AccountsReactComponent/signIn.js +++ b/lib/AccountsReactComponent/signIn.js @@ -1,4 +1,5 @@ import React, { Component, Fragment } from 'react' +import { T9n } from 'meteor-accounts-t9n' import BaseForm from './baseForm' import { validateForm } from '../utils' import { getModel, redirect } from './commonUtils' @@ -23,6 +24,7 @@ class SignIn extends Component { } = this.props const { + translations, texts, hideSignUpLink, showForgotPasswordLink, @@ -53,17 +55,17 @@ class SignIn extends Component { {!forbidClientAccountCreation && !hideSignUpLink && ( - {texts.links.toSignUp} + {texts.links.toSignUp || T9n.get(translations.links.toSignIn)} )} {!disableForgotPassword && showForgotPasswordLink && ( - {texts.links.toForgotPwd} + {texts.links.toForgotPwd || T9n.get(translations.links.toForgotPwd)} )} {sendVerificationEmail && showResendVerificationLink && ( - {texts.links.toResendVerification} + {texts.links.toResendVerification || `${T9n.get(translations.links.toResendVerification_pre)} ${T9n.get(translations.links.toResendVerification_link)}`} )} diff --git a/lib/AccountsReactComponent/signUp.js b/lib/AccountsReactComponent/signUp.js index a84aef9..bebbc53 100644 --- a/lib/AccountsReactComponent/signUp.js +++ b/lib/AccountsReactComponent/signUp.js @@ -1,5 +1,6 @@ import React, { Component, Fragment } from 'react' import { Accounts } from 'meteor/accounts-base' +import { T9n } from 'meteor-accounts-t9n' import AccountsReact from '../AccountsReact' import BaseForm from './baseForm' import { validateForm } from '../utils' @@ -25,6 +26,7 @@ class SignUp extends Component { } = this.props const { + translations, texts, hideSignInLink, showReCaptcha, @@ -47,11 +49,11 @@ class SignUp extends Component { showReCaptcha={showReCaptcha} /> - {signUpSuccessful && sendVerificationEmail &&

{texts.info.signUpVerifyEmail}

} + {signUpSuccessful && sendVerificationEmail &&

{texts.info.signUpVerifyEmail || T9n.get(translations.info.signUpVerifyEmail)}

} {!hideSignInLink && ( - {texts.links.toSignIn} + {texts.links.toSignIn || T9n.get(translations.links.toSignIn)} )} diff --git a/lib/t9n.js b/lib/t9n.js new file mode 100644 index 0000000..bd6182d --- /dev/null +++ b/lib/t9n.js @@ -0,0 +1,48 @@ +import { T9n } from 'meteor-accounts-t9n' +import 'meteor-accounts-t9n/build/ar'; +import 'meteor-accounts-t9n/build/ca'; +import 'meteor-accounts-t9n/build/cs'; +import 'meteor-accounts-t9n/build/da'; +import 'meteor-accounts-t9n/build/de'; +import 'meteor-accounts-t9n/build/el'; +import 'meteor-accounts-t9n/build/en'; +import 'meteor-accounts-t9n/build/es'; +import 'meteor-accounts-t9n/build/es_ES'; +import 'meteor-accounts-t9n/build/es_ES_formal'; +import 'meteor-accounts-t9n/build/es_formal'; +import 'meteor-accounts-t9n/build/et'; +import 'meteor-accounts-t9n/build/fa'; +import 'meteor-accounts-t9n/build/fi'; +import 'meteor-accounts-t9n/build/fr'; +import 'meteor-accounts-t9n/build/fr_CA'; +import 'meteor-accounts-t9n/build/he'; +import 'meteor-accounts-t9n/build/hr'; +import 'meteor-accounts-t9n/build/hu'; +import 'meteor-accounts-t9n/build/id'; +import 'meteor-accounts-t9n/build/it'; +import 'meteor-accounts-t9n/build/ja'; +import 'meteor-accounts-t9n/build/kh'; +import 'meteor-accounts-t9n/build/ko'; +import 'meteor-accounts-t9n/build/nl'; +import 'meteor-accounts-t9n/build/no_NB'; +import 'meteor-accounts-t9n/build/pl'; +import 'meteor-accounts-t9n/build/pt'; +import 'meteor-accounts-t9n/build/pt_PT'; +import 'meteor-accounts-t9n/build/ro'; +import 'meteor-accounts-t9n/build/ru'; +import 'meteor-accounts-t9n/build/sk'; +import 'meteor-accounts-t9n/build/sl'; +import 'meteor-accounts-t9n/build/sv'; +import 'meteor-accounts-t9n/build/th'; +import 'meteor-accounts-t9n/build/uk'; +import 'meteor-accounts-t9n/build/vi'; +import 'meteor-accounts-t9n/build/zh_CN'; +import 'meteor-accounts-t9n/build/zh_HK'; +import 'meteor-accounts-t9n/build/zh_TW'; + +const supportedLanguages = ['ar', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'es_ES', 'es_ES_formal', 'es_formal', 'et', 'fa', 'fi', 'fr', 'fr_CA', 'he', 'hr', 'hu', 'id', 'it', 'ja', 'kh', 'ko', 'nl', 'no_NB', 'pl', 'pt', 'pt_PT', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'uk', 'vi', 'zh_CN', 'zh_HK', 'zh_TW']; + +export const setLanguage = (language) => { + if (language && supportedLanguages.includes(language)) T9n.setLanguage(language); + else console.error(`language ${language} is not among supported languages.`); +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index f905ab7..5ca878f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1196,7 +1196,6 @@ "anymatch": "2.0.0", "async-each": "1.0.1", "braces": "2.3.1", - "fsevents": "1.1.3", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -1687,910 +1686,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.10.0", - "node-pre-gyp": "0.6.39" - }, - "dependencies": { - "abbrev": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.2.9" - } - }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "balanced-match": { - "version": "0.4.2", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "debug": { - "version": "2.6.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.1.1", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.2" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.4", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "node-pre-gyp": { - "version": "0.6.39", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", - "mkdirp": "0.5.1", - "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" - } - }, - "npmlog": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.4", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" - } - }, - "rimraf": { - "version": "2.6.1", - "bundled": true, - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "safe-buffer": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "semver": { - "version": "5.3.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" - } - }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -3278,6 +2373,11 @@ "object-visit": "1.0.1" } }, + "meteor-accounts-t9n": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/meteor-accounts-t9n/-/meteor-accounts-t9n-2.3.1.tgz", + "integrity": "sha512-uMu6ovPnk2eLWGBoboqh1O0Qzy5GKuBXJKCWTfdJtLRy3l9HxkxVJWNBeCBtYhULIEQ4TXmvDeo75dOpuLmZuQ==" + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -3341,13 +2441,6 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, - "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", diff --git a/package.json b/package.json index 7d519c9..21a4eac 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "license": "MIT", "dependencies": { "babel-runtime": "^6.26.0", - "deepmerge": "^2.1.0" + "deepmerge": "^2.1.0", + "meteor-accounts-t9n": "^2.3.1" }, "devDependencies": { "chai": "^4.1.2",