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): Wrap page header in t function #226

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

NethmiRodrigo
Copy link
Contributor

@NethmiRodrigo NethmiRodrigo commented Oct 29, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

This PR wraps the page header title in the t function so that it can be translated. I had to add Home with the capital H to the translation files, as the key home doesn't get applied to the text.

Screenshots

After fix:
Screenshot 2024-10-29 at 6 16 25 PM

Before fix:
Screenshot 2024-10-29 at 6 17 00 PM

Related issue

Other

Copy link
Contributor

github-actions bot commented Oct 29, 2024

Size Change: -50 B (-0.01%)

Total Size: 373 kB

ℹ️ View Unchanged
Filename Size Change
packages/esm-home-app/dist/132.js 175 B 0 B
packages/esm-home-app/dist/173.js 135 B 0 B
packages/esm-home-app/dist/197.js 135 B 0 B
packages/esm-home-app/dist/271.js 725 B 0 B
packages/esm-home-app/dist/300.js 135 B 0 B
packages/esm-home-app/dist/335.js 144 B 0 B
packages/esm-home-app/dist/367.js 317 kB 0 B
packages/esm-home-app/dist/41.js 2.62 kB 0 B
packages/esm-home-app/dist/438.js 1.49 kB +24 B (+1.63%)
packages/esm-home-app/dist/442.js 135 B 0 B
packages/esm-home-app/dist/55.js 135 B 0 B
packages/esm-home-app/dist/652.js 138 B 0 B
packages/esm-home-app/dist/661.js 138 B 0 B
packages/esm-home-app/dist/783.js 7.87 kB -71 B (-0.89%)
packages/esm-home-app/dist/879.js 138 B 0 B
packages/esm-home-app/dist/903.js 5.73 kB 0 B
packages/esm-home-app/dist/913.js 22.1 kB 0 B
packages/esm-home-app/dist/99.js 134 B 0 B
packages/esm-home-app/dist/main.js 10.3 kB -3 B (-0.03%)
packages/esm-home-app/dist/openmrs-esm-home-app.js 3.31 kB 0 B

compressed-size-action

@denniskigen
Copy link
Member

denniskigen commented Oct 29, 2024

Thanks, @NethmiRodrigo. I wouldn't expect to see changes to the non-en translation files made by hand - Transifex should take care of that.

@NethmiRodrigo
Copy link
Contributor Author

@denniskigen yeah makes sense. I just added the same text that was there from home, should I remove it?

@denniskigen
Copy link
Member

yeah, best to see what we get back from Transifex so we know if there's anything that should be fixed upstream.

@NethmiRodrigo
Copy link
Contributor Author

Alrighty @denniskigen , done

@denniskigen denniskigen force-pushed the fix/page-header-translation branch from 72b31f4 to aebf942 Compare November 21, 2024 10:41
Comment on lines -33 to -40
// t('home', 'Home');

registerBreadcrumbs([
{
path: `${window.spaBase}/${pageName}`,
title: () => Promise.resolve(window.i18next.t('home', { defaultValue: 'Home', ns: moduleName })),
},
]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because we're no longer using the breadcrumbs navigation pattern in the Home app.

Comment on lines +13 to +17
/**
* Translation for the home page header
* // t('home', 'Home')
*/
return <PageHeader className={styles.pageHeader} illustration={<HomePictogram />} title={t(dashboardTitle)} />;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NethmiRodrigo I think this is the correct pattern to follow for translating the dashboard title.

@denniskigen denniskigen merged commit 83a1141 into main Nov 21, 2024
5 checks passed
@NethmiRodrigo NethmiRodrigo deleted the fix/page-header-translation branch November 21, 2024 11:00
denniskigen added a commit that referenced this pull request Nov 28, 2024
This commit cuts a new patch release of the Home app, v5.5.1, with the following changes:

* (fix) Wrap page header in t function by @NethmiRodrigo in #226
* (chore) Update translations from Transifex by @github-actions in #219
* (chore) Bump webpack from 5.93.0 to 5.94.0 by @dependabot in #220
* (chore) Bump express from 4.19.2 to 4.21.0 by @dependabot in #221
* (chore) Bump rollup from 2.77.2 to 2.79.2 by @dependabot in #223
* (chore) Update translations from Transifex by @github-actions in #224
* (chore) Bump http-proxy-middleware from 2.0.6 to 2.0.7 by @dependabot in #225
* (chore) Tweak tsconfig lib targets by @denniskigen in #227
* (chore) Remove unused test wrapper helper by @denniskigen in #228
* (chore) Update translations from Transifex by @github-actions in #229
* (docs) O3-3525: Enhance README by @Twiineenock in #211
@denniskigen denniskigen mentioned this pull request Nov 28, 2024
3 tasks
NethmiRodrigo pushed a commit that referenced this pull request Dec 2, 2024
This commit cuts a new patch release of the Home app, v5.5.1, with the following changes:

* (fix) Wrap page header in t function by @NethmiRodrigo in #226
* (chore) Update translations from Transifex by @github-actions in #219
* (chore) Bump webpack from 5.93.0 to 5.94.0 by @dependabot in #220
* (chore) Bump express from 4.19.2 to 4.21.0 by @dependabot in #221
* (chore) Bump rollup from 2.77.2 to 2.79.2 by @dependabot in #223
* (chore) Update translations from Transifex by @github-actions in #224
* (chore) Bump http-proxy-middleware from 2.0.6 to 2.0.7 by @dependabot in #225
* (chore) Tweak tsconfig lib targets by @denniskigen in #227
* (chore) Remove unused test wrapper helper by @denniskigen in #228
* (chore) Update translations from Transifex by @github-actions in #229
* (docs) O3-3525: Enhance README by @Twiineenock in #211
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.

2 participants