diff --git a/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/LocaleListCell.js b/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/LocaleListCell.js index 6614c51dd3..1f5c7335f9 100644 --- a/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/LocaleListCell.js +++ b/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/LocaleListCell.js @@ -5,8 +5,9 @@ import { Tooltip } from '@buffetjs/styles'; const mapToLocaleName = (locales, localeCode) => locales.find(({ code }) => code === localeCode).name; -const LocaleListCell = ({ locales, localizations, id }) => { - const localizationNames = localizations.map(locale => locale.locale); +const LocaleListCell = ({ locales, localizations, locale: currentLocaleCode, id }) => { + const allLocalizations = [{ locale: currentLocaleCode }, ...localizations]; + const localizationNames = allLocalizations.map(locale => locale.locale); const defaultLocale = locales.find(locale => locale.isDefault); const hasDefaultLocale = localizationNames.includes(defaultLocale.code); @@ -61,6 +62,7 @@ LocaleListCell.propTypes = { isDefault: PropTypes.bool, }) ).isRequired, + locale: PropTypes.string.isRequired, }; export default LocaleListCell; diff --git a/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/tests/LocaleListCell.test.js b/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/tests/LocaleListCell.test.js index 11dfc0bab5..5dcc392026 100644 --- a/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/tests/LocaleListCell.test.js +++ b/packages/strapi-plugin-i18n/admin/src/components/LocaleListCell/tests/LocaleListCell.test.js @@ -42,7 +42,7 @@ describe('LocaleListCell', () => { ); - expect(screen.getByText('French (default), Arabic')).toBeVisible(); + expect(screen.getByText('French (default), Arabic, English')).toBeVisible(); }); it('returns the "ar" when there s 2 locales available', () => { @@ -80,7 +80,7 @@ describe('LocaleListCell', () => { ); - expect(screen.getByText('Arabic')).toBeVisible(); + expect(screen.getByText('Arabic, English')).toBeVisible(); }); it('returns the "ar" and "en" locales alphabetically sorted', () => { @@ -118,6 +118,6 @@ describe('LocaleListCell', () => { ); - expect(screen.getByText('Arabic, English')).toBeVisible(); + expect(screen.getByText('French (default), Arabic, English')).toBeVisible(); }); });