mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: localize tankopedia config
This commit is contained in:
1 parent
18afa4cd28
commit
2c365cdea0
8 files changed
+79
-23
No files matched your search
@@ -941,6 +941,38 @@
|
|||||||
"title": "Review videos",
|
"title": "Review videos",
|
||||||
"disclaimer": "BlitzKit does not endorse any review videos.",
|
"disclaimer": "BlitzKit does not endorse any review videos.",
|
||||||
"join": "Apply to %s1 YouTuber program"
|
"join": "Apply to %s1 YouTuber program"
|
||||||
|
},
|
||||||
|
|
||||||
|
"configuration": {
|
||||||
|
"title": "Configuration",
|
||||||
|
|
||||||
|
"modules": {
|
||||||
|
"title": "Modules",
|
||||||
|
"stock": "Stock",
|
||||||
|
"upgrade": "Upgrade"
|
||||||
|
},
|
||||||
|
"equipment": {
|
||||||
|
"title": "Equipment",
|
||||||
|
"clear": "Clear"
|
||||||
|
},
|
||||||
|
"provisions": {
|
||||||
|
"title": "Provisions",
|
||||||
|
"clear": "Clear"
|
||||||
|
},
|
||||||
|
"consumables": {
|
||||||
|
"title": "Consumables",
|
||||||
|
"clear": "Clear",
|
||||||
|
"info": "Yellow consumables do not affect the statistics."
|
||||||
|
},
|
||||||
|
"skills": {
|
||||||
|
"title": "Crew skills",
|
||||||
|
"clear": "Clear",
|
||||||
|
"maximize": "Maximize",
|
||||||
|
"info": "Yellow skills only apply under special circumstances. Hold Space to quickly toggle between level 0 and 7."
|
||||||
|
},
|
||||||
|
"miscellaneous": {
|
||||||
|
"title": "Miscellaneous"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"compare": {
|
"compare": {
|
||||||
|
|||||||
+10
-4
@@ -10,6 +10,7 @@ import {
|
|||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { awaitableConsumableDefinitions } from '../../../../core/awaitables/consumableDefinitions';
|
import { awaitableConsumableDefinitions } from '../../../../core/awaitables/consumableDefinitions';
|
||||||
import { useEquipment } from '../../../../hooks/useEquipment';
|
import { useEquipment } from '../../../../hooks/useEquipment';
|
||||||
|
import { useLocale } from '../../../../hooks/useLocale';
|
||||||
import { Duel } from '../../../../stores/duel';
|
import { Duel } from '../../../../stores/duel';
|
||||||
import { ConsumablesManager } from '../../../ConsumablesManager';
|
import { ConsumablesManager } from '../../../ConsumablesManager';
|
||||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||||
@@ -34,12 +35,15 @@ export function Consumables() {
|
|||||||
);
|
);
|
||||||
const hasConsumableDeliverySystem = useEquipment(118);
|
const hasConsumableDeliverySystem = useEquipment(118);
|
||||||
const hasHighEndConsumables = useEquipment(101);
|
const hasHighEndConsumables = useEquipment(101);
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigurationChildWrapper>
|
<ConfigurationChildWrapper>
|
||||||
<Flex gap="4" align="center">
|
<Flex gap="4" align="center">
|
||||||
<Flex gap="2" align="center">
|
<Flex gap="2" align="center">
|
||||||
<Heading size="4">Consumables</Heading>
|
<Heading size="4">
|
||||||
|
{strings.website.tools.tankopedia.configuration.consumables.title}
|
||||||
|
</Heading>
|
||||||
|
|
||||||
<Popover.Root>
|
<Popover.Root>
|
||||||
<Popover.Trigger>
|
<Popover.Trigger>
|
||||||
@@ -50,8 +54,10 @@ export function Consumables() {
|
|||||||
|
|
||||||
<Popover.Content>
|
<Popover.Content>
|
||||||
<Text>
|
<Text>
|
||||||
<Text color="amber">Yellow consumables</Text> do not affect the
|
{
|
||||||
statistics.
|
strings.website.tools.tankopedia.configuration.consumables
|
||||||
|
.info
|
||||||
|
}
|
||||||
</Text>
|
</Text>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
</Popover.Root>
|
</Popover.Root>
|
||||||
@@ -66,7 +72,7 @@ export function Consumables() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Clear
|
{strings.website.tools.tankopedia.configuration.consumables.clear}
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
|||||||
+6
-2
@@ -1,5 +1,6 @@
|
|||||||
import { Button, Flex, Heading } from '@radix-ui/themes';
|
import { Button, Flex, Heading } from '@radix-ui/themes';
|
||||||
import { awaitableEquipmentDefinitions } from '../../../../core/awaitables/equipmentDefinitions';
|
import { awaitableEquipmentDefinitions } from '../../../../core/awaitables/equipmentDefinitions';
|
||||||
|
import { useLocale } from '../../../../hooks/useLocale';
|
||||||
import { Duel } from '../../../../stores/duel';
|
import { Duel } from '../../../../stores/duel';
|
||||||
import { EquipmentManager } from '../../../EquipmentManager';
|
import { EquipmentManager } from '../../../EquipmentManager';
|
||||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||||
@@ -14,11 +15,14 @@ export function Equipment() {
|
|||||||
const equipmentMatrix = Duel.use(
|
const equipmentMatrix = Duel.use(
|
||||||
(state) => state.protagonist.equipmentMatrix,
|
(state) => state.protagonist.equipmentMatrix,
|
||||||
);
|
);
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigurationChildWrapper>
|
<ConfigurationChildWrapper>
|
||||||
<Flex gap="4" align="center">
|
<Flex gap="4" align="center">
|
||||||
<Heading size="4">Equipment</Heading>
|
<Heading size="4">
|
||||||
|
{strings.website.tools.tankopedia.configuration.equipment.title}
|
||||||
|
</Heading>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="red"
|
color="red"
|
||||||
@@ -32,7 +36,7 @@ export function Equipment() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Clear
|
{strings.website.tools.tankopedia.configuration.equipment.clear}
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,6 @@
|
|||||||
import { asset } from '@blitzkit/core';
|
import { asset } from '@blitzkit/core';
|
||||||
import { Flex, Heading } from '@radix-ui/themes';
|
import { Flex, Heading } from '@radix-ui/themes';
|
||||||
|
import { useLocale } from '../../../../hooks/useLocale';
|
||||||
import { Duel } from '../../../../stores/duel';
|
import { Duel } from '../../../../stores/duel';
|
||||||
import { GenericTankComponentButton } from '../../../ModuleButtons/GenericTankComponentButton';
|
import { GenericTankComponentButton } from '../../../ModuleButtons/GenericTankComponentButton';
|
||||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||||
@@ -11,10 +12,13 @@ export function Miscellaneous() {
|
|||||||
(state) => state.protagonist.cooldownBooster,
|
(state) => state.protagonist.cooldownBooster,
|
||||||
);
|
);
|
||||||
const { tank } = Duel.use((state) => state.protagonist);
|
const { tank } = Duel.use((state) => state.protagonist);
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigurationChildWrapper>
|
<ConfigurationChildWrapper>
|
||||||
<Heading size="4">Miscellaneous</Heading>
|
<Heading size="4">
|
||||||
|
{strings.website.tools.tankopedia.configuration.miscellaneous.title}
|
||||||
|
</Heading>
|
||||||
|
|
||||||
<Flex gap="2" align="center">
|
<Flex gap="2" align="center">
|
||||||
{!tank.fixed_camouflage && (
|
{!tank.fixed_camouflage && (
|
||||||
|
|||||||
+6
-3
@@ -165,6 +165,7 @@ export function Modules() {
|
|||||||
const topGun = topTurret.guns.at(-1)!;
|
const topGun = topTurret.guns.at(-1)!;
|
||||||
const topEngine = tank.engines.at(-1)!;
|
const topEngine = tank.engines.at(-1)!;
|
||||||
const topTrack = tank.tracks.at(-1)!;
|
const topTrack = tank.tracks.at(-1)!;
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
function setByUnlock(unlock: Unlock) {
|
function setByUnlock(unlock: Unlock) {
|
||||||
mutateDuel((draft) => {
|
mutateDuel((draft) => {
|
||||||
@@ -354,7 +355,9 @@ export function Modules() {
|
|||||||
return (
|
return (
|
||||||
<ConfigurationChildWrapper>
|
<ConfigurationChildWrapper>
|
||||||
<Flex gap="4" align="center">
|
<Flex gap="4" align="center">
|
||||||
<Heading size="4">Modules</Heading>
|
<Heading size="4">
|
||||||
|
{strings.website.tools.tankopedia.configuration.modules.title}
|
||||||
|
</Heading>
|
||||||
|
|
||||||
{hasUpgrades && (
|
{hasUpgrades && (
|
||||||
<>
|
<>
|
||||||
@@ -372,7 +375,7 @@ export function Modules() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Stock
|
{strings.website.tools.tankopedia.configuration.modules.stock}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
@@ -390,7 +393,7 @@ export function Modules() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Upgrade
|
{strings.website.tools.tankopedia.configuration.modules.upgrade}
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+6
-2
@@ -1,6 +1,7 @@
|
|||||||
import { availableProvisions } from '@blitzkit/core';
|
import { availableProvisions } from '@blitzkit/core';
|
||||||
import { Button, Flex, Heading } from '@radix-ui/themes';
|
import { Button, Flex, Heading } from '@radix-ui/themes';
|
||||||
import { awaitableProvisionDefinitions } from '../../../../core/awaitables/provisionDefinitions';
|
import { awaitableProvisionDefinitions } from '../../../../core/awaitables/provisionDefinitions';
|
||||||
|
import { useLocale } from '../../../../hooks/useLocale';
|
||||||
import { Duel } from '../../../../stores/duel';
|
import { Duel } from '../../../../stores/duel';
|
||||||
import { ProvisionsManager } from '../../../ProvisionsManager';
|
import { ProvisionsManager } from '../../../ProvisionsManager';
|
||||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||||
@@ -12,11 +13,14 @@ export function Provisions() {
|
|||||||
const { tank, gun } = Duel.use((state) => state.protagonist);
|
const { tank, gun } = Duel.use((state) => state.protagonist);
|
||||||
const provisions = Duel.use((state) => state.protagonist.provisions);
|
const provisions = Duel.use((state) => state.protagonist.provisions);
|
||||||
const provisionsList = availableProvisions(tank, gun, provisionDefinitions);
|
const provisionsList = availableProvisions(tank, gun, provisionDefinitions);
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigurationChildWrapper>
|
<ConfigurationChildWrapper>
|
||||||
<Flex gap="4" align="center">
|
<Flex gap="4" align="center">
|
||||||
<Heading size="4">Provisions</Heading>
|
<Heading size="4">
|
||||||
|
{strings.website.tools.tankopedia.configuration.provisions.title}
|
||||||
|
</Heading>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="red"
|
color="red"
|
||||||
@@ -26,7 +30,7 @@ export function Provisions() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Clear
|
{strings.website.tools.tankopedia.configuration.provisions.clear}
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
|||||||
+8
-10
@@ -4,10 +4,10 @@ import {
|
|||||||
Flex,
|
Flex,
|
||||||
Heading,
|
Heading,
|
||||||
IconButton,
|
IconButton,
|
||||||
Kbd,
|
|
||||||
Popover,
|
Popover,
|
||||||
Text,
|
Text,
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
|
import { useLocale } from '../../../../hooks/useLocale';
|
||||||
import { TankopediaEphemeral } from '../../../../stores/tankopediaEphemeral';
|
import { TankopediaEphemeral } from '../../../../stores/tankopediaEphemeral';
|
||||||
import { CrewSkillManager } from '../../../CrewSkillManager';
|
import { CrewSkillManager } from '../../../CrewSkillManager';
|
||||||
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
||||||
@@ -15,12 +15,15 @@ import { ConfigurationChildWrapper } from './ConfigurationChildWrapper';
|
|||||||
export function Skills() {
|
export function Skills() {
|
||||||
const skillLevels = TankopediaEphemeral.use((state) => state.skills);
|
const skillLevels = TankopediaEphemeral.use((state) => state.skills);
|
||||||
const mutateTankopediaTemporary = TankopediaEphemeral.useMutation();
|
const mutateTankopediaTemporary = TankopediaEphemeral.useMutation();
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigurationChildWrapper>
|
<ConfigurationChildWrapper>
|
||||||
<Flex gap="4" align="center">
|
<Flex gap="4" align="center">
|
||||||
<Flex gap="2" align="center">
|
<Flex gap="2" align="center">
|
||||||
<Heading size="4">Crew skills</Heading>
|
<Heading size="4">
|
||||||
|
{strings.website.tools.tankopedia.configuration.skills.title}
|
||||||
|
</Heading>
|
||||||
|
|
||||||
<Popover.Root>
|
<Popover.Root>
|
||||||
<Popover.Trigger>
|
<Popover.Trigger>
|
||||||
@@ -32,12 +35,7 @@ export function Skills() {
|
|||||||
<Popover.Content>
|
<Popover.Content>
|
||||||
<Flex direction="column" gap="2">
|
<Flex direction="column" gap="2">
|
||||||
<Text>
|
<Text>
|
||||||
<Text color="amber">Yellow skills</Text> only apply under
|
{strings.website.tools.tankopedia.configuration.skills.info}
|
||||||
special circumstances.
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Text>
|
|
||||||
Hold <Kbd>Shift</Kbd> to quickly toggle between level 0 and 7.
|
|
||||||
</Text>
|
</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Popover.Content>
|
</Popover.Content>
|
||||||
@@ -55,7 +53,7 @@ export function Skills() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Clear
|
{strings.website.tools.tankopedia.configuration.skills.clear}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
@@ -67,7 +65,7 @@ export function Skills() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Maximize
|
{strings.website.tools.tankopedia.configuration.skills.maximize}
|
||||||
</Button>
|
</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Flex, Heading } from '@radix-ui/themes';
|
import { Flex, Heading } from '@radix-ui/themes';
|
||||||
|
import { useLocale } from '../../../hooks/useLocale';
|
||||||
import { Characteristics } from './components/Characteristics';
|
import { Characteristics } from './components/Characteristics';
|
||||||
import { CharacteristicsHeading } from './components/Characteristics/components/Heading';
|
import { CharacteristicsHeading } from './components/Characteristics/components/Heading';
|
||||||
import { Consumables } from './components/Consumables';
|
import { Consumables } from './components/Consumables';
|
||||||
@@ -9,6 +10,8 @@ import { Provisions } from './components/Provisions';
|
|||||||
import { Skills } from './components/Skills';
|
import { Skills } from './components/Skills';
|
||||||
|
|
||||||
export function CharacteristicsSection() {
|
export function CharacteristicsSection() {
|
||||||
|
const { strings } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex mt="4" px="4" style={{ boxSizing: 'border-box' }} gap="6">
|
<Flex mt="4" px="4" style={{ boxSizing: 'border-box' }} gap="6">
|
||||||
<Flex
|
<Flex
|
||||||
@@ -24,7 +27,9 @@ export function CharacteristicsSection() {
|
|||||||
maxWidth="21rem"
|
maxWidth="21rem"
|
||||||
align={{ initial: 'center', sm: 'start' }}
|
align={{ initial: 'center', sm: 'start' }}
|
||||||
>
|
>
|
||||||
<Heading>Configuration</Heading>
|
<Heading>
|
||||||
|
{strings.website.tools.tankopedia.configuration.title}
|
||||||
|
</Heading>
|
||||||
<Modules />
|
<Modules />
|
||||||
<Equipment />
|
<Equipment />
|
||||||
<Provisions />
|
<Provisions />
|
||||||
|
|||||||
Reference in new issue
Block a user