diff --git a/messages/en.json b/messages/en.json index 19705aa4..81bf0296 100644 --- a/messages/en.json +++ b/messages/en.json @@ -146,5 +146,10 @@ "page_desc_teams": "Save and discover teams to use in Granblue Fantasy", "page_desc_collection": "Manage your character, weapon, and summon collection", "page_desc_profile": "Browse {username}'s teams on granblue.team", - "page_desc_party": "Browse this team for {raidName} by {username} on granblue.team" + "page_desc_party": "Browse this team for {raidName} by {username} on granblue.team", + + "raid_section_farming": "Farming", + "raid_section_raid": "Raid", + "raid_section_event": "Event", + "raid_section_solo": "Solo" } diff --git a/messages/ja.json b/messages/ja.json index 2e6572d2..f6ca8280 100644 --- a/messages/ja.json +++ b/messages/ja.json @@ -146,5 +146,10 @@ "page_desc_teams": "グラブルで使えるチームを見つけて保存しましょう", "page_desc_collection": "キャラ、武器、召喚石のコレクションを管理", "page_desc_profile": "{username}のチームをgranblue.teamで見る", - "page_desc_party": "{raidName}の{username}のチームをgranblue.teamで見る" + "page_desc_party": "{raidName}の{username}のチームをgranblue.teamで見る", + + "raid_section_farming": "周回", + "raid_section_raid": "マルチ", + "raid_section_event": "イベント", + "raid_section_solo": "ソロ" } diff --git a/src/lib/utils/raidSection.ts b/src/lib/utils/raidSection.ts new file mode 100644 index 00000000..62a9bb60 --- /dev/null +++ b/src/lib/utils/raidSection.ts @@ -0,0 +1,33 @@ +/** + * Raid section mapping utilities + */ + +import * as m from '$lib/paraglide/messages' + +export enum RaidSection { + Farming = 0, + Raid = 1, + Event = 2, + Solo = 3 +} + +/** + * Get the localized display name for a raid section + */ +export function getRaidSectionLabel(section: number | string | null | undefined): string { + if (section === null || section === undefined) return '-' + const num = typeof section === 'string' ? parseInt(section, 10) : section + + switch (num) { + case RaidSection.Farming: + return m.raid_section_farming() + case RaidSection.Raid: + return m.raid_section_raid() + case RaidSection.Event: + return m.raid_section_event() + case RaidSection.Solo: + return m.raid_section_solo() + default: + return '-' + } +}