Skip to content

Commit 160be35

Browse files
chore: [LW-10534] translation package (#1154)
* chore(extension): add translation package * chore(extension): use translation package in browser-extension * chore(extension): use translation package in core * chore(extension): use translation package in staking * chore(extension): remove Language obj from common package * chore(extension): fix storybook in staking package * fix(extension): fix e2e * chore(extension): fix storybook in core package * chore(extension): add typings for core and cardano packages * test(extension): fix issue with missing translations in tests --------- Co-authored-by: wklos-iohk <wojciech.klos@iohk.io>
1 parent 58f1145 commit 160be35

File tree

127 files changed

+1149
-926
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1149
-926
lines changed

apps/browser-extension-wallet/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@lace/common": "0.1.0",
5353
"@lace/core": "0.1.0",
5454
"@lace/staking": "0.1.0",
55+
"@lace/translation": "0.1.0",
5556
"@lace/ui": "^0.1.0",
5657
"@react-rxjs/core": "^0.9.8",
5758
"@react-rxjs/utils": "^0.9.5",

apps/browser-extension-wallet/src/components/MainMenu/DropdownMenuOverlay/components/ThemeSwitcher.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import MoonIcon from '../../../../assets/icons/moon.component.svg';
99
import { useBackgroundServiceAPIContext } from '@providers/BackgroundServiceAPI';
1010
import { themes, useAnalyticsContext } from '@providers';
1111
import { PostHogAction } from '@providers/AnalyticsProvider/analyticsTracker';
12-
import { TranslationKey } from '@lib/translations/types';
12+
import type { TranslationKey } from '@lace/translation';
1313

1414
type ThemeAnalyticsEvents<T> = Record<themes, T>;
1515

apps/browser-extension-wallet/src/components/WalletStatus/WalletStatusContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { useSyncStatus } from '@src/stores';
44
import { WalletStatus, Status } from './WalletStatus';
5-
import { TranslationKey } from '@lib/translations/types';
5+
import type { TranslationKey } from '@lace/translation';
66

77
const DEFAULT_WALLET_STATUS: { status: Status; text: TranslationKey } = {
88
status: Status.SYNCING,

apps/browser-extension-wallet/src/features/address-book/components/AddressDetailDrawer/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TranslationKey } from '@lib/translations/types';
1+
import type { TranslationKey } from '@lace/translation';
22

33
export enum AddressDetailsSteps {
44
DETAILS,

apps/browser-extension-wallet/src/features/dapp/components/__tests__/Connect.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react';
88
import '@testing-library/jest-dom';
99
import { cleanup, render, screen, waitFor, within } from '@testing-library/react';
1010
import { Connect } from '../Connect';
11-
import i18n from '@lib/i18n';
11+
import { i18n } from '@lace/translation';
1212
import { I18nextProvider } from 'react-i18next';
1313

1414
jest.mock('react-router-dom', () => ({

apps/browser-extension-wallet/src/features/dapp/components/confirm-transaction/testing.utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
ViewFlowProvider
1111
} from '@src/providers';
1212
import { APP_MODE_BROWSER } from '@src/utils/constants';
13-
import i18n from '@lib/i18n';
13+
import { i18n } from '@lace/translation';
1414
import { PostHogClientProvider } from '@providers/PostHogClientProvider';
1515
import { postHogClientMocks } from '@src/utils/mocks/test-helpers';
1616
import React from 'react';

apps/browser-extension-wallet/src/features/dapp/config/ViewsConfig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DappTransactionFail } from '../components/DappTransactionFail';
55
import { IViewAction, IViewState } from '../../../providers';
66
import { DappConfirmData as ConfirmData } from '../components/ConfirmData';
77
import { SignData } from '../components/SignData';
8-
import { TranslationKey } from '@lib/translations/types';
8+
import type { TranslationKey } from '@lace/translation';
99
export enum DAPP_VIEWS {
1010
CONNECT = 'connect',
1111
CONFIRM_TX = 'confirm-tx',

apps/browser-extension-wallet/src/features/receive-info/components/__tests__/ReceiveInfo.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { I18nextProvider } from 'react-i18next';
55
import { render } from '@testing-library/react';
66
import { ReceiveInfo, ReceiveInfoProps } from '../ReceiveInfo';
77
import '@testing-library/jest-dom';
8-
import i18n from '../../../../lib/i18n';
8+
import { i18n } from '../../../../lib/i18n';
99
import { mockWalletInfoTestnet } from '@src/utils/mocks/test-helpers';
1010
import { ThemeProvider } from '@providers/ThemeProvider';
1111

apps/browser-extension-wallet/src/features/unlock-wallet/components/__tests__/UnlockWallet.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as React from 'react';
33
import { I18nextProvider } from 'react-i18next';
44
import { fireEvent, render } from '@testing-library/react';
55
import '@testing-library/jest-dom';
6-
import i18n from '../../../../lib/i18n';
6+
import { i18n } from '../../../../lib/i18n';
77
import { UnlockWallet, UnlockWalletProps } from '../UnlockWallet';
88
import { MemoryRouter } from 'react-router-dom';
99

apps/browser-extension-wallet/src/hooks/__tests__/useCollateral.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { StoreProvider } from '@src/stores';
1717
import { COLLATERAL_ADA_AMOUNT, COLLATERAL_AMOUNT_LOVELACES, useCollateral } from '@hooks';
1818
import { APP_MODE_BROWSER } from '@src/utils/constants';
1919
import { I18nextProvider } from 'react-i18next';
20-
import i18n from '@lib/i18n';
20+
import { i18n } from '@lace/translation';
2121
import { Wallet } from '@lace/cardano';
2222
import { act } from 'react-dom/test-utils';
2323
import { waitFor } from '@testing-library/react';

0 commit comments

Comments
 (0)