-
Notifications
You must be signed in to change notification settings - Fork 7
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: translation strings (DHIS2-10630) #199
Conversation
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.
Since this app is still relying on, and has a working implementation of, the legacy i18n system, I think we should make sure these strings are fixed too. So I don't think anything needs to be removed from this PR.
I do think that we may have missed a few strings, for example this seems to result in hardcoded strings:
app-management-app/src/actions.js
Lines 11 to 24 in 67bd72c
const actions = { | |
// App management actions | |
installApp: Action.create('Install App'), | |
uninstallApp: Action.create('Uninstall App'), | |
refreshApps: Action.create('Refresh Apps'), | |
appInstalled: Action.create('An app was installed'), | |
// App store actions | |
loadAppHub: Action.create('Load DHIS2 App Hub'), | |
installAppVersion: Action.create('Install App Version from DHIS2 App Hub'), | |
// Snackbar | |
showSnackbarMessage: Action.create('Show Snackbar message'), | |
} |
I know it is possible to apply i18n to these Actions
. At first glance it seems you could wrap the action name in i18n.t()
, like so:
installApp: Action.create(i18n.t('Install App')),
If this is not providing the expected results, I think you could check either the user-app or the maintenance app to see how they've implemented things.
And quite likely this is ending up as hardcoded text in the UI too:
const appManagementAppName = 'App Management' |
I'm not sure we want to translate the app-name, but if we do, this needs to be wrapped in a call to i18n.t()
Ah thanks @HendrikThePendric, I wasn't aware of those :) I'll fix those up too |
Added translations for those actions. It looks like 'appManagementAppName' is used to find the app on the app hub, and is never displayed, so it doesn't need a translation 👍 app-management-app/src/components/SelfUpdateNoticeBox.component.js Lines 37 to 41 in 67bd72c
|
77965ee
to
24e921e
Compare
## [28.2.6](v28.2.5...v28.2.6) (2021-04-01) ### Bug Fixes * translate headers, menu actions, searchbar, and 'missing' messages ([#199](#199)) ([bc58ad2](bc58ad2))
🎉 This PR is included in version 28.2.6 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Relates to https://jira.dhis2.org/browse/DHIS2-10630 and https://jira.dhis2.org/browse/DHIS2-10664, I believe
Adds translation strings for page headers and 'no apps installed' messages
Controversial: adds legacy i18n to translate '** search **' in the search bar from d2-ui Sidebar (see the second commit). If this one string isn't worth the legacy i18n, especially since Médi is working on the overhaul of this app, I can remove it :)