diff --git a/webapp/src/combinedProviders.tsx b/webapp/src/combinedProviders.tsx index 9a20efd54..e5ffe08f4 100644 --- a/webapp/src/combinedProviders.tsx +++ b/webapp/src/combinedProviders.tsx @@ -22,7 +22,7 @@ const CombinedProviders = React.memo((props: Props): JSX.Element => { const {language, setLanguage, user} = props return ( diff --git a/webapp/src/components/properties/user/user.test.tsx b/webapp/src/components/properties/user/user.test.tsx index 4690ce116..01c2c88f2 100644 --- a/webapp/src/components/properties/user/user.test.tsx +++ b/webapp/src/components/properties/user/user.test.tsx @@ -3,7 +3,7 @@ import React from 'react' import {IntlProvider} from 'react-intl' -import {render, wait} from '@testing-library/react' +import {render, waitFor} from '@testing-library/react' import {act} from 'react-dom/test-utils' @@ -55,11 +55,10 @@ describe('components/properties/user', () => { ) let container - act(() => { + await waitFor(() => { const renderResult = render(component) container = renderResult.container }) - await wait() expect(container).toMatchSnapshot() }) @@ -74,11 +73,10 @@ describe('components/properties/user', () => { ) let container - act(() => { + await waitFor(() => { const renderResult = render(component) container = renderResult.container }) - await wait() expect(container).toMatchSnapshot() }) @@ -93,11 +91,10 @@ describe('components/properties/user', () => { ) let container: Element | DocumentFragment = {} as Element - act(() => { + await waitFor(() => { const renderResult = render(component) container = renderResult.container }) - await wait() if (container) { // this is the actual element where the click event triggers diff --git a/webapp/src/components/sidebar/__snapshots__/sidebarSettingsMenu.test.tsx.snap b/webapp/src/components/sidebar/__snapshots__/sidebarSettingsMenu.test.tsx.snap index c717fb2f3..64a9aa4e5 100644 --- a/webapp/src/components/sidebar/__snapshots__/sidebarSettingsMenu.test.tsx.snap +++ b/webapp/src/components/sidebar/__snapshots__/sidebarSettingsMenu.test.tsx.snap @@ -112,7 +112,7 @@ exports[`components/sidebar/SidebarSettingsMenu languages menu open should match
- German + Deutsch
- Japanese + 日本語
- French + Français
- Dutch + Nederlands
- Russian + Pусский
- Traditional Chinese + 中文 (繁體)
- Simplified Chinese + 中文 (简体)
- Turkish + Türkçe
{ { code: 'es', name: 'spanish', - displayName: 'Spanish', + displayName: 'Español', }, { code: 'de', name: 'german', - displayName: 'German', + displayName: 'Deutsch', }, { code: 'ja', name: 'japanese', - displayName: 'Japanese', + displayName: '日本語', }, { code: 'fr', name: 'french', - displayName: 'French', + displayName: 'Français', }, { code: 'nl', name: 'dutch', - displayName: 'Dutch', + displayName: 'Nederlands', }, { code: 'ru', name: 'russian', - displayName: 'Russian', + displayName: 'Pусский', }, { - code: 'chinese', - name: 'zh', - displayName: 'Traditional Chinese', + code: 'zh-cn', + name: 'chinese', + displayName: '中文 (繁體)', }, { - code: 'zh_Hans', + code: 'zh-tx', name: 'simplified-chinese', - displayName: 'Simplified Chinese', + displayName: '中文 (简体)', }, { code: 'tr', name: 'turkish', - displayName: 'Turkish', + displayName: 'Türkçe', }, { code: 'oc', @@ -160,7 +160,7 @@ const SidebarSettingsMenu = React.memo((props: Props) => { setLanguage(language.code)} rightIcon={intl.locale.toLowerCase() === language.code ? : null} /> diff --git a/webapp/src/i18n.tsx b/webapp/src/i18n.tsx index 5b255e825..bc2794171 100644 --- a/webapp/src/i18n.tsx +++ b/webapp/src/i18n.tsx @@ -13,7 +13,7 @@ import messages_tr from '../i18n/tr.json' import messages_zhHant from '../i18n/zh_Hant.json' import messages_zhHans from '../i18n/zh_Hans.json' -const supportedLanguages = ['de', 'fr', 'ja', 'nl', 'ru', 'es', 'oc', 'tr', 'zh', 'zh_Hant', 'zh_Hans'] +const supportedLanguages = ['de', 'fr', 'ja', 'nl', 'ru', 'es', 'oc', 'tr', 'zh-cn', 'zh-tw'] export function getMessages(lang: string): {[key: string]: string} { switch (lang) { @@ -33,11 +33,9 @@ export function getMessages(lang: string): {[key: string]: string} { return messages_oc case 'tr': return messages_tr - case 'zh': + case 'zh-cn': return messages_zhHant - case 'zh_Hant': - return messages_zhHant - case 'zh_Hans': + case 'zh-tw': return messages_zhHans } return messages_en