Skip to content

Commit

Permalink
messages tuneup
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismllr committed Jun 15, 2020
1 parent 4f6d03b commit 741e350
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions addon/validators/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ export default class ValidationMessages extends DIProvider {
}

getDescription(context) {
if (this.intl) {
return this.intl.exists(`${this.prefix}${context.descriptionKey}`) &&
this.intl.t(`${this.prefix}${context.descriptionKey}`);
const descKey = `${this.prefix}${context.descriptionKey}`;

if (this.intl && this.intl.exists(descKey)) {
return this.intl.t(descKey);
}

return context.description || ValidatorsMessages.defaultDescription;
Expand Down

0 comments on commit 741e350

Please sign in to comment.