-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: support "week", "bi-week" and months in period translations #3269
Conversation
🚀 Deployed on https://pr-3269--dhis2-maps.netlify.app |
@@ -27,6 +27,15 @@ export const appQueries = { | |||
key: SYSTEM_SETTINGS, | |||
}, | |||
}, | |||
systemInfo: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can get the systemInfo using the useConfig hook - this would make use of the settings already in the provider rather than making an extra API call.
import { useConfig } from '@dhis2/app-runtime'
const { systemInfo } = useConfig()
const { calendar = 'gregory' } = systemInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point.
I find it a bit more intuitive to have both requests comming from the same place (calendar + locale).
Down the road we are going to implement the standard periods selector so this will have to change.
Unless you think it is definitely better to make this change now, I would argue in favor of keeping the current version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - just the one comment/suggestion
## [100.5.6](v100.5.5...v100.5.6) (2024-06-26) ### Bug Fixes * support "week", "bi-week" and months in period translations ([#3269](#3269)) ([977e075](977e075))
🎉 This PR is included in version 100.5.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Part of the fix for DHIS2-16904
Requires dhis2/analytics#1685
Key features
getFixedPeriodsOptionsById
Description
The actual fix is in @dhis2/multi-calendar-dates which is a dependency of analytics and it's used in the PeriodSelector component the analytics apps use.
See also the PR in analytics.
For maps-app, the locale and calendar specs where not passed to the @dhis2/analytics utility function, so this was implemented as well.
Note: this has not been implemented for selectors limited to years.
Screenshots
Translations don't work for week/bi-week:
-After:
Translations don't work for months: