diff --git a/src/base.ts b/src/base.ts index fea9614..5f70ea4 100644 --- a/src/base.ts +++ b/src/base.ts @@ -347,6 +347,7 @@ const baseTemplate: FullTemplate = { lures: 'lure_', throwTypes: 'throw_type_', pokemonCategories: 'pokemon_categories_', + bonuses: '', questTypes: 'quest_', questConditions: 'quest_condition_', questRewardTypes: 'quest_reward_', @@ -402,6 +403,7 @@ const baseTemplate: FullTemplate = { weather: true, misc: true, pokemonCategories: true, + bonuses: true, quests: true, }, }, diff --git a/src/classes/Translations.ts b/src/classes/Translations.ts index b808558..89309ef 100644 --- a/src/classes/Translations.ts +++ b/src/classes/Translations.ts @@ -178,6 +178,7 @@ export default class Translations extends Masterfile { costumes: {}, descriptions: {}, pokemonCategories: {}, + bonuses: {}, moves: {}, items: {}, questTypes: {}, @@ -657,6 +658,19 @@ export default class Translations extends Masterfile { } } + bonuses(locale: string) { + try { + this.parsedTranslations[locale].bonuses = {} + Object.keys(this.rawTranslations[locale]).forEach((key) => { + if (key.startsWith('spawn_')) { + this.parsedTranslations[locale].bonuses[`${this.options.prefix.bonuses}${key}`] = this.rawTranslations[locale][key] + } + }) + } catch (e) { + console.warn(e, '\n', `Unable to translate bonuses for ${locale}`) + } + } + moves(locale: string) { try { this.parsedTranslations[locale].moves = { diff --git a/src/index.ts b/src/index.ts index dca7642..b51f21a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -466,6 +466,9 @@ export async function generate({ if (translations.template.pokemonCategories) { AllTranslations.pokemonCategories(localeCode) } + if (translations.template.bonuses) { + AllTranslations.bonuses(localeCode) + } if (translations.template.quests) { AllTranslations.quests(localeCode, { questTypes: AllQuests.parsedQuestTypes, diff --git a/src/typings/inputs.ts b/src/typings/inputs.ts index 4518a81..0d97318 100644 --- a/src/typings/inputs.ts +++ b/src/typings/inputs.ts @@ -267,6 +267,7 @@ export interface TranslationsTemplate { weather?: boolean misc?: boolean pokemonCategories?: boolean + bonuses?: boolean quests?: boolean }