Repository navigation
feat: support for v44 custom labels and translations (DHIS2-21717) - #1874
Draft
janhenrikoverland wants to merge 4 commits into
Draft
janhenrikoverland wants to merge 4 commits into
janhenrikoverland wants to merge 4 commits into
Conversation
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Implements DHIS2-21717
Description
Version toggling for this featre has become so complex that I decided to split things into versioned files. The idea is that when a version goes out of support we can just delete the file instead of trying to remove 42 specific behaviour from a file where all versions are mixed up.
Quick overview:
42: The server has no API for enabled period types, so all period types and relative periods come from the hardcoded client lists.
43: Fetches the enabled period types from /configuration/dataOutputPeriodTypes and filters the client lists against them. Each period type has a single label, and the client builds the relative period names from it ("This {label}", "Last {label}" etc). Works, but not ideal, as it will look non-native in most other languages than English.
44: The server returns the enabled period types with their relative periods nested, and each has a displayName that's already translated for the user's locale. The client no longer builds any names. It only maps server period types to client ids so it can generate the fixed periods. The weekly and financial year relative periods are taken from the variant set in the system settings.
TODO
Screenshots
supporting text