From fe6aefd910a09bc8a21d60b74cf8794f054544e0 Mon Sep 17 00:00:00 2001 From: ArceUseless <36188730+ArceUseless@users.noreply.github.com> Date: Sun, 12 May 2024 04:22:45 +0200 Subject: [PATCH] Natures langs with new config (#611) * Natures lang files * Updated French nature.ts * Nature german translation + chinese added * Added nature to chinese config.ts --------- Co-authored-by: rnicar Co-authored-by: Lugiad Co-authored-by: rnicar245 <55734812+rnicar245@users.noreply.github.com> --- src/data/nature.ts | 5 +++++ src/locales/de/config.ts | 2 ++ src/locales/de/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/en/config.ts | 2 ++ src/locales/en/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/es/config.ts | 2 ++ src/locales/es/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/fr/config.ts | 2 ++ src/locales/fr/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/it/config.ts | 2 ++ src/locales/it/nature.ts | 29 +++++++++++++++++++++++++++++ src/locales/zh_CN/config.ts | 5 ++++- src/locales/zh_CN/nature.ts | 29 +++++++++++++++++++++++++++++ src/plugins/i18n.ts | 1 + 14 files changed, 194 insertions(+), 1 deletion(-) 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 create mode 100644 src/locales/zh_CN/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/config.ts b/src/locales/de/config.ts index e876fa48fc7..2cc7a52c8f1 100644 --- a/src/locales/de/config.ts +++ b/src/locales/de/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const deConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ No newline at end of file diff --git a/src/locales/de/nature.ts b/src/locales/de/nature.ts new file mode 100644 index 00000000000..b6e3d05b8c0 --- /dev/null +++ b/src/locales/de/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Robust", + "Lonely": "Solo", + "Brave": "Mutig", + "Adamant": "Hart", + "Naughty": "Frech", + "Bold": "Kühn", + "Docile": "Sanft", + "Relaxed": "Locker", + "Impish": "Pfiffig", + "Lax": "Lasch", + "Timid": "Scheu", + "Hasty": "Hastig", + "Serious": "Ernst", + "Jolly": "Froh", + "Naive": "Naiv", + "Modest": "Mäßig", + "Mild": "Mild", + "Quiet": "Ruhig", + "Bashful": "Zaghaft", + "Rash": "Hitzig", + "Calm": "Still", + "Gentle": "Zart", + "Sassy": "Forsch", + "Careful": "Sacht", + "Quirky": "Kauzig" +} as const; \ No newline at end of file diff --git a/src/locales/en/config.ts b/src/locales/en/config.ts index d1aa349b728..029791a701c 100644 --- a/src/locales/en/config.ts +++ b/src/locales/en/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const enConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ 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/config.ts b/src/locales/es/config.ts index ecb9538dacd..564b8dd320d 100644 --- a/src/locales/es/config.ts +++ b/src/locales/es/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const esConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ 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/config.ts b/src/locales/fr/config.ts index 5b2668ccc1e..90f9fb83c53 100644 --- a/src/locales/fr/config.ts +++ b/src/locales/fr/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const frConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ 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..0c838138bfe --- /dev/null +++ b/src/locales/fr/nature.ts @@ -0,0 +1,29 @@ +import { SimpleTranslationEntries } from "#app/plugins/i18n"; + +export const nature: SimpleTranslationEntries = { + "Hardy": "Hardi", + "Lonely": "Solo", + "Brave": "Brave", + "Adamant": "Rigide", + "Naughty": "Mauvais", + "Bold": "Assuré", + "Docile": "Docile", + "Relaxed": "Relax", + "Impish": "Malin", + "Lax": "Lâche", + "Timid": "Timide", + "Hasty": "Pressé", + "Serious": "Sérieux", + "Jolly": "Jovial", + "Naive": "Naïf", + "Modest": "Modeste", + "Mild": "Doux", + "Quiet": "Discret", + "Bashful": "Pudique", + "Rash": "Foufou", + "Calm": "Calme", + "Gentle": "Gentil", + "Sassy": "Malpoli", + "Careful": "Prudent", + "Quirky": "Bizarre" +} as const; diff --git a/src/locales/it/config.ts b/src/locales/it/config.ts index d641e66c672..bbfd452dc39 100644 --- a/src/locales/it/config.ts +++ b/src/locales/it/config.ts @@ -6,6 +6,7 @@ import { growth } from "./growth"; import { menu } from "./menu"; import { menuUiHandler } from "./menu-ui-handler"; import { move } from "./move"; +import { nature } from "./nature"; import { pokeball } from "./pokeball"; import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; @@ -26,5 +27,6 @@ export const itConfig = { pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, tutorial: tutorial, + nature: nature, growth: growth } \ 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/locales/zh_CN/config.ts b/src/locales/zh_CN/config.ts index 0d0f1ea5a4c..a8f5f878ba0 100644 --- a/src/locales/zh_CN/config.ts +++ b/src/locales/zh_CN/config.ts @@ -10,6 +10,7 @@ import { pokemon } from "./pokemon"; import { pokemonStat } from "./pokemon-stat"; import { starterSelectUiHandler } from "./starter-select-ui-handler"; import { tutorial } from "./tutorial"; +import { nature } from "./nature"; export const zhCnConfig = { @@ -24,5 +25,7 @@ export const zhCnConfig = { pokemonStat: pokemonStat, pokemon: pokemon, starterSelectUiHandler: starterSelectUiHandler, - tutorial: tutorial + tutorial: tutorial, + + nature: nature } \ No newline at end of file diff --git a/src/locales/zh_CN/nature.ts b/src/locales/zh_CN/nature.ts new file mode 100644 index 00000000000..f29917ff60d --- /dev/null +++ b/src/locales/zh_CN/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 d5a37127eae..763eb8522f5 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -103,6 +103,7 @@ declare module 'i18next' { fightUiHandler: SimpleTranslationEntries; tutorial: SimpleTranslationEntries; starterSelectUiHandler: SimpleTranslationEntries; + nature: SimpleTranslationEntries; growth: SimpleTranslationEntries; }; }