0

#/mapping/date.js

import { translationMacro as t } from "ember-i18n"; 
export default {
  i18n: Ember.inject.service(),
  DateFilter: {
    today: "Today",
    yesterday: "Yesterday",
    thisWeek: "This Week",
    lastWeek: "Last Week",
    thisMonth: "This Month",
    lastMonth: "Last Month",
    none: "None"
  }

I have tried using helper as {{t "Today"}}, macros as(t "Today") and service injection as this.get('i18n').t('Today').toString(), where 'Today' is a key, but none of them are working. Also, how to translate strings in .scss file? For example 'Open file' in below code.

&::after{
            position: absolute;
            content: 'Open file';
            font-size: 12px;
            color: $secondary-button;
            bottom: 16px;
            left: 16px;
        } 
anshika24
  • 1
  • 2

1 Answers1

0

Unless you specify "Today" as one of the keys in your-locale/translation.js, this will not work.

I guess you might want to use the property instead of a hard-coded string in the {{t}} helper. Use {{t DateFilter.today}}. DateFilter.today is a controller property that will return the string 'today'