Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

destructure Ember.I18n each time render is called #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions addon/messages.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import Ember from 'ember';

const { I18n } = Ember;

export default {
render(attribute, context) {
if (I18n) {
return I18n.t(`errors.${attribute}`, context);
// ember-i18n users may override this at runtime.
// jscs:disable disallowDirectPropertyAccess
if (Ember.I18n) {
return Ember.I18n.t(`errors.${attribute}`, context);
} else {
let regex = new RegExp('{{(.*?)}}');
let attributeName = '';
Expand Down