import { computed, get, defineProperty } from '@ember/object';
import { getOwner } from '@ember/application';

export const __intlInjectionName = `intl-${Date.now().toString(36)}`;

export default function intl(...dependentKeysAndGetterFn) {
  const getterFn = dependentKeysAndGetterFn.pop();
  const dependentKeys = dependentKeysAndGetterFn;

  return computed(function(propertyKey) {
    if (!get(this, __intlInjectionName)) {
      defineProperty(this, __intlInjectionName, {
        value: getOwner(this).lookup('service:intl'),
        enumerable: false
      });
    }
    const intl = get(this, __intlInjectionName);
    return getterFn.call(this, intl, propertyKey, this);
  })
    .readOnly()
    .property(`${__intlInjectionName}.locale`, ...dependentKeys);
}

@@ -355,16 +355,67 @@
 omputed(
+%60$%7B__intlInjectionName%7D.locale%60, ...dependentKeys, 
 function
@@ -729,21 +729,16 @@
 s);%0A  %7D)
-%0A    
 .readOnl
@@ -744,73 +744,8 @@
 ly()
-%0A    .property(%60$%7B__intlInjectionName%7D.locale%60, ...dependentKeys)
 ;%0A%7D%0A

fix `.property()` deprecation