Skip to content

Commit

Permalink
wrong variable reference
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismllr committed Jun 15, 2020
1 parent e40a4fb commit b4a55c3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions addon/validators/messages.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import EmberObject from '@ember/object';
import { inject as service } from '@ember/service';
import { warn } from '@ember/debug';
import ValidatorsMessages from 'ember-validators/messages';
Expand Down Expand Up @@ -32,7 +31,7 @@ export default class ValidationMessages extends DIProvider {

getMessageFor(type, context) {
const { prefix } = this;
const intlKey = context.intlKey || type;
const messageKey = context.intlKey || type;

context.description = this.getDescription(context);

Expand All @@ -42,8 +41,8 @@ export default class ValidationMessages extends DIProvider {
}

// Otherwise, look it up in intl
if (this.intl.exists(key)) {
return this.intl.t(`${prefix}.${intlKey}`, context);
if (this.intl.exists(messageKey)) {
return this.intl.t(`${prefix}.${messageKey}`, context);
}

warn(
Expand Down

0 comments on commit b4a55c3

Please sign in to comment.