Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .i18n-codegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,30 @@
"namespace": "com.maskbook.box",
"trans": "Translate"
}
},
{
"input": "./packages/mask/src/plugins/Game/locales/en-US.json",
"output": "./packages/mask/src/plugins/Game/locales/i18n_generated",
"parser": { "type": "i18next", "contextSeparator": "$", "pluralSeparator": "_" },
"generator": {
"type": "i18next/react-hooks",
"hooks": "useI18N",
"namespace": "com.maskbook.game",
"trans": "Translate",
"sourceMap": "inline"
}
},
{
"input": "./packages/mask/src/plugins/Pets/locales/en-US.json",
"output": "./packages/mask/src/plugins/Pets/locales/i18n_generated",
"parser": { "type": "i18next", "contextSeparator": "$", "pluralSeparator": "_" },
"generator": {
"type": "i18next/react-hooks",
"hooks": "useI18N",
"namespace": "com.maskbook.pets",
"trans": "Translate",
"sourceMap": "inline"
}
}
]
}
28 changes: 0 additions & 28 deletions packages/mask/shared-ui/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -867,35 +867,7 @@
"plugin_furucombo_head_pools": "Pools",
"plugin_furucombo_head_action": "Action",
"plugin_pets_dialog_title": "Non-Fungible Friends",
"plugin_pets_name": "Non-F Friends",
"plugin_pets_description": "Explore the endless possibilities of NFTs.",
"plugin_pets_dialog_title_share": "Successful",
"plugin_pets_dialog_contract": "NFT Contract",
"plugin_pets_dialog_token": "Token ID",
"plugin_pets_dialog_msg": "Greeting message",
"plugin_pets_dialog_msg_optional": "Optional, 100 characters max.",
"plugin_pets_dialog_btn": "Confirm",
"plugin_pets_dialog_btn_share": "Share",
"plugin_pets_dialog_preview": "Preview",
"plugin_pets_dialog_unverified": " (unverified)",
"plugin_pets_dialog_created": "Created by NonFFriend",
"plugin_pets_dialog_powered": "Powered by RSS3",
"powered_by": "Powered by",
"plugin_pets_dialog_success": "Your Non-Fungible Friend has been set up successfully",
"plugin_pets_dialog_fail": "Setting failed, please try later",
"plugin_pets_dialog_check_title": "Show NFT friends on the profile page.",
"plugin_pets_dialog_menu_change": "Change",
"plugin_pets_dialog_menu_ski": "Ski",
"plugin_pets_dialog_menu_about": "About us",
"plugin_game_name": "GAME",
"plugin_game_list_title": "GameList",
"plugin_game_list_rank": "Rank",
"plugin_game_list_play": "Play",
"plugin_game_list_play_error": "Please connect wallet",
"plugin_game_list_play_evm_error": "Please connect to EVM wallet",
"plugin_game_share_btn": "Share",
"plugin_game_share_title": "Share",
"plugin_game_dialog_info": "Share this game to twitter",
"wallet_verify_persona_sign": "Persona Sign",
"wallet_verify_has_bound": "The wallet has been bound. Please switch wallets.",
"wallet_verify_persona_name": "{{personaName}} Sign",
Expand Down
11 changes: 6 additions & 5 deletions packages/mask/src/plugins/Game/SNSAdaptor/GameList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'
import { makeStyles, useStylesExtends } from '@masknet/theme'
import { NetworkPluginID } from '@masknet/web3-shared-base'
import { useChainId } from '@masknet/plugin-infra/web3'
import { PluginWalletStatusBar, useI18N } from '../../../utils'
import { PluginWalletStatusBar } from '../../../utils'
import { useI18N } from '../locales'
import { ChainBoundary } from '../../../web3/UI/ChainBoundary'
import { useGameList } from '../hook'
import type { GameInfo } from '../types'
Expand Down Expand Up @@ -100,7 +101,7 @@ interface Props {
}

