Separated translation files

Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
Florian Bouillon 2021-06-30 09:24:16 +02:00
parent a64f2e3d01
commit 6140e1463b
Signed by: Florian Bouillon
GPG Key ID: 50BD648F12C86AB6
5 changed files with 424 additions and 146 deletions

View File

@ -9,6 +9,7 @@
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
}
}

View File

@ -1,153 +1,12 @@
import { SupportedLanguages } from 'db/interfaces'
import es from './translations/es.json'
import fr from './translations/fr.json'
type translatable = 'types' | 'rarity' | 'stage' | 'category' | 'suffix' | 'abilityType' | 'trainerType' | 'energyType'
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: {
abilityType: {
'Ability': 'Talent',
'Ancient Trait': 'Trait Antique',
'Poke-BODY': 'Poké-BODY',
'Poke-POWER': 'Poké-POWER',
'Pokemon Power': 'Pouvoir Pokémon'
},
category: {
Energy: 'Énergie',
Pokemon: 'Pokémon',
Trainer: 'Dresseur'
},
energyType: {
Normal: 'De base',
Special: 'Spécial'
},
rarity: {
'Amazing': 'Magnifique',
'Common': 'Commune',
'None': 'Sans Rareté',
'Rare': 'Rare',
'Secret Rare': 'Magnifique rare',
'Ultra Rare': 'Ultra Rare',
'Uncommon': 'Peu Commune'
},
stage: {
'BREAK': 'TURBO',
'Basic': 'De base',
'LEVEL-UP': 'Niveau Sup',
'MEGA': 'MÉGA',
'RESTORED': 'Restauré',
'Stage1': 'Niveau 1',
'Stage2': 'Niveau 2',
'VMAX': 'ESCOUADE'
},
suffix: {
'EX': 'EX',
'GX': 'GX',
'Legend': 'LÉGENDE',
'Prime': 'Prime',
'SP': 'SP',
'TAG TEAM-GX': 'TAG TEAM-GX',
'V': 'V'
},
trainerType: {
'Ace Spec': 'High-Tech',
'Goldenrod Game Corner': 'Salle de jeu de Doublonville',
'Item': 'Objet',
'Rocket\'s Secret Machine': 'Machine secrète des Rocket',
'Stadium': 'Stade',
'Supporter': 'Supporter',
'Technical Machine': 'Machine Technique',
'Tool': 'Outil'
},
types: {
Colorless: 'Incolore',
Darkness: 'Obscurité',
Dragon: 'Dragon',
Fairy: 'Fée',
Fighting: 'Combat',
Fire: 'Feu',
Grass: 'Plante',
Lightning: 'Électrique',
Metal: 'Métal',
Psychic: 'Psy',
Water: 'Eau'
}
}
es,
fr
}
export default function translate(item: translatable, key: string | undefined, lang: SupportedLanguages): string | undefined {

View File

@ -0,0 +1,72 @@
{
"$schema": "./schema.json",
"__comment__": "Missing some abilityTypes and some Trainer Types",
"abilityType": {
"Ability": "Habilidad",
"Ancient Trait": "Ancient Trait",
"Poke-BODY": "Poke-BODY",
"Poke-POWER": "Poke-POWER",
"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": {
"Ace Spec": "Ace Spec",
"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"
}
}

View File

@ -0,0 +1,70 @@
{
"$schema": "./schema.json",
"abilityType": {
"Ability": "Talent",
"Ancient Trait": "Trait Antique",
"Poke-BODY": "Poké-BODY",
"Poke-POWER": "Poké-POWER",
"Pokemon Power": "Pouvoir Pokémon"
},
"category": {
"Energy": "Énergie",
"Pokemon": "Pokémon",
"Trainer": "Dresseur"
},
"energyType": {
"Normal": "De base",
"Special": "Spécial"
},
"rarity": {
"Amazing": "Magnifique",
"Common": "Commune",
"None": "Sans Rareté",
"Rare": "Rare",
"Secret Rare": "Magnifique rare",
"Ultra Rare": "Ultra Rare",
"Uncommon": "Peu Commune"
},
"stage": {
"BREAK": "TURBO",
"Basic": "De base",
"LEVEL-UP": "Niveau Sup",
"MEGA": "MÉGA",
"RESTORED": "Restauré",
"Stage1": "Niveau 1",
"Stage2": "Niveau 2",
"VMAX": "ESCOUADE"
},
"suffix": {
"EX": "EX",
"GX": "GX",
"Legend": "LÉGENDE",
"Prime": "Prime",
"SP": "SP",
"TAG TEAM-GX": "TAG TEAM-GX",
"V": "V"
},
"trainerType": {
"Ace Spec": "High-Tech",
"Goldenrod Game Corner": "Salle de jeu de Doublonville",
"Item": "Objet",
"Rocket's Secret Machine": "Machine secrète des Rocket",
"Stadium": "Stade",
"Supporter": "Supporter",
"Technical Machine": "Machine Technique",
"Tool": "Outil"
},
"types": {
"Colorless": "Incolore",
"Darkness": "Obscurité",
"Dragon": "Dragon",
"Fairy": "Fée",
"Fighting": "Combat",
"Fire": "Feu",
"Grass": "Plante",
"Lightning": "Électrique",
"Metal": "Métal",
"Psychic": "Psy",
"Water": "Eau"
}
}

View File

@ -0,0 +1,276 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"abilityType": {
"type": "object",
"properties": {
"Ability": {
"type": "string"
},
"Ancient Trait": {
"type": "string"
},
"Poke-BODY": {
"type": "string"
},
"Poke-POWER": {
"type": "string"
},
"Pokemon Power": {
"type": "string"
}
},
"required": [
"Ability",
"Ancient Trait",
"Poke-BODY",
"Poke-POWER",
"Pokemon Power"
]
},
"category": {
"type": "object",
"properties": {
"Energy": {
"type": "string"
},
"Pokemon": {
"type": "string"
},
"Trainer": {
"type": "string"
}
},
"required": [
"Energy",
"Pokemon",
"Trainer"
]
},
"energyType": {
"type": "object",
"properties": {
"Normal": {
"type": "string"
},
"Special": {
"type": "string"
}
},
"required": [
"Normal",
"Special"
]
},
"rarity": {
"type": "object",
"properties": {
"Amazing": {
"type": "string"
},
"Common": {
"type": "string"
},
"None": {
"type": "string"
},
"Rare": {
"type": "string"
},
"Secret Rare": {
"type": "string"
},
"Ultra Rare": {
"type": "string"
},
"Uncommon": {
"type": "string"
}
},
"required": [
"Amazing",
"Common",
"None",
"Rare",
"Secret Rare",
"Ultra Rare",
"Uncommon"
]
},
"stage": {
"type": "object",
"properties": {
"BREAK": {
"type": "string"
},
"Basic": {
"type": "string"
},
"LEVEL-UP": {
"type": "string"
},
"MEGA": {
"type": "string"
},
"RESTORED": {
"type": "string"
},
"Stage1": {
"type": "string"
},
"Stage2": {
"type": "string"
},
"VMAX": {
"type": "string"
}
},
"required": [
"BREAK",
"Basic",
"LEVEL-UP",
"MEGA",
"RESTORED",
"Stage1",
"Stage2",
"VMAX"
]
},
"suffix": {
"type": "object",
"properties": {
"EX": {
"type": "string"
},
"GX": {
"type": "string"
},
"Legend": {
"type": "string"
},
"Prime": {
"type": "string"
},
"SP": {
"type": "string"
},
"TAG TEAM-GX": {
"type": "string"
},
"V": {
"type": "string"
}
},
"required": [
"EX",
"GX",
"Legend",
"Prime",
"SP",
"TAG TEAM-GX",
"V"
]
},
"trainerType": {
"type": "object",
"properties": {
"Ace Spec": {
"type": "string"
},
"Goldenrod Game Corner": {
"type": "string"
},
"Item": {
"type": "string"
},
"Rocket's Secret Machine": {
"type": "string"
},
"Stadium": {
"type": "string"
},
"Supporter": {
"type": "string"
},
"Technical Machine": {
"type": "string"
},
"Tool": {
"type": "string"
}
},
"required": [
"Ace Spec",
"Goldenrod Game Corner",
"Item",
"Rocket's Secret Machine",
"Stadium",
"Supporter",
"Technical Machine",
"Tool"
]
},
"types": {
"type": "object",
"properties": {
"Colorless": {
"type": "string"
},
"Darkness": {
"type": "string"
},
"Dragon": {
"type": "string"
},
"Fairy": {
"type": "string"
},
"Fighting": {
"type": "string"
},
"Fire": {
"type": "string"
},
"Grass": {
"type": "string"
},
"Lightning": {
"type": "string"
},
"Metal": {
"type": "string"
},
"Psychic": {
"type": "string"
},
"Water": {
"type": "string"
}
},
"required": [
"Colorless",
"Darkness",
"Dragon",
"Fairy",
"Fighting",
"Fire",
"Grass",
"Lightning",
"Metal",
"Psychic",
"Water"
]
}
},
"required": [
"abilityType",
"category",
"energyType",
"rarity",
"stage",
"suffix",
"trainerType",
"types"
]
}