import Service from 'ember-service';
import Ember from "ember";

const { inject } = Ember;
const EXPERIMENT_NAME = "CSGO_LANGUAGE_SAMPLE";

export default Service.extend({
  experiments: inject.service(),
  isEnabled: false,

  checkExperiment() {
    let experiments = this.get('experiments');

    return experiments.getExperimentValue(EXPERIMENT_NAME).then(value => {
      if (this.isDestroyed) { return; }

      this.set('isEnabled', value === 'localized');
    });
  }
});
