Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate / Change "Login Forbidden" #301

Closed
Sivli-Embir opened this issue Mar 3, 2015 · 3 comments
Closed

Translate / Change "Login Forbidden" #301

Sivli-Embir opened this issue Mar 3, 2015 · 3 comments

Comments

@Sivli-Embir
Copy link

Apologies if this has been solved already but is there any way to change the "login forbidden" error message? We need it to be more descriptive and available in multiple languages.

See:

throw new Meteor.Error(403, "Login forbidden");

@splendido
Copy link
Member

Hello there!

Yep, simply change the mapping on accounts-t9n! ;-)

lets have a look at this comment

@splendido
Copy link
Member

Btw, I appreciate this should be another error text to be possibly configured!

@splendido
Copy link
Member

Ok, done! See c963bbb

Now you can choose whether to change T9n values associated to error.accounts.Login forbidden of to configure a new text with

AccountsTemplates.configure({
  texts: {
    errors: {
      loginForbidden: "error.accounts.myDescriptiveError"
    }
  }
});

and then provide translations for other languages with:

var myDescriptiveError = {
  en: 'EN text',
  es: 'ES text',
  it: 'IT text',
};
_.each(myDescriptiveError, function(value, key){
  T9n.map(key, {'error.accounts.myDescriptiveError': value});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants