mirror of
https://github.com/tcgdex/compiler.git
synced 2025-06-07 16:29:57 +00:00
Added Spanish Translation and temp way for other languages
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
dd0a8731ea
commit
39d1a5dd1a
@ -3,6 +3,82 @@ import { SupportedLanguages } from 'db/interfaces'
|
|||||||
type translatable = 'types' | 'rarity' | 'stage' | 'category' | 'suffix' | 'abilityType' | 'trainerType' | 'energyType'
|
type translatable = 'types' | 'rarity' | 'stage' | 'category' | 'suffix' | 'abilityType' | 'trainerType' | 'energyType'
|
||||||
|
|
||||||
const translations: Record<string, Record<translatable, Record<string, string>>> = {
|
const translations: Record<string, Record<translatable, Record<string, string>>> = {
|
||||||
|
es: {
|
||||||
|
abilityType: {
|
||||||
|
'Ability': 'Habilidad',
|
||||||
|
// Missing
|
||||||
|
'Ancient Trait': 'Ancient Trait',
|
||||||
|
// Missing
|
||||||
|
'Poke-BODY': 'Poke-BODY',
|
||||||
|
// Missing
|
||||||
|
'Poke-POWER': 'Poke-POWER',
|
||||||
|
// Missing
|
||||||
|
'Pokemon Power': 'Pokemon Power'
|
||||||
|
|
||||||
|
},
|
||||||
|
category: {
|
||||||
|
Energy: 'Energía',
|
||||||
|
Pokemon: 'Pokémon',
|
||||||
|
Trainer: 'Entrenador'
|
||||||
|
},
|
||||||
|
energyType: {
|
||||||
|
Normal: 'Básico',
|
||||||
|
Special: 'Especial'
|
||||||
|
},
|
||||||
|
rarity: {
|
||||||
|
'Amazing': 'Increíbles',
|
||||||
|
'Common': 'Commún',
|
||||||
|
'None': 'Ninguno',
|
||||||
|
'Rare': 'Rara',
|
||||||
|
'Secret Rare': 'Rara Secreto',
|
||||||
|
'Ultra Rare': 'Rara Ultra',
|
||||||
|
'Uncommon': 'Uncommon'
|
||||||
|
},
|
||||||
|
stage: {
|
||||||
|
'BREAK': 'TURBO',
|
||||||
|
'Basic': 'Basico',
|
||||||
|
'LEVEL-UP': 'Subir de nivel',
|
||||||
|
'MEGA': 'MEGA',
|
||||||
|
'RESTORED': 'Recreado',
|
||||||
|
'Stage1': 'Fase 1',
|
||||||
|
'Stage2': 'Fase 2',
|
||||||
|
'VMAX': 'VMAX'
|
||||||
|
},
|
||||||
|
suffix: {
|
||||||
|
'EX': 'EX',
|
||||||
|
'GX': 'GX',
|
||||||
|
'Legend': 'LEYENDA',
|
||||||
|
'Prime': 'Prime',
|
||||||
|
'SP': 'SP',
|
||||||
|
'TAG TEAM-GX': 'TAG TEAM-GX',
|
||||||
|
'V': 'V'
|
||||||
|
},
|
||||||
|
trainerType: {
|
||||||
|
// Missing
|
||||||
|
'Ace Spec': 'Ace Spec',
|
||||||
|
// Missing
|
||||||
|
'Goldenrod Game Corner': 'Goldenrod Game Corner',
|
||||||
|
'Item': 'Objeto',
|
||||||
|
'Rocket\'s Secret Machine': 'Máquina Secreta de Rocket',
|
||||||
|
'Stadium': 'Estaio',
|
||||||
|
'Supporter': 'Partidario',
|
||||||
|
'Technical Machine': 'Máquina Técnica',
|
||||||
|
'Tool': 'Herramienta'
|
||||||
|
},
|
||||||
|
types: {
|
||||||
|
Colorless: 'Incolora',
|
||||||
|
Darkness: 'Oscura',
|
||||||
|
Dragon: 'Dragón',
|
||||||
|
Fairy: 'Hada',
|
||||||
|
Fighting: 'Lucha',
|
||||||
|
Fire: 'Guego',
|
||||||
|
Grass: 'Planta',
|
||||||
|
Lightning: 'Rayo',
|
||||||
|
Metal: 'Metálica',
|
||||||
|
Psychic: 'Psíquico',
|
||||||
|
Water: 'Agua'
|
||||||
|
}
|
||||||
|
},
|
||||||
fr: {
|
fr: {
|
||||||
abilityType: {
|
abilityType: {
|
||||||
'Ability': 'Talent',
|
'Ability': 'Talent',
|
||||||
@ -17,26 +93,27 @@ const translations: Record<string, Record<translatable, Record<string, string>>>
|
|||||||
Trainer: 'Dresseur'
|
Trainer: 'Dresseur'
|
||||||
},
|
},
|
||||||
energyType: {
|
energyType: {
|
||||||
Normal: 'Normal',
|
Normal: 'De base',
|
||||||
Special: 'Spécial'
|
Special: 'Spécial'
|
||||||
},
|
},
|
||||||
rarity: {
|
rarity: {
|
||||||
|
'Amazing': 'Magnifique',
|
||||||
'Common': 'Commune',
|
'Common': 'Commune',
|
||||||
'None': 'Rien',
|
'None': 'Sans Rareté',
|
||||||
'Rare': 'Rare',
|
'Rare': 'Rare',
|
||||||
'Secret Rare': 'Magnifique rare',
|
'Secret Rare': 'Magnifique rare',
|
||||||
'Ultra Rare': 'Ultra Rare',
|
'Ultra Rare': 'Ultra Rare',
|
||||||
'Uncommon': 'Non Commune'
|
'Uncommon': 'Peu Commune'
|
||||||
},
|
},
|
||||||
stage: {
|
stage: {
|
||||||
'BREAK': 'TURBO',
|
'BREAK': 'TURBO',
|
||||||
'Basic': 'Base',
|
'Basic': 'De base',
|
||||||
'LEVEL-UP': 'Niveau Sup',
|
'LEVEL-UP': 'Niveau Sup',
|
||||||
'MEGA': 'MÉGA',
|
'MEGA': 'MÉGA',
|
||||||
'RESTORED': 'RECRÉE',
|
'RESTORED': 'Restauré',
|
||||||
'Stage1': 'Niveau 1',
|
'Stage1': 'Niveau 1',
|
||||||
'Stage2': 'Niveau 2',
|
'Stage2': 'Niveau 2',
|
||||||
'VMAX': 'VMAX'
|
'VMAX': 'ESCOUADE'
|
||||||
},
|
},
|
||||||
suffix: {
|
suffix: {
|
||||||
'EX': 'EX',
|
'EX': 'EX',
|
||||||
@ -49,7 +126,7 @@ const translations: Record<string, Record<translatable, Record<string, string>>>
|
|||||||
},
|
},
|
||||||
trainerType: {
|
trainerType: {
|
||||||
'Ace Spec': 'High-Tech',
|
'Ace Spec': 'High-Tech',
|
||||||
'Goldenred Game Corner': 'Salle de jeu de Doublonville',
|
'Goldenrod Game Corner': 'Salle de jeu de Doublonville',
|
||||||
'Item': 'Objet',
|
'Item': 'Objet',
|
||||||
'Rocket\'s Secret Machine': 'Machine secrète des Rocket',
|
'Rocket\'s Secret Machine': 'Machine secrète des Rocket',
|
||||||
'Stadium': 'Stade',
|
'Stadium': 'Stade',
|
||||||
@ -70,7 +147,6 @@ const translations: Record<string, Record<translatable, Record<string, string>>>
|
|||||||
Psychic: 'Psy',
|
Psychic: 'Psy',
|
||||||
Water: 'Eau'
|
Water: 'Eau'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +154,8 @@ export default function translate(item: translatable, key: string | undefined, l
|
|||||||
if (!key) {
|
if (!key) {
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
if (lang === 'en') {
|
// Temporary trenslations are in english while they are being worked on
|
||||||
|
if (lang === 'en' || !Object.keys(translations).includes(lang)) {
|
||||||
return key
|
return key
|
||||||
}
|
}
|
||||||
const res = translations[lang]?.[item]?.[key]
|
const res = translations[lang]?.[item]?.[key]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user