-
Notifications
You must be signed in to change notification settings - Fork 22
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(translations): [DHIS2-8998] missing translation #1642
Conversation
* fix(translations): missing translation * fix(translations): no string * fix(translations): [DHIS2-8998] transalte more strings (cherry picked from commit 70b103e)
* fix(translations): missing translation * fix(translations): no string * fix(translations): [DHIS2-8998] transalte more strings * fix(translations): [DHIS2-8998] transalte more strings (cherry picked from commit b92350c)
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.
Hey @simonadomnisoru, looks good overall, but a couple of comments. I'm really sorry for making the comments in a back port!
As always, please reach out if anything is unclear and we can discuss.
@@ -149,7 +149,7 @@ const Index = ({ | |||
<Paper className={classes.paper}> | |||
<div className={classes.maxWidth}> | |||
<div className={classes.title} > | |||
Search for {titleText} | |||
{i18n.t('Search for ')} {titleText} |
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'm sorry for mentioning this in a back port, but we generally try to avoid splitting translatable strings into different parts. The reason being that the sentence structure could be different in an another language (I'm definitely no language expert, but I think this link highlights the idea: https://www.babbel.com/en/magazine/foreign-language-sentence-structure/).
Maybe you could add a second param to the useScopeTitleText
declaration and concatenate this with the rest in the i18n function?
There are a couple of more places where useScopeTitleText
is used, so probably need to update those too 🙂
If this doesn't make sense, please reach out and we can discuss.
@@ -7,7 +8,8 @@ export const useScopeTitleText = (scopeId: ?string) => { | |||
|
|||
const text = { | |||
[scopeTypes.EVENT_PROGRAM]: `${programName}`, | |||
[scopeTypes.TRACKER_PROGRAM]: `${trackedEntityName} in program: ${programName}`, | |||
[scopeTypes.TRACKER_PROGRAM]: | |||
`${i18n.t('{{trackedEntityName}} in program', { trackedEntityName })}: ${programName}`, |
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.
For the same reason as mentioned in the other comment I would change this to:
`${i18n.t('{{trackedEntityName}} in program', { trackedEntityName })}: ${programName}`, | |
i18n.t('{{trackedEntityName}} in program: {{programName}}', { trackedEntityName, programName }), |
const text = { | ||
[scopeTypes.EVENT_PROGRAM]: `${programName}`, | ||
[scopeTypes.TRACKER_PROGRAM]: `${trackedEntityName} in program: ${programName}`, | ||
[scopeTypes.TRACKER_PROGRAM]: | ||
`${i18n.t('{{trackedEntityName}} in program', { trackedEntityName })}: ${programName}`, | ||
[scopeTypes.TRACKED_ENTITY_TYPE]: `${trackedEntityName}`, |
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.
Actually, I think I would change this entire object to:
const text = {
[scopeTypes.EVENT_PROGRAM]: programName,
[scopeTypes.TRACKER_PROGRAM]:
i18n.t('{{trackedEntityName}} in program: {{programName}}', {
trackedEntityName,
programName,
}),
[scopeTypes.TRACKED_ENTITY_TYPE]: trackedEntityName,
};
This will change even more if you apply the suggestions with the extra param in the function declaration
(cherry picked from commit 475b27d)
Hey @JoakimSM, I implemented all the changes you mentioned. Can you have another look at this PR? Thank you! |
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.
Looks good. Thanks for adding my suggestions 👍
Backporting to 36 from #1617, #1640 and #1655
cherry picked from commit 70b103e
cherry picked from commit b92350c
cherry picked from commit 475b27d