-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: return actual translation strings in default metadata [v33] (#976)
Part of fix for https://jira.dhis2.org/browse/DHIS2-8638 The metadata is used for default period setting. Also, remove the noData option, as Analytics now sets a default translated string.
- Loading branch information
1 parent
85d1222
commit 461a56f
Showing
6 changed files
with
53 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
import i18n from '@dhis2/d2-i18n'; | ||
|
||
export const relativePeriods = { | ||
TODAY: i18n.t('Today'), | ||
YESTERDAY: i18n.t('Yesterday'), | ||
LAST_3_DAYS: i18n.t('Last 3 days'), | ||
LAST_7_DAYS: i18n.t('Last 7 days'), | ||
LAST_14_DAYS: i18n.t('Last 14 days'), | ||
THIS_WEEK: i18n.t('This week'), | ||
LAST_WEEK: i18n.t('Last week'), | ||
LAST_4_WEEKS: i18n.t('Last 4 weeks'), | ||
LAST_12_WEEKS: i18n.t('Last 12 weeks'), | ||
LAST_52_WEEKS: i18n.t('Last 52 weeks'), | ||
WEEKS_THIS_YEAR: i18n.t('Weeks this year'), | ||
THIS_MONTH: i18n.t('This month'), | ||
LAST_MONTH: i18n.t('Last month'), | ||
LAST_3_MONTHS: i18n.t('Last 3 months'), | ||
LAST_6_MONTHS: i18n.t('Last 6 months'), | ||
LAST_12_MONTHS: i18n.t('Last 12 months'), | ||
MONTHS_THIS_YEAR: i18n.t('Months this year'), | ||
THIS_BIMONTH: i18n.t('This bimonth'), | ||
LAST_BIMONTH: i18n.t('Last bimonth'), | ||
LAST_6_BIMONTHS: i18n.t('Last 6 bimonths'), | ||
BIMONTHS_THIS_YEAR: i18n.t('Bimonths this year'), | ||
THIS_QUARTER: i18n.t('This quarter'), | ||
LAST_QUARTER: i18n.t('Last quarter'), | ||
LAST_4_QUARTERS: i18n.t('Last 4 quarters'), | ||
QUARTERS_THIS_YEAR: i18n.t('Quarters this year'), | ||
THIS_SIX_MONTH: i18n.t('This six-month'), | ||
LAST_SIX_MONTH: i18n.t('Last six-month'), | ||
LAST_2_SIXMONTHS: i18n.t('Last 2 six-months'), | ||
THIS_FINANCIAL_YEAR: i18n.t('This financial year'), | ||
LAST_FINANCIAL_YEAR: i18n.t('Last financial year'), | ||
LAST_5_FINANCIAL_YEARS: i18n.t('Last 5 financial years'), | ||
THIS_YEAR: i18n.t('This year'), | ||
LAST_YEAR: i18n.t('Last year'), | ||
LAST_5_YEARS: i18n.t('Last 5 years'), | ||
const relativePeriods = { | ||
TODAY: () => i18n.t('Today'), | ||
YESTERDAY: () => i18n.t('Yesterday'), | ||
LAST_3_DAYS: () => i18n.t('Last 3 days'), | ||
LAST_7_DAYS: () => i18n.t('Last 7 days'), | ||
LAST_14_DAYS: () => i18n.t('Last 14 days'), | ||
THIS_WEEK: () => i18n.t('This week'), | ||
LAST_WEEK: () => i18n.t('Last week'), | ||
LAST_4_WEEKS: () => i18n.t('Last 4 weeks'), | ||
LAST_12_WEEKS: () => i18n.t('Last 12 weeks'), | ||
LAST_52_WEEKS: () => i18n.t('Last 52 weeks'), | ||
WEEKS_THIS_YEAR: () => i18n.t('Weeks this year'), | ||
THIS_MONTH: () => i18n.t('This month'), | ||
LAST_MONTH: () => i18n.t('Last month'), | ||
LAST_3_MONTHS: () => i18n.t('Last 3 months'), | ||
LAST_6_MONTHS: () => i18n.t('Last 6 months'), | ||
LAST_12_MONTHS: () => i18n.t('Last 12 months'), | ||
MONTHS_THIS_YEAR: () => i18n.t('Months this year'), | ||
THIS_BIMONTH: () => i18n.t('This bimonth'), | ||
LAST_BIMONTH: () => i18n.t('Last bimonth'), | ||
LAST_6_BIMONTHS: () => i18n.t('Last 6 bimonths'), | ||
BIMONTHS_THIS_YEAR: () => i18n.t('Bimonths this year'), | ||
THIS_QUARTER: () => i18n.t('This quarter'), | ||
LAST_QUARTER: () => i18n.t('Last quarter'), | ||
LAST_4_QUARTERS: () => i18n.t('Last 4 quarters'), | ||
QUARTERS_THIS_YEAR: () => i18n.t('Quarters this year'), | ||
THIS_SIX_MONTH: () => i18n.t('This six-month'), | ||
LAST_SIX_MONTH: () => i18n.t('Last six-month'), | ||
LAST_2_SIXMONTHS: () => i18n.t('Last 2 six-months'), | ||
THIS_FINANCIAL_YEAR: () => i18n.t('This financial year'), | ||
LAST_FINANCIAL_YEAR: () => i18n.t('Last financial year'), | ||
LAST_5_FINANCIAL_YEARS: () => i18n.t('Last 5 financial years'), | ||
THIS_YEAR: () => i18n.t('This year'), | ||
LAST_YEAR: () => i18n.t('Last year'), | ||
LAST_5_YEARS: () => i18n.t('Last 5 years'), | ||
}; | ||
|
||
// return {name: <string>} as value | ||
export default (function() { | ||
return Object.entries({ | ||
...relativePeriods, | ||
}).reduce((obj, [key, value]) => ({ ...obj, [key]: { name: value } }), {}); | ||
})(); | ||
const organisationUnits = { | ||
USER_ORGUNIT: () => i18n.t('User org unit'), | ||
USER_ORGUNIT_CHILDREN: () => i18n.t('User org unit children'), | ||
USER_ORGUNIT_GRANDCHILDREN: () => i18n.t('User org unit grand children'), | ||
}; | ||
|
||
export default Object.assign({}, relativePeriods, organisationUnits); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters