diff --git a/src/i18n/en.json b/src/i18n/en.json index 6b47e8d..5378626 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -59,5 +59,48 @@ "template.settingsModal.advanced.customHtmlPromptNote": "Customize the HTML prompt injected when \"Enable Immersive HTML\" is enabled. The default prompt is shown above - you can edit it directly or replace it entirely. Click \"Restore Default\" to reset. This affects all generation modes (together, separate, and plot progression).", "template.settingsModal.advanced.clearCache": "Clear Extension Cache", "template.settingsModal.advanced.resetFabPositions": "Reset Button Positions", - "template.settingsModal.advanced.resetFabPositionsNote": "Resets all floating action buttons (toggle, refresh, debug) to default top-left positions. Useful if buttons are off-screen." + "template.settingsModal.advanced.resetFabPositionsNote": "Resets all floating action buttons (toggle, refresh, debug) to default top-left positions. Useful if buttons are off-screen.", + "template.trackerEditorModal.title": "Edit Trackers", + "template.trackerEditorModal.tabs.userStats": "User Stats", + "template.trackerEditorModal.tabs.infoBox": "Info Box", + "template.trackerEditorModal.tabs.presentCharacters": "Present Characters", + "template.trackerEditorModal.buttons.reset": "Reset to Defaults", + "template.trackerEditorModal.buttons.cancel": "Cancel", + "template.trackerEditorModal.buttons.save": "Save & Apply", + "template.trackerEditorModal.userStatsTab.customStatsTitle": "Custom Stats", + "template.trackerEditorModal.userStatsTab.addCustomStatButton": "Add Custom Stat", + "template.trackerEditorModal.userStatsTab.rpgAttributesTitle": "RPG Attributes", + "template.trackerEditorModal.userStatsTab.enableRpgAttributes": "Enable RPG Attributes Section", + "template.trackerEditorModal.userStatsTab.alwaysIncludeAttributes": "Always Include Attributes in Prompt", + "template.trackerEditorModal.userStatsTab.alwaysIncludeAttributesNote": "If disabled, attributes are only sent when a dice roll is active.", + "template.trackerEditorModal.userStatsTab.addAttributeButton": "Add Attribute", + "template.trackerEditorModal.userStatsTab.statusSectionTitle": "Status Section", + "template.trackerEditorModal.userStatsTab.enableStatusSection": "Enable Status Section", + "template.trackerEditorModal.userStatsTab.showMoodEmoji": "Show Mood Emoji", + "template.trackerEditorModal.userStatsTab.statusFieldsLabel": "Status Fields (comma-separated):", + "template.trackerEditorModal.userStatsTab.skillsSectionTitle": "Skills Section", + "template.trackerEditorModal.userStatsTab.enableSkillsSection": "Enable Skills Section", + "template.trackerEditorModal.userStatsTab.skillsLabelLabel": "Skills Label:", + "template.trackerEditorModal.userStatsTab.skillsListLabel": "Skills List (comma-separated):", + "template.trackerEditorModal.infoBoxTab.widgetsTitle": "Widgets", + "template.trackerEditorModal.infoBoxTab.dateWidget": "Date", + "template.trackerEditorModal.infoBoxTab.weatherWidget": "Weather", + "template.trackerEditorModal.infoBoxTab.temperatureWidget": "Temperature", + "template.trackerEditorModal.infoBoxTab.timeWidget": "Time", + "template.trackerEditorModal.infoBoxTab.locationWidget": "Location", + "template.trackerEditorModal.infoBoxTab.recentEventsWidget": "Recent Events", + "template.trackerEditorModal.presentCharactersTab.relationshipStatusTitle": "Relationship Status Fields", + "template.trackerEditorModal.presentCharactersTab.relationshipStatusHint": "Define relationship types with corresponding emojis shown on character portraits", + "template.trackerEditorModal.presentCharactersTab.newRelationshipButton": "New Relationship", + "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorTitle": "Appearance/Demeanor Fields", + "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint": "Fields shown below character name, separated by |", + "template.trackerEditorModal.presentCharactersTab.addCustomFieldButton": "Add Custom Field", + "template.trackerEditorModal.presentCharactersTab.thoughtsConfigTitle": "Thoughts Configuration", + "template.trackerEditorModal.presentCharactersTab.enableCharacterThoughts": "Enable Character Thoughts", + "template.trackerEditorModal.presentCharactersTab.thoughtsLabelLabel": "Thoughts Label:", + "template.trackerEditorModal.presentCharactersTab.aiInstructionLabel": "AI Instruction:", + "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" } \ No newline at end of file diff --git a/src/i18n/zh-tw.json b/src/i18n/zh-tw.json index c300d1b..4d72881 100644 --- a/src/i18n/zh-tw.json +++ b/src/i18n/zh-tw.json @@ -59,5 +59,48 @@ "template.settingsModal.advanced.customHtmlPromptNote": "自訂啟用“啟用沉浸式 HTML”時注入的 HTML 提示詞。上方顯示預設提示詞 - 您可以直接編輯或完全替換它。點擊“恢復預設”以重置。這會影響所有生成模式(同時、單獨和劇情推進)。", "template.settingsModal.advanced.clearCache": "清除擴充功能快取", "template.settingsModal.advanced.resetFabPositions": "重置按鈕位置", - "template.settingsModal.advanced.resetFabPositionsNote": "將所有浮動操作按鈕(切換、刷新、調試)重置為預設的左上位置。如果按鈕在螢幕外,這會很有用。" + "template.settingsModal.advanced.resetFabPositionsNote": "將所有浮動操作按鈕(切換、刷新、調試)重置為預設的左上位置。如果按鈕在螢幕外,這會很有用。", + "template.trackerEditorModal.title": "追蹤器編輯", + "template.trackerEditorModal.tabs.userStats": "User 屬性", + "template.trackerEditorModal.tabs.infoBox": "資訊框", + "template.trackerEditorModal.tabs.presentCharacters": "在場角色", + "template.trackerEditorModal.buttons.reset": "重置為預設值", + "template.trackerEditorModal.buttons.cancel": "取消", + "template.trackerEditorModal.buttons.save": "保存並應用", + "template.trackerEditorModal.userStatsTab.customStatsTitle": "自訂屬性", + "template.trackerEditorModal.userStatsTab.addCustomStatButton": "添加自訂屬性", + "template.trackerEditorModal.userStatsTab.rpgAttributesTitle": "RPG 屬性", + "template.trackerEditorModal.userStatsTab.enableRpgAttributes": "啟用 RPG 屬性", + "template.trackerEditorModal.userStatsTab.alwaysIncludeAttributes": "始終發送屬性(prompt)", + "template.trackerEditorModal.userStatsTab.alwaysIncludeAttributesNote": "將 RPG 屬性始終包含在提示詞中,即使它們未顯示在面板上也一樣。", + "template.trackerEditorModal.userStatsTab.addAttributeButton": "添加屬性", + "template.trackerEditorModal.userStatsTab.statusSectionTitle": "狀態欄", + "template.trackerEditorModal.userStatsTab.enableStatusSection": "啟用狀態欄", + "template.trackerEditorModal.userStatsTab.showMoodEmoji": "顯示心情emoji", + "template.trackerEditorModal.userStatsTab.statusFieldsLabel": "狀態欄欄位(以逗號分隔):", + "template.trackerEditorModal.userStatsTab.skillsSectionTitle": "技能欄", + "template.trackerEditorModal.userStatsTab.enableSkillsSection": "啟用技能欄", + "template.trackerEditorModal.userStatsTab.skillsLabelLabel": "技能欄標籤:", + "template.trackerEditorModal.userStatsTab.skillsListLabel":" 技能列表(以逗號分隔):", + "template.trackerEditorModal.infoBoxTab.widgetsTitle": "小工具", + "template.trackerEditorModal.infoBoxTab.dateWidget": "日期", + "template.trackerEditorModal.infoBoxTab.weatherWidget": "天氣", + "template.trackerEditorModal.infoBoxTab.temperatureWidget": "溫度", + "template.trackerEditorModal.infoBoxTab.timeWidget": "時間", + "template.trackerEditorModal.infoBoxTab.locationWidget": "位置", + "template.trackerEditorModal.infoBoxTab.recentEventsWidget": "近期事件", + "template.trackerEditorModal.presentCharactersTab.relationshipStatusTitle": "關係狀態", + "template.trackerEditorModal.presentCharactersTab.relationshipStatusHint":"定義關係類型,並在角色頭像上顯示對應的表情符號", + "template.trackerEditorModal.presentCharactersTab.newRelationshipButton": "新增關係類型", + "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorTitle": "外觀與當前行為舉止", + "template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint":"角色名稱下方顯示的字段,以 | 分隔。", + "template.trackerEditorModal.presentCharactersTab.addCustomFieldButton": "添加自訂字段", + "template.trackerEditorModal.presentCharactersTab.thoughtsConfigTitle": "內心話配置", + "template.trackerEditorModal.presentCharactersTab.enableCharacterThoughts": "啟用角色內心話", + "template.trackerEditorModal.presentCharactersTab.thoughtsLabelLabel": "內心話標籤:", + "template.trackerEditorModal.presentCharactersTab.aiInstructionLabel": "內心話提示詞:", + "template.trackerEditorModal.presentCharactersTab.characterStatsTitle": "角色屬性", + "template.trackerEditorModal.presentCharactersTab.trackCharacterStats": "啟用角色屬性", + "template.trackerEditorModal.presentCharactersTab.characterStatsHint":"建立統計資料以追蹤每個角色(以彩色長條圖顯示)", + "template.trackerEditorModal.presentCharactersTab.addCharacterStatButton": "添加角色屬性" } diff --git a/src/systems/ui/trackerEditor.js b/src/systems/ui/trackerEditor.js index 86192ec..0485c73 100644 --- a/src/systems/ui/trackerEditor.js +++ b/src/systems/ui/trackerEditor.js @@ -2,7 +2,7 @@ * Tracker Editor Module * Provides UI for customizing tracker configurations */ - +import { i18n } from '../../core/i18n.js'; import { extensionSettings } from '../../core/state.js'; import { saveSettings } from '../../core/persistence.js'; import { renderUserStats } from '../rendering/userStats.js'; @@ -205,7 +205,7 @@ function renderUserStatsTab() { let html = '
'; // Custom Stats section - html += '

Custom Stats

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.userStatsTab.customStatsTitle')}

`; html += '
'; config.customStats.forEach((stat, index) => { @@ -219,25 +219,25 @@ function renderUserStatsTab() { }); html += '
'; - html += ''; + html += ``; // RPG Attributes section - html += '

RPG Attributes

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.userStatsTab.rpgAttributesTitle')}

`; // Enable/disable toggle for entire RPG Attributes section const showRPGAttributes = config.showRPGAttributes !== undefined ? config.showRPGAttributes : true; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; // Always send attributes toggle const alwaysSendAttributes = config.alwaysSendAttributes !== undefined ? config.alwaysSendAttributes : false; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; - html += 'If disabled, attributes are only sent when a dice roll is active.'; + html += `${i18n.getTranslation('template.trackerEditorModal.userStatsTab.alwaysIncludeAttributesNote')}`; html += '
'; @@ -268,34 +268,34 @@ function renderUserStatsTab() { }); html += '
'; - html += ''; + html += ``; // Status Section - html += '

Status Section

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.userStatsTab.statusSectionTitle')}

`; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; - html += ''; + html += ``; html += ``; // Skills Section - html += '

Skills Section

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.userStatsTab.skillsSectionTitle')}

`; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; - html += ''; + html += ``; html += ``; - html += ''; + html += ``; const skillFields = config.skillsSection.customFields || []; html += ``; @@ -436,12 +436,12 @@ function renderInfoBoxTab() { const config = extensionSettings.trackerConfig.infoBox; let html = '
'; - html += '

Widgets

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.infoBoxTab.widgetsTitle')}

`; // Date widget html += '
'; html += ``; - html += ''; + html += ``; html += '`; - html += ''; + html += ``; html += '
'; // Temperature widget html += '
'; html += ``; - html += ''; + html += ``; html += '
'; html += ``; html += ``; @@ -469,19 +469,19 @@ function renderInfoBoxTab() { // Time widget html += '
'; html += ``; - html += ''; + html += ``; html += '
'; // Location widget html += '
'; html += ``; - html += ''; + html += ``; html += '
'; // Recent Events widget html += '
'; html += ``; - html += ''; + html += ``; html += '
'; html += '
'; @@ -537,8 +537,8 @@ function renderPresentCharactersTab() { let html = '
'; // Relationship Fields Section - html += '

Relationship Status Fields

'; - html += '

Define relationship types with corresponding emojis shown on character portraits

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.relationshipStatusTitle')}

`; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.relationshipStatusHint')}

`; html += '
'; // Show existing relationships as field → emoji pairs @@ -561,11 +561,11 @@ function renderPresentCharactersTab() { `; } html += '
'; - html += ''; + html += ``; // Custom Fields Section - html += '

Appearance/Demeanor Fields

'; - html += '

Fields shown below character name, separated by |

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.appearanceDemeanorTitle')}

`; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.appearanceDemeanorHint')}

`; html += '
'; @@ -585,34 +585,34 @@ function renderPresentCharactersTab() { }); html += '
'; - html += ''; + html += ``; // Thoughts Section - html += '

Thoughts Configuration

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.thoughtsConfigTitle')}

`; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; html += '
'; html += '
'; - html += ''; + html += ``; html += ``; html += '
'; html += '
'; - html += ''; + html += ``; html += ``; html += '
'; html += '
'; // Character Stats - html += '

Character Stats

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.characterStatsTitle')}

`; html += '
'; html += ``; - html += ''; + html += ``; html += '
'; - html += '

Create stats to track for each character (displayed as colored bars)

'; + html += `

${i18n.getTranslation('template.trackerEditorModal.presentCharactersTab.characterStatsHint')}

`; html += '
'; const charStats = config.characterStats?.customStats || []; @@ -627,7 +627,7 @@ function renderPresentCharactersTab() { }); html += '
'; - html += ''; + html += ``; html += '
'; diff --git a/template.html b/template.html index bfe3a9c..4832baa 100644 --- a/template.html +++ b/template.html @@ -375,7 +375,7 @@

- Edit Trackers + Edit Trackers

@@ -383,13 +383,13 @@
@@ -402,12 +402,12 @@