Use localization for damaging weather messages (#1017)

This commit is contained in:
Calvin Keats 2024-05-17 05:25:21 -05:00 committed by GitHub
parent 0c660f599d
commit 4362d49e6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import { Biome } from "./enums/biome"; import { Biome } from "./enums/biome";
import { getPokemonMessage } from "../messages"; import { getPokemonMessage, getPokemonPrefix } from "../messages";
import Pokemon from "../field/pokemon"; import Pokemon from "../field/pokemon";
import { Type } from "./type"; import { Type } from "./type";
import Move, { AttackMove } from "./move"; import Move, { AttackMove } from "./move";
@ -172,9 +172,9 @@ export function getWeatherLapseMessage(weatherType: WeatherType): string {
export function getWeatherDamageMessage(weatherType: WeatherType, pokemon: Pokemon): string { export function getWeatherDamageMessage(weatherType: WeatherType, pokemon: Pokemon): string {
switch (weatherType) { switch (weatherType) {
case WeatherType.SANDSTORM: case WeatherType.SANDSTORM:
return getPokemonMessage(pokemon, ' is buffeted\nby the sandstorm!'); return i18next.t('weather:sandstormDamageMessage', {pokemonPrefix: getPokemonPrefix(pokemon), pokemonName: pokemon.name});
case WeatherType.HAIL: case WeatherType.HAIL:
return getPokemonMessage(pokemon, ' is pelted\nby the hail!'); return i18next.t('weather:hailDamageMessage', {pokemonPrefix: getPokemonPrefix(pokemon), pokemonName: pokemon.name});
} }
return null; return null;