From 536605db113ac7d89e7f2780ffed7a653160a15d Mon Sep 17 00:00:00 2001 From: rnicar Date: Mon, 6 May 2024 19:16:57 +0200 Subject: [PATCH] Natures lang files --- src/data/nature.ts | 5 +++++ src/locales/de/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/en/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/es/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/fr/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/it/nature.ts | 29 +++++++++++++++++++++++++++++ src/plugins/i18n.ts | 22 +++++++++++++++++----- 7 files changed, 167 insertions(+), 5 deletions(-) create mode 100644 src/locales/de/nature.ts create mode 100644 src/locales/en/nature.ts create mode 100644 src/locales/es/nature.ts create mode 100644 src/locales/fr/nature.ts create mode 100644 src/locales/it/nature.ts diff --git a/src/data/nature.ts b/src/data/nature.ts index b18ce5abde7..a8b361674e2 100644 --- a/src/data/nature.ts +++ b/src/data/nature.ts @@ -2,6 +2,7 @@ import { Stat, getStatName } from "./pokemon-stat"; import * as Utils from "../utils"; import { TextStyle, getBBCodeFrag } from "../ui/text"; import { UiTheme } from "#app/enums/ui-theme"; +import i18next from 'i18next'; export enum Nature { HARDY, @@ -33,6 +34,10 @@ export enum Nature { export function getNatureName(nature: Nature, includeStatEffects: boolean = false, forStarterSelect: boolean = false, ignoreBBCode: boolean = false, uiTheme: UiTheme = UiTheme.DEFAULT): string { let ret = Utils.toReadableString(Nature[nature]); + //Translating nature + if(i18next.exists('nature:' + ret)){ + ret = i18next.t('nature:' + ret as any) + } if (includeStatEffects) { const stats = Utils.getEnumValues(Stat).slice(1); let increasedStat: Stat = null; diff --git a/src/locales/de/nature.ts b/src/locales/de/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/de/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/locales/en/nature.ts b/src/locales/en/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/en/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/locales/es/nature.ts b/src/locales/es/nature.ts new file mode 100644 index 00000000000..74f9c017ac8 --- /dev/null +++ b/src/locales/es/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Fuerte", + "Lonely": "Huraña", + "Brave": "Audaz", + "Adamant": "Firme", + "Naughty": "Pícara", + "Bold": "Osada", + "Docile": "Dócil", + "Relaxed": "Plácida", + "Impish": "Agitada", + "Lax": "Floja", + "Timid": "Miedosa", + "Hasty": "Activa", + "Serious": "Seria", + "Jolly": "Alegre", + "Naive": "Ingenua", + "Modest": "Modesta", + "Mild": "Afable", + "Quiet": "Mansa", + "Bashful": "Tímida", + "Rash": "Alocada", + "Calm": "Serena", + "Gentle": "Amable", + "Sassy": "Grosera", + "Careful": "Cauta", + "Quirky": "Rara" +} as const; \ No newline at end of file diff --git a/src/locales/fr/nature.ts b/src/locales/fr/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/fr/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/locales/it/nature.ts b/src/locales/it/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/it/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardy", + "Lonely": "Lonely", + "Brave": "Brave", + "Adamant": "Adamant", + "Naughty": "Naughty", + "Bold": "Bold", + "Docile": "Docile", + "Relaxed": "Relaxed", + "Impish": "Impish", + "Lax": "Lax", + "Timid": "Timid", + "Hasty": "Hasty", + "Serious": "Serious", + "Jolly": "Jolly", + "Naive": "Naive", + "Modest": "Modest", + "Mild": "Mild", + "Quiet": "Quiet", + "Bashful": "Bashful", + "Rash": "Rash", + "Calm": "Calm", + "Gentle": "Gentle", + "Sassy": "Sassy", + "Careful": "Careful", + "Quirky": "Quirky" +} as const; \ No newline at end of file diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 8ad0711f596..3b7afdc092f 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -73,6 +73,12 @@ import { starterSelectUiHandler as frStarterSelectUiHandler } from '../locales/f import { starterSelectUiHandler as itStarterSelectUiHandler} from '../locales/it/starter-select-ui-handler'; import { starterSelectUiHandler as deStarterSelectUiHandler } from '../locales/de/starter-select-ui-handler'; +import { nature as enNature } from '../locales/en/nature'; +import { nature as esNature } from '../locales/es/nature'; +import { nature as frNature } from '../locales/fr/nature'; +import { nature as itNature} from '../locales/it/nature'; +import { nature as deNature } from '../locales/de/nature'; + export interface SimpleTranslationEntries { [key: string]: string } @@ -142,7 +148,8 @@ export function initI18n(): void { commandUiHandler: enCommandUiHandler, fightUiHandler: enFightUiHandler, tutorial: enTutorial, - starterSelectUiHandler: enStarterSelectUiHandler + starterSelectUiHandler: enStarterSelectUiHandler, + nature: enNature }, es: { menu: esMenu, @@ -156,7 +163,8 @@ export function initI18n(): void { commandUiHandler: esCommandUiHandler, fightUiHandler: esFightUiHandler, tutorial: esTutorial, - starterSelectUiHandler: esStarterSelectUiHandler + starterSelectUiHandler: esStarterSelectUiHandler, + nature: esNature }, fr: { menu: frMenu, @@ -170,7 +178,8 @@ export function initI18n(): void { commandUiHandler: frCommandUiHandler, fightUiHandler: frFightUiHandler, tutorial: frTutorial, - starterSelectUiHandler: frStarterSelectUiHandler + starterSelectUiHandler: frStarterSelectUiHandler, + nature: frNature }, it: { menu: itMenu, @@ -184,7 +193,8 @@ export function initI18n(): void { commandUiHandler: itCommandUiHandler, fightUiHandler: itFightUiHandler, tutorial: itTutorial, - starterSelectUiHandler: itStarterSelectUiHandler + starterSelectUiHandler: itStarterSelectUiHandler, + nature: itNature }, de: { menu: deMenu, @@ -198,7 +208,8 @@ export function initI18n(): void { commandUiHandler: deCommandUiHandler, fightUiHandler: deFightUiHandler, tutorial: deTutorial, - starterSelectUiHandler: deStarterSelectUiHandler + starterSelectUiHandler: deStarterSelectUiHandler, + nature: deNature } }, }); @@ -220,6 +231,7 @@ declare module 'i18next' { fightUiHandler: typeof enFightUiHandler; tutorial: typeof enTutorial; starterSelectUiHandler: typeof enStarterSelectUiHandler; + nature: typeof enNature; }; } }