diff --git a/src/i18n/en.json b/src/i18n/en.json index 5378626..5fc32df 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -102,5 +102,13 @@ "template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "Character Stats", "template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "Track Character Stats", "template.trackerEditorModal.presentCharactersTab.characterStatsHint": "Create stats to track for each character (displayed as colored bars)", - "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "Add Character Stat" + "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "Add Character Stat", + "template.mainPanel.title": "RPG Companion", + "template.mainPanel.lastRoll": "Last Roll:", + "template.mainPanel.clearLastRoll": "Clear last roll", + "template.mainPanel.enableImmersiveHtml": "Enable Immersive HTML", + "template.mainPanel.refreshRpgInfo": "Refresh RPG Info", + "template.mainPanel.editTrackersButton": "Edit Trackers", + "template.mainPanel.settingsButton": "Settings", + "global.none": "None" } \ No newline at end of file diff --git a/src/i18n/zh-tw.json b/src/i18n/zh-tw.json index 4d72881..2ef4d2d 100644 --- a/src/i18n/zh-tw.json +++ b/src/i18n/zh-tw.json @@ -18,12 +18,12 @@ "template.settingsModal.theme.statBarLowNote": "屬性在 0% 時的顏色", "template.settingsModal.theme.statBarHigh": "屬性條顏色 (高):", "template.settingsModal.theme.statBarHighNote": "屬性在 100% 時的顏色", - "template.settingsModal.displayTitle": "顯示設定", + "template.settingsModal.displayTitle": "顯示設定", "template.settingsModal.displayNote": "使用擴充功能標籤來啟用/停用 RPG Companion 擴充功能。", "template.settingsModal.display.panelPosition": "面板位置:", "template.settingsModal.display.panelPositionOptions.right": "右側邊欄", "template.settingsModal.display.panelPositionOptions.left": "左側邊欄", - "template.settingsModal.display.toggleAutoUpdate": "訊息後自動更新", + "template.settingsModal.display.toggleAutoUpdate": "訊息後自動更新", "template.settingsModal.display.showUserStats": "顯示 user 屬性", "template.settingsModal.display.showInfoBox": "顯示資訊框", "template.settingsModal.display.showPresentCharacters": "顯示在場角色", @@ -81,7 +81,7 @@ "template.trackerEditorModal.userStatsTab.skillsSectionTitle": "技能欄", "template.trackerEditorModal.userStatsTab.enableSkillsSection": "啟用技能欄", "template.trackerEditorModal.userStatsTab.skillsLabelLabel": "技能欄標籤:", - "template.trackerEditorModal.userStatsTab.skillsListLabel":" 技能列表(以逗號分隔):", + "template.trackerEditorModal.userStatsTab.skillsListLabel": " 技能列表(以逗號分隔):", "template.trackerEditorModal.infoBoxTab.widgetsTitle": "小工具", "template.trackerEditorModal.infoBoxTab.dateWidget": "日期", "template.trackerEditorModal.infoBoxTab.weatherWidget": "天氣", @@ -90,10 +90,10 @@ "template.trackerEditorModal.infoBoxTab.locationWidget": "位置", "template.trackerEditorModal.infoBoxTab.recentEventsWidget": "近期事件", "template.trackerEditorModal.presentCharactersTab.relationshipStatusTitle": "關係狀態", - "template.trackerEditorModal.presentCharactersTab.relationshipStatusHint":"定義關係類型,並在角色頭像上顯示對應的表情符號", + "template.trackerEditorModal.presentCharactersTab.relationshipStatusHint": "定義關係類型,並在角色頭像上顯示對應的表情符號", "template.trackerEditorModal.presentCharactersTab.newRelationshipButton": "新增關係類型", "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorTitle": "外觀與當前行為舉止", - "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint":"角色名稱下方顯示的字段,以 | 分隔。", + "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint": "角色名稱下方顯示的字段,以 | 分隔。", "template.trackerEditorModal.presentCharactersTab.addCustomFieldButton": "添加自訂字段", "template.trackerEditorModal.presentCharactersTab.thoughtsConfigTitle": "內心話配置", "template.trackerEditorModal.presentCharactersTab.enableCharacterThoughts": "啟用角色內心話", @@ -101,6 +101,14 @@ "template.trackerEditorModal.presentCharactersTab.aiInstructionLabel": "內心話提示詞:", "template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "角色屬性", "template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "啟用角色屬性", - "template.trackerEditorModal.presentCharactersTab.characterStatsHint":"建立統計資料以追蹤每個角色(以彩色長條圖顯示)", - "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "添加角色屬性" -} + "template.trackerEditorModal.presentCharactersTab.characterStatsHint": "建立統計資料以追蹤每個角色(以彩色長條圖顯示)", + "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "添加角色屬性", + "template.mainPanel.title": "RPG Companion", + "template.mainPanel.lastRoll": "上次擲骰:", + "template.mainPanel.clearLastRoll": "清除上次擲骰", + "template.mainPanel.enableImmersiveHtml": "啟用沉浸式 HTML", + "template.mainPanel.refreshRpgInfo": "刷新資訊", + "template.mainPanel.editTrackersButton": "追蹤器編輯", + "template.mainPanel.settingsButton": "設定", + "global.none": "None" +} \ No newline at end of file diff --git a/src/systems/features/dice.js b/src/systems/features/dice.js index 92e691b..fe5a0c4 100644 --- a/src/systems/features/dice.js +++ b/src/systems/features/dice.js @@ -9,6 +9,7 @@ import { setPendingDiceRoll } from '../../core/state.js'; import { saveSettings } from '../../core/persistence.js'; +import { i18n } from '../../core/i18n.js'; /** * Rolls the dice and displays result. @@ -85,10 +86,13 @@ export async function executeRollCommand(command) { */ export function updateDiceDisplay() { const lastRoll = extensionSettings.lastDiceRoll; + const label = i18n.getTranslation('template.mainPanel.lastRoll') || 'Last Roll: '; + const noneValue = i18n.getTranslation('global.none') || 'None'; + if (lastRoll) { - $('#rpg-last-roll-text').text(`Last Roll (${lastRoll.formula}): ${lastRoll.total}`); + $('#rpg-last-roll-text').text(`${label}(${lastRoll.formula}): ${lastRoll.total}`); } else { - $('#rpg-last-roll-text').text('Last Roll: None'); + $('#rpg-last-roll-text').text(label + noneValue); } } diff --git a/src/systems/ui/layout.js b/src/systems/ui/layout.js index 38c995c..089cd71 100644 --- a/src/systems/ui/layout.js +++ b/src/systems/ui/layout.js @@ -11,6 +11,7 @@ import { $thoughtsContainer, $inventoryContainer } from '../../core/state.js'; +import { i18n } from '../../core/i18n.js'; /** * Toggles the visibility of plot buttons based on settings. @@ -92,6 +93,7 @@ export function updateCollapseToggleIcon() { */ export function setupCollapseToggle() { const $collapseToggle = $('#rpg-collapse-toggle'); + $collapseToggle.attr('title', i18n.getTranslation('template.mainPanel.collapseExpand')); const $panel = $('#rpg-companion-panel'); const $icon = $collapseToggle.find('i'); diff --git a/src/systems/ui/modals.js b/src/systems/ui/modals.js index 997bf7c..ced6514 100644 --- a/src/systems/ui/modals.js +++ b/src/systems/ui/modals.js @@ -23,6 +23,7 @@ import { updateDiceDisplay as updateDiceDisplayCore, addDiceQuickReply as addDiceQuickReplyCore } from '../features/dice.js'; +import { i18n } from '../../core/i18n.js'; /** * Modern DiceModal ES6 Class @@ -318,6 +319,7 @@ export function setupDiceRoller() { e.stopPropagation(); // Prevent opening the dice popup clearDiceRollCore(); }); + $('#rpg-clear-dice').attr('title', i18n.getTranslation('template.mainPanel.clearLastRoll')); return diceModal; } diff --git a/template.html b/template.html index 4832baa..76af63e 100644 --- a/template.html +++ b/template.html @@ -10,7 +10,7 @@

- RPG Companion + RPG Companion

@@ -18,8 +18,8 @@
- Last Roll: None - + +
@@ -64,22 +64,22 @@