-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Checkout i18next support (#1278)
- Loading branch information
1 parent
9ce982e
commit a4a7bb2
Showing
61 changed files
with
2,583 additions
and
315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/checkout/sdk/src/widgets/definitions/parameters/connect.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
import { WidgetLanguage } from '../configurations'; | ||
|
||
export enum ConnectTargetLayer { | ||
LAYER1 = 'LAYER1', | ||
LAYER2 = 'LAYER2', | ||
} | ||
|
||
export type ConnectWidgetParams = { | ||
/** The language to use for the connect widget */ | ||
language?: WidgetLanguage; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
packages/checkout/sdk/src/widgets/definitions/parameters/wallet.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
/* eslint-disable max-len */ | ||
import { WalletProviderName } from '../../../types'; | ||
import { WidgetLanguage } from '../configurations'; | ||
|
||
/** | ||
* Wallet Widget parameters | ||
* @property {WalletProviderName | undefined} walletProviderName | ||
*/ | ||
export type WalletWidgetParams = { | ||
/** The wallet provider name to use for the wallet widget */ | ||
walletProviderName?: WalletProviderName | ||
walletProviderName?: WalletProviderName; | ||
/** The language to use for the wallet widget */ | ||
language?: WidgetLanguage; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
// eslint-disable-next-line import/no-named-as-default | ||
import i18n, { type Resource } from 'i18next'; | ||
import LanguageDetector from 'i18next-browser-languagedetector'; | ||
import { initReactI18next } from 'react-i18next'; | ||
import enTranslations from './locales/en.json'; | ||
import jaTranslations from './locales/ja.json'; | ||
import koTranslations from './locales/ko.json'; | ||
import zhTranslations from './locales/zh.json'; | ||
|
||
const resources: Resource = { | ||
en: { | ||
translation: enTranslations, | ||
}, | ||
ja: { | ||
translation: jaTranslations, | ||
}, | ||
ko: { | ||
translation: koTranslations, | ||
}, | ||
zh: { | ||
translation: zhTranslations, | ||
}, | ||
}; | ||
|
||
// eslint-disable-next-line import/no-named-as-default-member | ||
i18n | ||
.use(initReactI18next) // passes i18n down to react-i18next | ||
.use(LanguageDetector) | ||
.init({ | ||
fallbackLng: 'en', | ||
resources, | ||
// lng: 'en', // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources | ||
// you can use the i18n.changeLanguage function to change the language manually: https://www.i18next.com/overview/api#changelanguage | ||
// if you're using a language detector, do not define the lng optio | ||
interpolation: { | ||
escapeValue: false, // react already safes from xss | ||
}, | ||
}); | ||
|
||
export default i18n; |
Oops, something went wrong.