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 { BattleStat, getBattleStatName } from "./battle-stat";
|
||||
import { PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../phases";
|
||||
import { getPokemonMessage } from "../messages";
|
||||
import { getPokemonMessage, getPokemonPrefix } from "../messages";
|
||||
import { Weather, WeatherType } from "./weather";
|
||||
import { BattlerTag } from "./battler-tags";
|
||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||
|
@ -144,7 +144,7 @@ export class BlockRecoilDamageAttr extends AbAttr {
|
|||
}
|
||||
|
||||
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});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 { abilityTriggers } from "./ability-trigger";
|
||||
import { battle } from "./battle";
|
||||
import { commandUiHandler } from "./command-ui-handler";
|
||||
import { fightUiHandler } from "./fight-ui-handler";
|
||||
|
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||
|
||||
export const deConfig = {
|
||||
ability: ability,
|
||||
abilityTriggers: abilityTriggers,
|
||||
battle: battle,
|
||||
commandUiHandler: commandUiHandler,
|
||||
fightUiHandler: fightUiHandler,
|
||||
|
|
|
@ -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 { abilityTriggers } from "./ability-trigger";
|
||||
import { battle } from "./battle";
|
||||
import { commandUiHandler } from "./command-ui-handler";
|
||||
import { fightUiHandler } from "./fight-ui-handler";
|
||||
|
@ -14,8 +15,9 @@ import { starterSelectUiHandler } from "./starter-select-ui-handler";
|
|||
import { tutorial } from "./tutorial";
|
||||
|
||||
|
||||
export const enConfig = {
|
||||
export const enConfig = {
|
||||
ability: ability,
|
||||
abilityTriggers: abilityTriggers,
|
||||
battle: battle,
|
||||
commandUiHandler: commandUiHandler,
|
||||
fightUiHandler: fightUiHandler,
|
||||
|
|
|
@ -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 { abilityTriggers } from "./ability-trigger";
|
||||
import { battle } from "./battle";
|
||||
import { commandUiHandler } from "./command-ui-handler";
|
||||
import { fightUiHandler } from "./fight-ui-handler";
|
||||
|
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||
|
||||
export const esConfig = {
|
||||
ability: ability,
|
||||
abilityTriggers: abilityTriggers,
|
||||
battle: battle,
|
||||
commandUiHandler: commandUiHandler,
|
||||
fightUiHandler: fightUiHandler,
|
||||
|
|
|
@ -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 { abilityTriggers } from "./ability-trigger";
|
||||
import { battle } from "./battle";
|
||||
import { commandUiHandler } from "./command-ui-handler";
|
||||
import { fightUiHandler } from "./fight-ui-handler";
|
||||
|
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||
|
||||
export const frConfig = {
|
||||
ability: ability,
|
||||
abilityTriggers: abilityTriggers,
|
||||
battle: battle,
|
||||
commandUiHandler: commandUiHandler,
|
||||
fightUiHandler: fightUiHandler,
|
||||
|
|
|
@ -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 { abilityTriggers } from "./ability-trigger";
|
||||
import { battle } from "./battle";
|
||||
import { commandUiHandler } from "./command-ui-handler";
|
||||
import { fightUiHandler } from "./fight-ui-handler";
|
||||
|
@ -16,6 +17,7 @@ import { tutorial } from "./tutorial";
|
|||
|
||||
export const itConfig = {
|
||||
ability: ability,
|
||||
abilityTriggers: abilityTriggers,
|
||||
battle: battle,
|
||||
commandUiHandler: commandUiHandler,
|
||||
fightUiHandler: fightUiHandler,
|
||||
|
|
|
@ -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 { abilityTriggers } from "./ability-trigger";
|
||||
import { battle } from "./battle";
|
||||
import { commandUiHandler } from "./command-ui-handler";
|
||||
import { fightUiHandler } from "./fight-ui-handler";
|
||||
|
@ -15,6 +16,7 @@ import { nature } from "./nature";
|
|||
|
||||
export const zhCnConfig = {
|
||||
ability: ability,
|
||||
abilityTriggers: abilityTriggers,
|
||||
battle: battle,
|
||||
commandUiHandler: commandUiHandler,
|
||||
fightUiHandler: fightUiHandler,
|
||||
|
|
|
@ -98,7 +98,8 @@ declare module 'i18next' {
|
|||
menu: SimpleTranslationEntries;
|
||||
menuUiHandler: SimpleTranslationEntries;
|
||||
move: MoveTranslationEntries;
|
||||
battle: SimpleTranslationEntries,
|
||||
battle: SimpleTranslationEntries;
|
||||
abilityTriggers: SimpleTranslationEntries;
|
||||
ability: AbilityTranslationEntries;
|
||||
pokeball: SimpleTranslationEntries;
|
||||
pokemon: SimpleTranslationEntries;
|
||||
|
|
Loading…
Reference in New Issue