mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2025-03-13 11:18:28 +01:00
Add language weapon
This commit is contained in:
parent
c024a94930
commit
703d656703
8 changed files with 33 additions and 2 deletions
1
src/data/weapons/fr.json
Normal file
1
src/data/weapons/fr.json
Normal file
File diff suppressed because one or more lines are too long
1
src/data/weapons/id.json
Normal file
1
src/data/weapons/id.json
Normal file
File diff suppressed because one or more lines are too long
1
src/data/weapons/ko.json
Normal file
1
src/data/weapons/ko.json
Normal file
File diff suppressed because one or more lines are too long
1
src/data/weapons/pt.json
Normal file
1
src/data/weapons/pt.json
Normal file
File diff suppressed because one or more lines are too long
1
src/data/weapons/ru.json
Normal file
1
src/data/weapons/ru.json
Normal file
File diff suppressed because one or more lines are too long
1
src/data/weapons/zh.json
Normal file
1
src/data/weapons/zh.json
Normal file
File diff suppressed because one or more lines are too long
|
@ -13,8 +13,9 @@
|
|||
|
||||
<script>
|
||||
import { mdiCircle, mdiStar } from '@mdi/js';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { locale, t } from 'svelte-i18n';
|
||||
import Icon from '../../components/Icon.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
const rarity = {
|
||||
1: 'text-white',
|
||||
|
@ -34,6 +35,17 @@
|
|||
export let weapon;
|
||||
// export let materials;
|
||||
|
||||
async function changeLocale(locale) {
|
||||
const _data = await import(`../../data/weapons/${locale}.json`);
|
||||
weapon = _data.default[id];
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
locale.subscribe((val) => {
|
||||
changeLocale(val);
|
||||
});
|
||||
});
|
||||
|
||||
$: multiplier = weapon.secondary.name === 'em' ? 1 : 100;
|
||||
$: suffix = weapon.secondary.name === 'em' ? '' : '%';
|
||||
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
</script>
|
||||
|
||||
<script>
|
||||
import { t } from 'svelte-i18n';
|
||||
import { onMount } from 'svelte';
|
||||
import { locale, t } from 'svelte-i18n';
|
||||
import TableHeader from '../../components/Table/TableHeader.svelte';
|
||||
|
||||
export let data;
|
||||
|
@ -89,6 +90,18 @@
|
|||
}
|
||||
});
|
||||
|
||||
async function changeLocale(locale) {
|
||||
const _data = await import(`../../data/weapons/${locale}.json`);
|
||||
data = _data.default;
|
||||
process();
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
locale.subscribe((val) => {
|
||||
changeLocale(val);
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
|
|
Loading…
Add table
Reference in a new issue