Skip to content

Commit

Permalink
chore: swap translated strings notation from template literal to func…
Browse files Browse the repository at this point in the history
…tion style (#2535)

* [SRO] swap from template literal to function notation for affected SRO pages & components

* [GO] swap notation for artifact-related pages & components

* [GO] swap notation for character-related pages & components

* [GO] swap notation for weapon-related pages & components

* [GO] swap notation for main teams page and related components

* [GO] swap notation for teams page, character display

* [GO] swap notation for teams page, tabs

* [GO] swap notation for teams, team settings

* [GO] swap notation for home & settings page

* [GO] swap notation for components
  • Loading branch information
tiffanynwyeung authored Nov 9, 2024
1 parent 12298ec commit c23eaf1
Show file tree
Hide file tree
Showing 91 changed files with 503 additions and 434 deletions.
6 changes: 4 additions & 2 deletions libs/gi/page-artifacts/src/DupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function DupModal({
alignItems="center"
>
<DifferenceIcon sx={{ verticalAlign: 'text-top', mr: 1 }} />
{t`showDup`}
{t('showDup')}
</Typography>
}
action={
Expand Down Expand Up @@ -111,7 +111,9 @@ function DupContent({
</CardThemed>
))}
{!dupList.length && (
<Alert variant="filled" severity="success">{t`noDupAlert`}</Alert>
<Alert variant="filled" severity="success">
{t('noDupAlert')}
</Alert>
)}
</Stack>
)
Expand Down
10 changes: 7 additions & 3 deletions libs/gi/page-artifacts/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function PageArtifact() {
</Suspense>
<InfoComponent
pageKey="artifactPage"
modalTitle={t`info.title`}
modalTitle={t('info.title')}
text={t('tipsOfTheDay', { returnObjects: true }) as string[]}
>
<ArtifactInfoDisplay />
Expand Down Expand Up @@ -176,15 +176,19 @@ export default function PageArtifact() {
onClick={() => setArtifactIdToEdit('new')}
color="info"
startIcon={<AddIcon />}
>{t`addNew`}</Button>
>
{t('addNew')}
</Button>
</Grid>
<Grid item xs={1}>
<Button
fullWidth
onClick={onShowDup}
color="info"
startIcon={<DifferenceIcon />}
>{t`showDup`}</Button>
>
{t('showDup')}
</Button>
</Grid>
</Grid>
<Suspense
Expand Down
4 changes: 3 additions & 1 deletion libs/gi/page-characters/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ export default function PageCharacter() {
onClick={() => setnewCharacter(true)}
color="info"
startIcon={<AddIcon />}
>{t`addNew`}</Button>
>
{t('addNew')}
</Button>
<Suspense
fallback={
<Skeleton
Expand Down
14 changes: 7 additions & 7 deletions libs/gi/page-home/src/InventoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function InventoryCard() {
return (
<CardThemed>
<CardHeader
title={<Typography variant="h5">{t`inventoryCard.title`}</Typography>}
title={<Typography variant="h5">{t('inventoryCard.title')}</Typography>}
avatar={<BusinessCenter fontSize="large" />}
/>
<Divider />
Expand All @@ -108,7 +108,7 @@ export default function InventoryCard() {
<Chip
label={
<strong>
{t(`ui:tabs.characters`)} {characterTotal}
{t('ui:tabs.characters')} {characterTotal}
</strong>
}
icon={<People />}
Expand Down Expand Up @@ -145,7 +145,7 @@ export default function InventoryCard() {
<Chip
label={
<strong>
{t(`ui:tabs.weapons`)} {weaponTotal}
{t('ui:tabs.weapons')} {weaponTotal}
</strong>
}
icon={<AnvilIcon />}
Expand Down Expand Up @@ -182,7 +182,7 @@ export default function InventoryCard() {
<Chip
label={
<strong>
{t(`ui:tabs.artifacts`)} {artifactTotal}
{t('ui:tabs.artifacts')} {artifactTotal}
</strong>
}
icon={<FlowerIcon />}
Expand Down Expand Up @@ -222,7 +222,7 @@ export default function InventoryCard() {
icon={<TeamIcon />}
label={
<strong>
{t(`ui:tabs.teams`)} {numTeams}
{t('ui:tabs.teams')} {numTeams}
</strong>
}
/>
Expand All @@ -232,7 +232,7 @@ export default function InventoryCard() {
icon={<LoadoutIcon />}
label={
<strong>
{t(`ui:tabs.loadouts`)} {numLoadout}
{t('ui:tabs.loadouts')} {numLoadout}
</strong>
}
/>
Expand All @@ -242,7 +242,7 @@ export default function InventoryCard() {
icon={<BuildIcon />}
label={
<strong>
{t(`ui:tabs.builds`)} {numBuilds}
{t('ui:tabs.builds')} {numBuilds}
</strong>
}
/>
Expand Down
16 changes: 9 additions & 7 deletions libs/gi/page-home/src/QuickLinksCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ const genshin_optimizer_links = [
url: process.env['NX_URL_GITHUB_GO'],
},
{
title: (t: TFunction) => t`quickLinksCard.buttons.patchNotes.title`,
title: (t: TFunction) => t('quickLinksCard.buttons.patchNotes.title'),
icon: <Description />,
url: `${process.env['NX_URL_GITHUB_GO']}/releases`,
},
{
title: (t: TFunction) => t`quickLinksCard.buttons.tyGuide.title`,
title: (t: TFunction) => t('quickLinksCard.buttons.tyGuide.title'),
icon: <YouTube />,
url: process.env['NX_URL_YOUTUBE_TUTPL'],
},
Expand Down Expand Up @@ -76,22 +76,22 @@ const frzyc_links = [

const other_links = [
{
title: (t: TFunction) => t`quickLinksCard.buttons.scanners.title`,
title: (t: TFunction) => t('quickLinksCard.buttons.scanners.title'),
icon: <Scanner />,
to: '/scanner',
},
{
title: (t: TFunction) => t`quickLinksCard.buttons.kqm.title`,
title: (t: TFunction) => t('quickLinksCard.buttons.kqm.title'),
icon: <Handshake />,
url: process.env['NX_URL_WEBSITE_KQM'],
},
{
title: (t: TFunction) => t`quickLinksCard.buttons.devDiscord.title`,
title: (t: TFunction) => t('quickLinksCard.buttons.devDiscord.title'),
icon: <DiscordIcon />,
url: process.env['NX_URL_DISCORD_GDEV'],
},
{
title: (t: TFunction) => t`quickLinksCard.buttons.good.title`,
title: (t: TFunction) => t('quickLinksCard.buttons.good.title'),
icon: <Article />,
to: '/doc',
},
Expand All @@ -102,7 +102,9 @@ export default function QuickLinksCard() {
return (
<CardThemed>
<CardHeader
title={<Typography variant="h5">{t`quickLinksCard.title`}</Typography>}
title={
<Typography variant="h5">{t('quickLinksCard.title')}</Typography>
}
avatar={<InsertLink fontSize="large" />}
/>
<Divider />
Expand Down
24 changes: 12 additions & 12 deletions libs/gi/page-home/src/TeamCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,77 +26,77 @@ const team = [
{
name: 'frzyc',
img: frzyc,
title: (t) => t`teamCard.jobTitle.leadDev`,
title: (t) => t('teamCard.jobTitle.leadDev'),
subtitle: 'Insomniac in Chief',
url: process.env.NX_URL_GITHUB_FRZYC,
},
{
name: 'Lantua',
img: lantua,
title: (t) => t`teamCard.jobTitle.dev`,
title: (t) => t('teamCard.jobTitle.dev'),
subtitle: 'Copium Calculator',
url: process.env.NX_URL_GITHUB_LANTUA,
},
{
name: 'Van',
img: van,
title: (t) => t`teamCard.jobTitle.dev`,
title: (t) => t('teamCard.jobTitle.dev'),
subtitle: 'Waverider Stowaway',
url: process.env.NX_URL_GITHUB_VAN,
},
{
name: '✦ Sin ✦',
img: sin,
title: (t) => t`teamCard.jobTitle.admin`,
title: (t) => t('teamCard.jobTitle.admin'),
subtitle: 'Ohh, shiny.',
url: '',
},
{
name: 'Stain',
img: stain,
title: (t) => t`teamCard.jobTitle.admin`,
title: (t) => t('teamCard.jobTitle.admin'),
subtitle: 'Australia Man',
url: '',
},
{
name: 'yae!',
img: yae,
title: (t) => t`teamCard.jobTitle.dev`,
title: (t) => t('teamCard.jobTitle.dev'),
subtitle: 'eeeqeee',
url: '',
},
{
name: 'tooflesswulf',
img: toofless,
title: (t) => t`teamCard.jobTitle.dev`,
title: (t) => t('teamCard.jobTitle.dev'),
subtitle: 'Mad Mathematician',
url: '',
},
{
name: 'Qbe',
img: qbe,
title: (t) => t`teamCard.jobTitle.dev`,
title: (t) => t('teamCard.jobTitle.dev'),
subtitle: 'Irminsul Debugger',
url: '',
},
{
name: 'Polomo',
img: polomo,
title: (t) => t`teamCard.jobTitle.translator`,
title: (t) => t('teamCard.jobTitle.translator'),
subtitle: 'Director of Text',
url: '',
},
{
name: 'Vlad',
img: vlad,
title: (t) => t`teamCard.jobTitle.TC`,
title: (t) => t('teamCard.jobTitle.TC'),
subtitle: 'Spreadsheet Renegade',
url: '',
},
{
name: 'D1firehail',
img: d1,
title: (t) => t`teamCard.jobTitle.mod`,
title: (t) => t('teamCard.jobTitle.mod'),
subtitle: 'Scanner Spy',
url: '',
},
Expand All @@ -107,7 +107,7 @@ export default function TeamCard() {
return (
<CardThemed>
<CardHeader
title={<Typography variant="h5">{t`teamCard.title`}</Typography>}
title={<Typography variant="h5">{t('teamCard.title')}</Typography>}
avatar={<GroupsIcon fontSize="large" />}
/>
<Divider />
Expand Down
4 changes: 3 additions & 1 deletion libs/gi/page-home/src/VidGuideCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function VidGuideCard() {
href={process.env.NX_URL_YOUTUBE_TUTPL}
target="_blank"
rel="noopener"
>{t`vidGuideCard.title`}</Typography>
>
{t('vidGuideCard.title')}
</Typography>
}
avatar={<YouTubeIcon fontSize="large" />}
/>
Expand Down
4 changes: 3 additions & 1 deletion libs/gi/page-home/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ function PatchNotesCard() {
<CardThemed>
<CardHeader
title={
<Typography variant="h5">{t`quickLinksCard.buttons.patchNotes.title`}</Typography>
<Typography variant="h5">
{t('quickLinksCard.buttons.patchNotes.title')}
</Typography>
}
avatar={<DescriptionIcon fontSize="large" />}
/>
Expand Down
6 changes: 3 additions & 3 deletions libs/gi/page-settings/src/SillyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function SillyCard() {
<CardThemed bgt="light">
<CardContent sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
<Avatar src={silly_icon} />
<Typography variant="h5"> {t`sillyPageTitle`}</Typography>
<Typography variant="h5"> {t('sillyPageTitle')}</Typography>
</CardContent>
<Divider />
<CardContent>
Expand All @@ -40,8 +40,8 @@ export default function SillyCard() {
color={silly ? 'success' : 'secondary'}
>
{silly
? t`settings:sillyCard.toggle.enabled`
: t`settings:sillyCard.toggle.disabled`}
? t('settings:sillyCard.toggle.enabled')
: t('settings:sillyCard.toggle.disabled')}
</Button>
<Button
startIcon={<DiscordIcon />}
Expand Down
6 changes: 3 additions & 3 deletions libs/gi/page-team/src/BuildDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function BuildDropdown({
<Box sx={{ display: 'flex', gap: 1, flexWrap: 'wrap' }}>
<span>{database.teams.getActiveBuildName(loadoutDatum)}</span>
{buildType === 'tc' && (
<SqBadge color="success">{t`buildDropdown.tcBadge`}</SqBadge>
<SqBadge color="success">{t('buildDropdown.tcBadge')}</SqBadge>
)}
</Box>
}
Expand All @@ -41,7 +41,7 @@ export default function BuildDropdown({
onClick={() => onChangeLoadoutDatum({ buildType: 'equipped' })}
sx={{ display: 'flex', gap: 1 }}
>
{t`buildDropdown.equipped`}
{t('buildDropdown.equipped')}
</MenuItem>
{buildIds.map((bId) => {
const { name } = database.builds.get(bId)!
Expand Down Expand Up @@ -71,7 +71,7 @@ export default function BuildDropdown({
sx={{ display: 'flex', gap: 1 }}
>
<span>{name}</span>
<SqBadge color="success">{t`buildDropdown.tcBadge`}</SqBadge>
<SqBadge color="success">{t('buildDropdown.tcBadge')}</SqBadge>
</MenuItem>
)
})}
Expand Down
2 changes: 1 addition & 1 deletion libs/gi/page-team/src/CharProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function CharacterProfileCard() {
onClick={onShowEditor}
startIcon={<DriveFileRenameOutlineIcon />}
>
{t`charProfile.button`}
{t('charProfile.button')}
</Button>
</Box>

Expand Down
2 changes: 1 addition & 1 deletion libs/gi/page-team/src/CharProfileCharEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function Content({ onClose }: { onClose?: () => void }) {
})
}}
>
{t`buildTcCharOverride.btn`}
{t('buildTcCharOverride.btn')}
</Button>
</BootstrapTooltip>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function BuildEquipped({ active = false }: { active?: boolean }) {
})
const onDupe = () =>
database.teamChars.newBuild(teamCharId, {
name: t`buildEqCard.copy.nameReal`,
name: t('buildEqCard.copy.nameReal'),
artifactIds: equippedArtifacts,
weaponId: equippedWeapon,
})
Expand All @@ -42,14 +42,14 @@ export function BuildEquipped({ active = false }: { active?: boolean }) {
if (!newBuildTcId) return
// copy over name
database.buildTcs.set(newBuildTcId, {
name: t`buildEqCard.copy.nameTc`,
description: t`buildEqCard.copy.desc`,
name: t('buildEqCard.copy.nameTc'),
description: t('buildEqCard.copy.desc'),
})
}

return (
<BuildCard
name={t`buildEqCard.name`}
name={t('buildEqCard.name')}
active={active}
onActive={onActive}
onCopyToTc={copyToTc}
Expand Down
Loading

0 comments on commit c23eaf1

Please sign in to comment.