Skip to content
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

Merged
merged 5 commits into from
May 3, 2021
Merged

Conversation

simonadomnisoru
Copy link
Contributor

@simonadomnisoru simonadomnisoru commented Apr 23, 2021

Backporting to 36 from #1617, #1640 and #1655

cherry picked from commit 70b103e
cherry picked from commit b92350c
cherry picked from commit 475b27d

* 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)
@simonadomnisoru simonadomnisoru marked this pull request as ready for review April 28, 2021 11:10
Copy link
Member

@JoakimSM JoakimSM left a 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}
Copy link
Member

@JoakimSM JoakimSM Apr 29, 2021

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}`,
Copy link
Member

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:

Suggested change
`${i18n.t('{{trackedEntityName}} in program', { trackedEntityName })}: ${programName}`,
i18n.t('{{trackedEntityName}} in program: {{programName}}', { trackedEntityName, programName }),

Comment on lines 9 to 13
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}`,
Copy link
Member

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

@simonadomnisoru
Copy link
Contributor Author

Hey @JoakimSM,

Thank you for your review! I address your commits in this PR to master #1655. If everything looks good after the merge I will cherry-pick the commits in this PR.

Thanks!

@simonadomnisoru
Copy link
Contributor Author

Hey @JoakimSM,

I implemented all the changes you mentioned. Can you have another look at this PR? Thank you!

@JoakimSM JoakimSM self-requested a review May 3, 2021 14:55
Copy link
Member

@JoakimSM JoakimSM left a 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 👍

@dhis2-bot dhis2-bot merged commit dfe1b5f into v36 May 3, 2021
@dhis2-bot dhis2-bot deleted the DHIS2-8998-v36 branch May 3, 2021 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants