Skip to content

Commit

Permalink
refactor: remove part of old i18n infra (#11823)
Browse files Browse the repository at this point in the history
Co-authored-by: Jack-Works <Jack-Works@users.noreply.github.com>
  • Loading branch information
Jack-Works and Jack-Works authored Sep 30, 2024
1 parent a598359 commit 68531f1
Show file tree
Hide file tree
Showing 71 changed files with 3,028 additions and 566 deletions.
44 changes: 22 additions & 22 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
".gitignore",
".patch",
".prettierignore",
"*.json",
"*.css",
"*.json",
"*.po",
"*.snap",
"*.svg",
Expand All @@ -22,10 +22,12 @@
"dist",
"node_modules",
"packages/xcode",
"pnpm-lock.yaml",
"qya-aa.json"
],
"TODO: fix those words": ["bridgable", "clonable", "sniffings"],
"ignoreWords": [
"aeth",
"algr",
"anchorme",
"apng",
Expand All @@ -34,10 +36,12 @@
"arweave",
"astar",
"bignumber",
"bitcointalk",
"bitget",
"bitkeep",
"blockhash",
"blockie",
"blockies",
"blocto",
"blurhash",
"bonfida",
Expand All @@ -52,6 +56,7 @@
"clonable",
"codegen",
"coincarp",
"contribs",
"cronos",
"crossbell",
"cryptopunks",
Expand All @@ -76,16 +81,8 @@
"fusd",
"gopluslabs",
"gorli",
"blockies",
"healthz",
"bitcointalk",
"aeth",
"nftredPackets",
"contribs",
"heco",
"Raydium",

"lamports",
"holoflows",
"hookz",
"hovercard",
Expand All @@ -96,17 +93,21 @@
"immer",
"inpage",
"ipfs",
"ipfshttp",
"iqwiki",
"jkoeaghipilijlahjplgbfiocjhldnap",
"keccak",
"keybase",
"kiwistand",
"klaytn",
"lamport",
"lamports",
"languagedetector",
"lavamoat",
"leaderboard",
"lensprotocol",
"lenster",
"linea",
"lingui",
"linkify",
"lngs",
Expand All @@ -117,6 +118,7 @@
"maskbook",
"maskbox",
"masknet",
"masknetwork",
"maskwallet",
"mastdon",
"merkle",
Expand All @@ -131,6 +133,7 @@
"multicall",
"multisigs",
"nftgo",
"nftredpackets",
"nftscan",
"nftx",
"nonfungiblefriends",
Expand All @@ -148,6 +151,7 @@
"paytoken",
"poap",
"polygonscan",
"postop",
"prefund",
"profilecard",
"pvtsutils",
Expand All @@ -157,7 +161,9 @@
"rari",
"rarible",
"raycast",
"raydium",
"rdns",
"realmasknetwork",
"redpacket",
"redpackets",
"rehype",
Expand All @@ -168,29 +174,23 @@
"scamsniffer",
"scenechange",
"schnorr",
"masknetwork",
"realmasknetwork",
"solanaart",
"solanart",
"postop",
"Linea",
"jkoeaghipilijlahjplgbfiocjhldnap",
"unfollower",
"IPFSHTTP",
"secp",
"servie",
"shiden",
"signless",
"simplehash",
"sniffings",
"solana",
"solanaart",
"solanart",
"solflare",
"sollet",
"solsea",
"spaceid",
"stargate",
"stego",
"Sollet",
"steganography",
"stego",
"suji",
"swappable",
"telos",
"testid",
Expand All @@ -204,6 +204,7 @@
"typechain",
"typeson",
"unfollow",
"unfollower",
"unitoken",
"unpadded",
"unstake",
Expand All @@ -224,8 +225,7 @@
"zerion",
"zkscan",
"zksync",
"zora",
"suji"
"zora"
],
"ignoreRegExpList": ["/[A-Za-z0-9]{44}/", "/[A-Za-z0-9]{46}/", "/[A-Za-z0-9]{59}/"],
"overrides": []
Expand Down
4 changes: 3 additions & 1 deletion packages/mask/popups/components/TransactionPreview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { FormattedCurrency, ImageIcon, TokenIcon } from '@masknet/shared'
import { GasSettingMenu } from '../GasSettingMenu/index.js'
import type { TransactionDetail } from '../../pages/Wallet/type.js'
import { Trans } from '@lingui/macro'
import { useFormatMessage } from '../../../../shared/src/UI/translate.js'

