-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: complete translations [v34] (#1014)
Includes: * Switch to using functions to return the result of i18n.t. * upgrade d2-ui dependencies to versions with translations * yarn.lock was regenerated * In plugin, the option for noData was removed since analytics now sets the default noData option to be "No data".
- Loading branch information
1 parent
8d93264
commit 9f087a3
Showing
24 changed files
with
3,054 additions
and
3,545 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
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
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,52 +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'), | ||
} | ||
|
||
export 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'), | ||
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'), | ||
} | ||
|
||
// return {name: <string>} as value | ||
export default (function() { | ||
return Object.entries({ | ||
...relativePeriods, | ||
...organisationUnits, | ||
}).reduce((obj, [key, value]) => ({ ...obj, [key]: { name: value } }), {}) | ||
})() | ||
export default Object.assign({}, relativePeriods, organisationUnits) |
Oops, something went wrong.