Skip to content

Commit

Permalink
(fix) O3-4366: Change languages in my account panel to sentence case (#…
Browse files Browse the repository at this point in the history
…1277)

* fix: Change languages in my account panel to sentence case

* fix: Requested changes

* fix: Improve import syntax

* fix: Requested changes

* fix: Test issues
  • Loading branch information
harshthakkr authored Jan 27, 2025
1 parent a81e937 commit f8f53c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/apps/esm-primary-navigation-app/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
},
transformIgnorePatterns: [],
moduleNameMapper: {
'lodash-es/(.*)': 'lodash/$1',
'lodash-es': 'lodash',
'@openmrs/esm-framework': '@openmrs/esm-framework/mock.tsx',
'\\.(s?css)$': 'identity-obj-proxy',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, SwitcherItem } from '@carbon/react';
import capitalize from 'lodash-es/capitalize';
import { TranslateIcon, showModal, useSession } from '@openmrs/esm-framework';
import styles from './change-language-link.scss';

Expand All @@ -22,7 +23,7 @@ function ChangeLanguageLink() {
<SwitcherItem className={styles.panelItemContainer} aria-label={t('changeLanguage', 'Change language')}>
<div>
<TranslateIcon size={20} />
<p>{languageNames.of(session?.locale)}</p>
<p>{capitalize(languageNames.of(session?.locale))}</p>
</div>
<Button kind="ghost" onClick={launchChangeLanguageModal}>
{t('change', 'Change')}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { capitalize } from 'lodash-es';
import {
Button,
InlineLoading,
Expand All @@ -10,6 +9,7 @@ import {
RadioButton,
RadioButtonGroup,
} from '@carbon/react';
import capitalize from 'lodash-es/capitalize';
import { useConnectivity, useSession } from '@openmrs/esm-framework';
import { postUserPropertiesOffline, postUserPropertiesOnline } from './change-language.resource';
import styles from './change-language.scss';
Expand Down

0 comments on commit f8f53c0

Please sign in to comment.