#/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"
}
我尝试使用帮助器作为 {{t "Today"}},宏作为(t "Today") 和服务注入作为 this.get('i18n').t('Today').toString(),其中 'Today ' 是一个键,但它们都不起作用。另外,如何翻译 .scss 文件中的字符串?例如下面代码中的“打开文件”。
&::after{
position: absolute;
content: 'Open file';
font-size: 12px;
color: $secondary-button;
bottom: 16px;
left: 16px;
}