mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 16:26:25 +00:00
Added Ability Triggers Localization (#811)
Adds the base files needed to start translating Ability trigger messages. Provides one as an example.
This commit is contained in:
parent
74ee3329f8
commit
1c56efc860
@ -3,7 +3,7 @@ import { Type } from "./type";
|
|||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
import { BattleStat, getBattleStatName } from "./battle-stat";
|
import { BattleStat, getBattleStatName } from "./battle-stat";
|
||||||
import { PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../phases";
|
import { PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../phases";
|
||||||
import { getPokemonMessage } from "../messages";
|
import { getPokemonMessage, getPokemonPrefix } from "../messages";
|
||||||
import { Weather, WeatherType } from "./weather";
|
import { Weather, WeatherType } from "./weather";
|
||||||
import { BattlerTag } from "./battler-tags";
|
import { BattlerTag } from "./battler-tags";
|
||||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||||
@ -144,7 +144,7 @@ export class BlockRecoilDamageAttr extends AbAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]) {
|
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]) {
|
||||||
return getPokemonMessage(pokemon, `'s ${abilityName}\nprotected it from recoil!`);
|
return i18next.t('abilityTriggers:blockRecoilDamage', {pokemonName: `${getPokemonPrefix(pokemon)}${pokemon.name}`, abilityName: abilityName});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
src/locales/de/ability-trigger.ts
Normal file
5
src/locales/de/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const deConfig = {
|
export const deConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
5
src/locales/en/ability-trigger.ts
Normal file
5
src/locales/en/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const enConfig = {
|
export const enConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
5
src/locales/es/ability-trigger.ts
Normal file
5
src/locales/es/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const esConfig = {
|
export const esConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
5
src/locales/fr/ability-trigger.ts
Normal file
5
src/locales/fr/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const frConfig = {
|
export const frConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
5
src/locales/it/ability-trigger.ts
Normal file
5
src/locales/it/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||||||
|
|
||||||
export const itConfig = {
|
export const itConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
5
src/locales/zh_CN/ability-trigger.ts
Normal file
5
src/locales/zh_CN/ability-trigger.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const abilityTriggers: SimpleTranslationEntries = {
|
||||||
|
'blockRecoilDamage' : `{{pokemonName}}'s {{abilityName}}\nprotected it from recoil!`,
|
||||||
|
} as const;
|
@ -1,4 +1,5 @@
|
|||||||
import { ability } from "./ability";
|
import { ability } from "./ability";
|
||||||
|
import { abilityTriggers } from "./ability-trigger";
|
||||||
import { battle } from "./battle";
|
import { battle } from "./battle";
|
||||||
import { commandUiHandler } from "./command-ui-handler";
|
import { commandUiHandler } from "./command-ui-handler";
|
||||||
import { fightUiHandler } from "./fight-ui-handler";
|
import { fightUiHandler } from "./fight-ui-handler";
|
||||||
@ -15,6 +16,7 @@ import { nature } from "./nature";
|
|||||||
|
|
||||||
export const zhCnConfig = {
|
export const zhCnConfig = {
|
||||||
ability: ability,
|
ability: ability,
|
||||||
|
abilityTriggers: abilityTriggers,
|
||||||
battle: battle,
|
battle: battle,
|
||||||
commandUiHandler: commandUiHandler,
|
commandUiHandler: commandUiHandler,
|
||||||
fightUiHandler: fightUiHandler,
|
fightUiHandler: fightUiHandler,
|
||||||
|
@ -98,7 +98,8 @@ declare module 'i18next' {
|
|||||||
menu: SimpleTranslationEntries;
|
menu: SimpleTranslationEntries;
|
||||||
menuUiHandler: SimpleTranslationEntries;
|
menuUiHandler: SimpleTranslationEntries;
|
||||||
move: MoveTranslationEntries;
|
move: MoveTranslationEntries;
|
||||||
battle: SimpleTranslationEntries,
|
battle: SimpleTranslationEntries;
|
||||||
|
abilityTriggers: SimpleTranslationEntries;
|
||||||
ability: AbilityTranslationEntries;
|
ability: AbilityTranslationEntries;
|
||||||
pokeball: SimpleTranslationEntries;
|
pokeball: SimpleTranslationEntries;
|
||||||
pokemon: SimpleTranslationEntries;
|
pokemon: SimpleTranslationEntries;
|
||||||
|
Loading…
Reference in New Issue
Block a user