Add weapon translation

This commit is contained in:
2023-04-28 17:21:26 +02:00
parent dd075d2982
commit bc1e23255d
4 changed files with 85 additions and 3 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ import dataLabel from 'chartjs-plugin-datalabels'
import { Weapon, Filters, useKillStore } from '@/stores/kill'
import { Doughnut } from 'vue-chartjs'
import { defineComponent, PropType } from 'vue'
import weapons from '../stores/weapons.json'
ChartJS.register(ArcElement, Tooltip, Legend, dataLabel)
@@ -101,7 +102,9 @@ export default defineComponent({
plugins: {
datalabels: {
formatter: (value: any, context: any) => {
return this.sortedWeaponList[context.dataIndex]
const weaponId = this.sortedWeaponList[context.dataIndex]
if (!(weapons as {[key:string]:string})[weaponId]) console.log(weaponId)
return (weapons as {[key:string]:string})[weaponId] || weaponId
},
backgroundColor: (context: any) => {
return context.dataset.backgroundColor(context)