Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations Cleanups #1121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions www/js/diary/diaryHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// these functions are being gradually migrated out of services.js

import moment from 'moment';
import i18next from 'i18next';
import { DateTime } from 'luxon';
import { LabelOptions, readableLabelToKey } from '../survey/multilabel/confirmHelper';
import { CompositeTrip } from '../types/diaryTypes';
Expand Down Expand Up @@ -118,6 +119,7 @@ export function getFormattedDate(beginFmtTime: string, endFmtTime?: string) {
// We use ddd LL to get Wed, May 3, 2023 or equivalent
// LL only has the date, month and year
// LLLL has the day of the week, but also the time
t.locale(i18next.language);
return t.format('ddd LL');
}

Expand Down
5 changes: 3 additions & 2 deletions www/js/metrics/WeeklyActiveMinutesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ const WeeklyActiveMinutesCard = ({ userMetrics }: Props) => {
ACTIVE_MODES.forEach((mode) => {
const prevSum = prevWeek?.reduce((acc, day) => acc + (day[`label_${mode}`] || 0), 0);
if (prevSum) {
const xLabel = `Previous Week\n(${formatDateRangeOfDays(prevWeek)})`; // TODO: i18n
// `${t('main-metrics.prev-week')}\n(${formatDateRangeOfDays(lastWeekDistance)})`
const xLabel = `${t('main-metrics.prev-week')}\n(${formatDateRangeOfDays(prevWeek)})`;
records.push({ label: labelKeyToRichMode(mode), x: xLabel, y: prevSum / 60 });
}
const recentSum = recentWeek?.reduce((acc, day) => acc + (day[`label_${mode}`] || 0), 0);
if (recentSum) {
const xLabel = `Past Week\n(${formatDateRangeOfDays(recentWeek)})`; // TODO: i18n
const xLabel = `${t('main-metrics.past-week')}\n(${formatDateRangeOfDays(recentWeek)})`;
records.push({ label: labelKeyToRichMode(mode), x: xLabel, y: recentSum / 60 });
}
});
Expand Down
Loading