add i18next money formatter for MEs

This commit is contained in:
ImperialSympathizer 2024-07-12 16:16:52 -04:00
parent c434d6e04b
commit 515020742d
2 changed files with 10 additions and 2 deletions

View File

@ -86,9 +86,9 @@ export const mysteryEncounter: SimpleTranslationEntries = {
"shady_vitamin_dealer_query": "Which deal will choose?",
"shady_vitamin_dealer_invalid_selection": "Pokémon must be healthy enough.",
"shady_vitamin_dealer_option_1_label": "The Cheap Deal",
"shady_vitamin_dealer_option_1_tooltip": "(-) Pay @[MONEY]{₽{{option1Money, number}}}\n(-) Side Effects?\n(+) Chosen Pokémon Gains 2 Random Vitamins",
"shady_vitamin_dealer_option_1_tooltip": "(-) Pay {{option1Money, money}}\n(-) Side Effects?\n(+) Chosen Pokémon Gains 2 Random Vitamins",
"shady_vitamin_dealer_option_2_label": "The Pricey Deal",
"shady_vitamin_dealer_option_2_tooltip": "(-) Pay @[MONEY]{₽{{option2Money, number}}}\n(-) Side Effects?\n(+) Chosen Pokémon Gains 2 Random Vitamins",
"shady_vitamin_dealer_option_2_tooltip": "(-) Pay {{option2Money, money}}\n(-) Side Effects?\n(+) Chosen Pokémon Gains 2 Random Vitamins",
"shady_vitamin_dealer_option_selected": `The man hands you two bottles and quickly disappears.
\${{selectedPokemon}} gained {{boost1}} and {{boost2}} boosts!`,
"shady_vitamin_dealer_damage_only": `But the medicine had some side effects!

View File

@ -136,6 +136,14 @@ export async function initI18n(): Promise<void> {
postProcess: ["korean-postposition"],
});
// Input: {{myMoneyValue, money}}
// Output: @[MONEY]{₽100,000,000} (useful for BBCode coloring of text)
// If you don't want the BBCode tag applied, just use 'number' formatter
i18next.services.formatter.add("money", (value, lng, options) => {
const numberFormattedString = Intl.NumberFormat(lng, options).format(value);
return `@[MONEY]{₽${numberFormattedString}}`;
});
await initFonts();
}