diff --git a/src/components/settings/sources.tsx b/src/components/settings/sources.tsx index ac60248..e57de24 100644 --- a/src/components/settings/sources.tsx +++ b/src/components/settings/sources.tsx @@ -77,14 +77,14 @@ class SourcesTab extends React.Component { fetchFrequencyOptions = (): IDropdownOption[] => [ { key: "0", text: intl.get("sources.unlimited") }, - { key: "15", text: intl.get("time.m", { m: 15 }) }, - { key: "30", text: intl.get("time.m", { m: 30 }) }, - { key: "60", text: intl.get("time.h", { h: 1 }) }, - { key: "120", text: intl.get("time.h", { h: 2 }) }, - { key: "180", text: intl.get("time.h", { h: 3 }) }, - { key: "360", text: intl.get("time.h", { h: 6 }) }, - { key: "720", text: intl.get("time.h", { h: 12 }) }, - { key: "1440", text: intl.get("time.d", { d: 1 }) } + { key: "15", text: intl.get("time.minute", { m: 15 }) }, + { key: "30", text: intl.get("time.minute", { m: 30 }) }, + { key: "60", text: intl.get("time.hour", { h: 1 }) }, + { key: "120", text: intl.get("time.hour", { h: 2 }) }, + { key: "180", text: intl.get("time.hour", { h: 3 }) }, + { key: "360", text: intl.get("time.hour", { h: 6 }) }, + { key: "720", text: intl.get("time.hour", { h: 12 }) }, + { key: "1440", text: intl.get("time.day", { d: 1 }) } ] onFetchFrequencyChange = (_, option: IDropdownOption) => { diff --git a/src/components/utils/time.tsx b/src/components/utils/time.tsx index 6d59d2c..01e53a4 100644 --- a/src/components/utils/time.tsx +++ b/src/components/utils/time.tsx @@ -1,4 +1,5 @@ import * as React from "react" +import intl = require("react-intl-universal") interface TimeProps { date: Date @@ -26,10 +27,10 @@ class Time extends React.Component { displayTime(past: Date, now: Date): string { // difference in seconds let diff = (now.getTime() - past.getTime()) / 60000 - if (diff < 1) return "now" - else if (diff < 60) return Math.floor(diff) + "m" - else if (diff < 1440) return Math.floor(diff / 60) + "h" - else return Math.floor(diff / 1440) + "d" + if (diff < 1) return intl.get("time.now") + else if (diff < 60) return Math.floor(diff) + intl.get("time.m") + else if (diff < 1440) return Math.floor(diff / 60) + intl.get("time.h") + else return Math.floor(diff / 1440) + intl.get("time.d") } render() { diff --git a/src/scripts/i18n/en-US.json b/src/scripts/i18n/en-US.json index c4ab21d..680a0ef 100644 --- a/src/scripts/i18n/en-US.json +++ b/src/scripts/i18n/en-US.json @@ -16,9 +16,13 @@ "confirm": "Confirm", "cancel": "Cancel", "time": { - "m": "{m, plural, =1 {# minute} other {# minutes}}", - "h": "{h, plural, =1 {# hour} other {# hours}}", - "d": "{d, plural, =1 {# day} other {# days}}" + "now": "now", + "m": "m", + "h": "h", + "d": "d", + "minute": "{m, plural, =1 {# minute} other {# minutes}}", + "hour": "{h, plural, =1 {# hour} other {# hours}}", + "day": "{d, plural, =1 {# day} other {# days}}" }, "log": { "empty": "No notifications", diff --git a/src/scripts/i18n/fr-FR.json b/src/scripts/i18n/fr-FR.json index 1c5cb20..33be189 100644 --- a/src/scripts/i18n/fr-FR.json +++ b/src/scripts/i18n/fr-FR.json @@ -16,9 +16,13 @@ "confirm": "Confirmer", "cancel": "Annuler", "time": { - "m": "{m, plural, =1 {# minute} other {# minutes}}", - "h": "{h, plural, =1 {# heure} other {# heures}}", - "d": "{d, plural, =1 {# jour} other {# jours}}" + "now": "maintenant", + "m": "m", + "h": "h", + "d": "j", + "minute": "{m, plural, =1 {# minute} other {# minutes}}", + "hour": "{h, plural, =1 {# heure} other {# heures}}", + "day": "{d, plural, =1 {# jour} other {# jours}}" }, "log": { "empty": "Aucune notification", diff --git a/src/scripts/i18n/zh-CN.json b/src/scripts/i18n/zh-CN.json index 7ab0844..0869624 100644 --- a/src/scripts/i18n/zh-CN.json +++ b/src/scripts/i18n/zh-CN.json @@ -16,9 +16,13 @@ "confirm": "确认", "cancel": "取消", "time": { - "m": "{m}分钟", - "h": "{h}小时", - "d": "{d}天" + "now": "now", + "m": "m", + "h": "h", + "d": "d", + "minute": "{m}分钟", + "hour": "{h}小时", + "day": "{d}天" }, "log": { "empty": "无消息",