const GameList = (props: Props) => {
const { t } = useI18N()
const t = useI18N()
const classes = useStylesExtends(useStyles(), {})
const gameList = useGameList()
const chainId = useChainId(NetworkPluginID.PLUGIN_EVM)
Expand All @@ -122,7 +123,7 @@ const GameList = (props: Props) => {
return (
<>
<List className={classes.walletBar}>
<Typography className={classes.title}>{t('plugin_game_list_title')}</Typography>
<Typography className={classes.title}>{t.plugin_game_list_title()}</Typography>
<ul className={classes.gameList}>
{gameList
? gameList.map((game, index: number) => (
Expand All @@ -145,14 +146,14 @@ const GameList = (props: Props) => {
/>
</div>
<Typography className={classes.rank}>
{t('plugin_game_list_rank')} {game.rank}
{t.plugin_game_list_rank()} {game.rank}
</Typography>
</div>
<Button
variant="roundedContained"
className={classes.playBtn}
onClick={() => props.onPlay(game)}>
{t('plugin_game_list_play')}
{t.plugin_game_list_play()}
</Button>
</li>
))
Expand Down
15 changes: 15 additions & 0 deletions packages/mask/src/plugins/Game/locales/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"plugin_game_dialog_menu_change": "Change",
"plugin_game_dialog_menu_ski": "Ski",
"plugin_game_dialog_menu_about": "About us",
"plugin_game_dialog_unverified": " (unverified)",
"plugin_game_name": "GAME",
"plugin_game_list_title": "GameList",
"plugin_game_list_rank": "Rank",
"plugin_game_list_play": "Play",
"plugin_game_list_play_error": "Please connect wallet",
"plugin_game_list_play_evm_error": "Please connect to EVM wallet",
"plugin_game_share_btn": "Share",
"plugin_game_share_title": "Share",
"plugin_game_dialog_info": "Share this game to twitter"
}
6 changes: 6 additions & 0 deletions packages/mask/src/plugins/Game/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is auto generated. DO NOT EDIT
// Run `npx gulp sync-languages` to regenerate.
// Default fallback language in a family of languages are chosen by the alphabet order
// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts

export * from './i18n_generated'
19 changes: 19 additions & 0 deletions packages/mask/src/plugins/Game/locales/languages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file is auto generated. DO NOT EDIT
// Run `npx gulp sync-languages` to regenerate.
// Default fallback language in a family of languages are chosen by the alphabet order
// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts
import en_US from './en-US.json'
export const languages = {
en: en_US,
}
// @ts-ignore
if (import.meta.webpackHot) {
// @ts-ignore
import.meta.webpackHot.accept(['./en-US.json'], () =>
globalThis.dispatchEvent?.(
new CustomEvent('MASK_I18N_HMR', {
detail: ['com.maskbook.game', { en: en_US }],
}),
),
)
}
21 changes: 21 additions & 0 deletions packages/mask/src/plugins/Pets/locales/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"plugin_pets_name": "Non-F Friends",
"plugin_pets_description": "Explore the endless possibilities of NFTs.",
"plugin_pets_dialog_title_share": "Successful",
"plugin_pets_dialog_contract": "NFT Contract",
"plugin_pets_dialog_token": "Token ID",
"plugin_pets_dialog_msg": "Greeting message",
"plugin_pets_dialog_msg_optional": "Optional, 100 characters max.",
"plugin_pets_dialog_btn": "Confirm",
"plugin_pets_dialog_btn_share": "Share",
"plugin_pets_dialog_preview": "Preview",
"plugin_pets_dialog_created": "Created by NonFFriend",
"plugin_pets_dialog_powered": "Powered by RSS3",
"plugin_pets_dialog_menu_change": "Change",
"plugin_pets_dialog_menu_ski": "Ski",
"plugin_pets_dialog_menu_about": "About us",
"plugin_pets_dialog_unverified": " (unverified)",
"plugin_pets_dialog_success": "Your Non-Fungible Friend has been set up successfully",
"plugin_pets_dialog_fail": "Setting failed, please try later",
"plugin_pets_dialog_check_title": "Show NFT friends on the profile page."
}
6 changes: 6 additions & 0 deletions packages/mask/src/plugins/Pets/locales/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is auto generated. DO NOT EDIT
// Run `npx gulp sync-languages` to regenerate.
// Default fallback language in a family of languages are chosen by the alphabet order
// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts

export * from './i18n_generated'
19 changes: 19 additions & 0 deletions packages/mask/src/plugins/Pets/locales/languages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// This file is auto generated. DO NOT EDIT
// Run `npx gulp sync-languages` to regenerate.
// Default fallback language in a family of languages are chosen by the alphabet order
// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts
import en_US from './en-US.json'
export const languages = {
en: en_US,
}
// @ts-ignore
if (import.meta.webpackHot) {
// @ts-ignore
import.meta.webpackHot.accept(['./en-US.json'], () =>
globalThis.dispatchEvent?.(
new CustomEvent('MASK_I18N_HMR', {
detail: ['com.maskbook.pets', { en: en_US }],
}),
),
)
}