mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: fixed localize tankopedia chars
This commit is contained in:
1 parent
c4f1d9f3b0
commit
6233c16b88
4 files changed
+30
-19
No files matched your search
@@ -1,11 +1,5 @@
|
||||
import { times } from 'lodash-es';
|
||||
import {
|
||||
CrewType,
|
||||
GunDefinition,
|
||||
ShellType,
|
||||
TankClass,
|
||||
TankType,
|
||||
} from '../../protos';
|
||||
import { CrewType, ShellType, TankClass, TankType } from '../../protos';
|
||||
|
||||
export const SHELL_NAMES: Record<ShellType, string> = {
|
||||
[ShellType.AP]: 'AP',
|
||||
@@ -20,14 +14,7 @@ export const CREW_MEMBER_NAMES = {
|
||||
[CrewType.LOADER]: 'loader',
|
||||
[CrewType.RADIOMAN]: 'radioman',
|
||||
} as const;
|
||||
export const GUN_TYPE_NAMES: Record<
|
||||
Exclude<GunDefinition['gun_type'], undefined>['$case'],
|
||||
string
|
||||
> = {
|
||||
auto_loader: 'Auto loader',
|
||||
auto_reloader: 'Auto reloader',
|
||||
regular: 'Regular',
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated use svg
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
"x": "x%s1"
|
||||
},
|
||||
|
||||
"gun_types": {
|
||||
"auto_loader": "Auto loader",
|
||||
"auto_reloader": "Auto reloader",
|
||||
"regular": "Regular"
|
||||
},
|
||||
|
||||
"shells": {
|
||||
"ap": "AP",
|
||||
"apcr": "APCR",
|
||||
@@ -817,7 +823,8 @@
|
||||
},
|
||||
"other_projects": {
|
||||
"title": "Other cool projects"
|
||||
}
|
||||
},
|
||||
"help_translate": "Please help translate %s1 to %s2!"
|
||||
},
|
||||
|
||||
"tools": {
|
||||
|
||||
+1
-2
@@ -3,7 +3,6 @@ import {
|
||||
coefficient,
|
||||
CREW_MEMBER_NAMES,
|
||||
CrewType,
|
||||
GUN_TYPE_NAMES,
|
||||
isExplosive,
|
||||
resolvePenetrationCoefficient,
|
||||
} from '@blitzkit/core';
|
||||
@@ -192,7 +191,7 @@ export function Characteristics() {
|
||||
strings.website.tools.tankopedia.characteristics.values.gunType
|
||||
}
|
||||
>
|
||||
{GUN_TYPE_NAMES[gun.gun_type!.$case]}
|
||||
{strings.common.gun_types[gun.gun_type!.$case]}
|
||||
</Info>
|
||||
<InfoWithDelta
|
||||
stats={stats}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from '@blitzkit/i18n';
|
||||
import { Box, Flex, Heading } from '@radix-ui/themes';
|
||||
import { Box, Flex, Heading, Link } from '@radix-ui/themes';
|
||||
import type { GetStaticPaths } from 'astro';
|
||||
import { AesonPlug } from '../../components/AesonPlug';
|
||||
import { HomeLocaleSwitcher } from '../../components/Home/HomeLocaleSwitcher';
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
tierListTool,
|
||||
} from '../../constants/tools';
|
||||
import { getStrings } from '../../core/i18n/getStrings';
|
||||
import { literals } from '../../core/i18n/literals';
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
|
||||
const PUBLIC_ASSET_BRANCH = assertSecret(import.meta.env.PUBLIC_ASSET_BRANCH);
|
||||
@@ -43,6 +44,23 @@ export const getStaticPaths = (() => {
|
||||
|
||||
<HomeLocaleSwitcher {locale} client:load />
|
||||
|
||||
{
|
||||
locale !== DEFAULT_LOCALE && (
|
||||
<Flex justify="center" mb="4">
|
||||
<Link
|
||||
href="https://crowdin.com/project/blitzkrieg"
|
||||
target="_blank"
|
||||
underline="always"
|
||||
>
|
||||
{literals(strings.website.home.help_translate, [
|
||||
'BlitzKit',
|
||||
strings.common.locales[locale],
|
||||
])}
|
||||
</Link>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
<Plugs client:idle />
|
||||
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user