const useStyles = makeStyles()((theme) => ({
info: {
Expand Down Expand Up @@ -86,6 +87,7 @@ export const TransactionPreview = memo<TransactionPreviewProps>(function Transac
const { chainId } = useChainContext<NetworkPluginID.PLUGIN_EVM>()
const contacts = useContacts()
const Utils = useWeb3Utils()
const format = useFormatMessage()
const { title, to, tokenAddress, amount } = useMemo(() => {
const type = transaction.formattedTransaction?.type

Expand All @@ -98,7 +100,7 @@ export const TransactionPreview = memo<TransactionPreviewProps>(function Transac
)?.parameters?.to

return {
title: transaction.formattedTransaction?.title ?? <Trans>Contract Interaction</Trans>,
title: format(transaction.formattedTransaction?.title) ?? <Trans>Contract Interaction</Trans>,
to: to && isString(to) ? to : transaction.computedPayload?.to,
tokenAddress: transaction.formattedTransaction?.tokenInAddress,
amount: transaction.formattedTransaction?.tokenInAmount ?? transaction.computedPayload.value,
Expand Down
10 changes: 5 additions & 5 deletions packages/mask/shared-ui/locale/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ msgstr ""
msgid "Contract"
msgstr ""

#: popups/components/TransactionPreview/index.tsx:101
#: popups/components/TransactionPreview/index.tsx:103
msgid "Contract Interaction"
msgstr ""

Expand Down Expand Up @@ -744,7 +744,7 @@ msgstr ""
msgid "Deleted successfully"
msgstr ""

#: popups/components/TransactionPreview/index.tsx:117
#: popups/components/TransactionPreview/index.tsx:119
msgid "Deploy Contract"
msgstr ""

Expand Down Expand Up @@ -1014,7 +1014,7 @@ msgstr ""
msgid "Function: {0}"
msgstr ""

#: popups/components/TransactionPreview/index.tsx:233
#: popups/components/TransactionPreview/index.tsx:235
#: popups/components/UnlockERC20Token/index.tsx:287
#: popups/components/UnlockERC721Token/index.tsx:228
#: popups/modals/GasSettingModal/index.tsx:41
Expand Down Expand Up @@ -2138,7 +2138,7 @@ msgstr ""
#: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx:354
#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx:101
#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx:98
#: popups/components/TransactionPreview/index.tsx:108
#: popups/components/TransactionPreview/index.tsx:110
#: popups/pages/Wallet/CollectibleDetail/index.tsx:398
#: popups/pages/Wallet/components/ActionGroup/index.tsx:83
#: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx:398
Expand Down Expand Up @@ -2512,7 +2512,7 @@ msgid "This wallet is connected to current persona {0}."
msgstr ""

#: popups/components/AddContactInputPanel/index.tsx:116
#: popups/components/TransactionPreview/index.tsx:185
#: popups/components/TransactionPreview/index.tsx:187
#: popups/pages/Wallet/TransactionDetail/index.tsx:287
msgid "To"
msgstr ""
Expand Down
10 changes: 5 additions & 5 deletions packages/mask/shared-ui/locale/ja-JP.po
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ msgstr "続行"
msgid "Contract"
msgstr "コントラクト"

#: popups/components/TransactionPreview/index.tsx:101
#: popups/components/TransactionPreview/index.tsx:103
msgid "Contract Interaction"
msgstr "コントラクトの相互作用"

Expand Down Expand Up @@ -749,7 +749,7 @@ msgstr "連絡先を削除しました。"
msgid "Deleted successfully"
msgstr "正常に削除されました"

#: popups/components/TransactionPreview/index.tsx:117
#: popups/components/TransactionPreview/index.tsx:119
msgid "Deploy Contract"
msgstr "コントラクトのデプロイ"

Expand Down Expand Up @@ -1019,7 +1019,7 @@ msgstr "から"
msgid "Function: {0}"
msgstr "機能: {0}"

#: popups/components/TransactionPreview/index.tsx:233
#: popups/components/TransactionPreview/index.tsx:235
#: popups/components/UnlockERC20Token/index.tsx:287
#: popups/components/UnlockERC721Token/index.tsx:228
#: popups/modals/GasSettingModal/index.tsx:41
Expand Down Expand Up @@ -2143,7 +2143,7 @@ msgstr "ウォレットを選択"
#: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx:354
#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx:101
#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx:98
#: popups/components/TransactionPreview/index.tsx:108
#: popups/components/TransactionPreview/index.tsx:110
#: popups/pages/Wallet/CollectibleDetail/index.tsx:398
#: popups/pages/Wallet/components/ActionGroup/index.tsx:83
#: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx:398
Expand Down Expand Up @@ -2517,7 +2517,7 @@ msgid "This wallet is connected to current persona {0}."
msgstr "このウォレットは現在のペルソナ {0}に接続されています。"

#: popups/components/AddContactInputPanel/index.tsx:116
#: popups/components/TransactionPreview/index.tsx:185
#: popups/components/TransactionPreview/index.tsx:187
#: popups/pages/Wallet/TransactionDetail/index.tsx:287
msgid "To"
msgstr "宛先:"
Expand Down
10 changes: 5 additions & 5 deletions packages/mask/shared-ui/locale/ko-KR.po
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ msgstr "다음"
msgid "Contract"
msgstr "컨트랙트"

#: popups/components/TransactionPreview/index.tsx:101
#: popups/components/TransactionPreview/index.tsx:103
msgid "Contract Interaction"
msgstr "컨트렉트 인터액션"

Expand Down Expand Up @@ -749,7 +749,7 @@ msgstr "연락처 삭제 성공"
msgid "Deleted successfully"
msgstr "삭제 성공"

#: popups/components/TransactionPreview/index.tsx:117
#: popups/components/TransactionPreview/index.tsx:119
msgid "Deploy Contract"
msgstr ""

Expand Down Expand Up @@ -1019,7 +1019,7 @@ msgstr "보낸 사람"
msgid "Function: {0}"
msgstr "Function: {0}"

#: popups/components/TransactionPreview/index.tsx:233
#: popups/components/TransactionPreview/index.tsx:235
#: popups/components/UnlockERC20Token/index.tsx:287
#: popups/components/UnlockERC721Token/index.tsx:228
#: popups/modals/GasSettingModal/index.tsx:41
Expand Down Expand Up @@ -2143,7 +2143,7 @@ msgstr "월렛 선택"
#: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx:354
#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx:101
#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx:98
#: popups/components/TransactionPreview/index.tsx:108
#: popups/components/TransactionPreview/index.tsx:110
#: popups/pages/Wallet/CollectibleDetail/index.tsx:398
#: popups/pages/Wallet/components/ActionGroup/index.tsx:83
#: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx:398
Expand Down Expand Up @@ -2517,7 +2517,7 @@ msgid "This wallet is connected to current persona {0}."
msgstr "이 월렛은 현재 페르소나 {0} 에 연결됩니다."

#: popups/components/AddContactInputPanel/index.tsx:116
#: popups/components/TransactionPreview/index.tsx:185
#: popups/components/TransactionPreview/index.tsx:187
#: popups/pages/Wallet/TransactionDetail/index.tsx:287
msgid "To"
msgstr "To"
Expand Down
10 changes: 5 additions & 5 deletions packages/mask/shared-ui/locale/zh-CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ msgstr "继续"
msgid "Contract"
msgstr "合约"

#: popups/components/TransactionPreview/index.tsx:101
#: popups/components/TransactionPreview/index.tsx:103
msgid "Contract Interaction"
msgstr "合约交互"

Expand Down Expand Up @@ -749,7 +749,7 @@ msgstr "删除联系人成功。"
msgid "Deleted successfully"
msgstr "成功删除"

#: popups/components/TransactionPreview/index.tsx:117
#: popups/components/TransactionPreview/index.tsx:119
msgid "Deploy Contract"
msgstr ""

Expand Down Expand Up @@ -1019,7 +1019,7 @@ msgstr "从"
msgid "Function: {0}"
msgstr "功能:{0}"

#: popups/components/TransactionPreview/index.tsx:233
#: popups/components/TransactionPreview/index.tsx:235
#: popups/components/UnlockERC20Token/index.tsx:287
#: popups/components/UnlockERC721Token/index.tsx:228
#: popups/modals/GasSettingModal/index.tsx:41
Expand Down Expand Up @@ -2143,7 +2143,7 @@ msgstr "选择钱包"
#: content-script/components/InjectedComponents/SetupGuide/VerifyNextID.tsx:354
#: dashboard/pages/SetupPersona/CloudBackup/EmailForm.tsx:101
#: dashboard/pages/SetupPersona/CloudBackup/PhoneForm.tsx:98
#: popups/components/TransactionPreview/index.tsx:108
#: popups/components/TransactionPreview/index.tsx:110
#: popups/pages/Wallet/CollectibleDetail/index.tsx:398
#: popups/pages/Wallet/components/ActionGroup/index.tsx:83
#: popups/pages/Wallet/components/ActivityList/ActivityItem.tsx:398
Expand Down Expand Up @@ -2517,7 +2517,7 @@ msgid "This wallet is connected to current persona {0}."
msgstr "钱包已经链接到当前的身份{0}。"

#: popups/components/AddContactInputPanel/index.tsx:116
#: popups/components/TransactionPreview/index.tsx:185
#: popups/components/TransactionPreview/index.tsx:187
#: popups/pages/Wallet/TransactionDetail/index.tsx:287
msgid "To"
msgstr "至"
Expand Down
Loading

0 comments on commit 68531f1

Please sign in to comment.