Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ const baseTemplate: FullTemplate = {
lures: 'lure_',
throwTypes: 'throw_type_',
pokemonCategories: 'pokemon_categories_',
bonuses: '',
questTypes: 'quest_',
questConditions: 'quest_condition_',
questRewardTypes: 'quest_reward_',
Expand Down Expand Up @@ -402,6 +403,7 @@ const baseTemplate: FullTemplate = {
weather: true,
misc: true,
pokemonCategories: true,
bonuses: true,
quests: true,
},
},
Expand Down
14 changes: 14 additions & 0 deletions src/classes/Translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export default class Translations extends Masterfile {
costumes: {},
descriptions: {},
pokemonCategories: {},
bonuses: {},
moves: {},
items: {},
questTypes: {},
Expand Down Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/typings/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export interface TranslationsTemplate {
weather?: boolean
misc?: boolean
pokemonCategories?: boolean
bonuses?: boolean
quests?: boolean
}

Expand Down
Loading