Add French translate

Add French translation and localize hardcoded strings :
Changes
1. Translation Files
Created
src/i18n/fr.json
: Contains all French translations for the extension.
Updated
src/i18n/en.json
: Added new keys for terms that were previously hardcoded (e.g., "Force", "Volonté", "Météo", "Locked", "Unlocked").
2. UI Updates
settings.html
: Added "Français" to the language selection dropdown.
3. Code Refactoring
src/systems/rendering/thoughts.js
: Replaced hardcoded strings ("Add Character", "Locked", "Click to edit") with i18n calls.
src/systems/rendering/userStats.js
: Replaced hardcoded tooltips and titles with i18n calls.
src/systems/rendering/infoBox.js
: Localized weather, location, and date widget texts.
src/systems/ui/trackerEditor.js
: Updated the "Reset to Defaults" logic to use localized names for stats (e.g., "Santé", "Force") based on the active language.
This commit is contained in:
rei
2026-02-18 03:56:18 +01:00
parent 105e20e97a
commit 25aedce786
7 changed files with 770 additions and 449 deletions
+15 -7
View File
@@ -16,26 +16,33 @@
<option value="en" data-i18n-key="settings.language.option.en">English</option>
<option value="zh-tw" data-i18n-key="settings.language.option.zh-tw">繁體中文</option>
<option value="ru" data-i18n-key="settings.language.option.ru">Русский</option>
<option value="fr" data-i18n-key="settings.language.option.fr">Français</option>
</select>
</div>
<small class="notes" data-i18n-key="settings.note">Toggle to enable/disable the RPG Companion extension. Configure additional settings within the panel itself.</small>
<small class="notes" data-i18n-key="settings.note">Toggle to enable/disable the RPG Companion extension.
Configure additional settings within the panel itself.</small>
<div style="margin-top: 10px; display: flex; gap: 10px;">
<a href="https://discord.com/invite/KdAkTg94ME" target="_blank" class="menu_button" style="flex: 1; text-align: center; text-decoration: none;">
<a href="https://discord.com/invite/KdAkTg94ME" target="_blank" class="menu_button"
style="flex: 1; text-align: center; text-decoration: none;">
<i class="fa-brands fa-discord"></i>&nbsp;Discord
</a>
<a href="https://ko-fi.com/marinara_spaghetti" target="_blank" class="menu_button" style="flex: 1; text-align: center; text-decoration: none;">
<a href="https://ko-fi.com/marinara_spaghetti" target="_blank" class="menu_button"
style="flex: 1; text-align: center; text-decoration: none;">
<i class="fa-solid fa-heart"></i>&nbsp;Support
</a>
</div>
<div style="margin-top: 15px; text-align: center; opacity: 0.7; font-size: 0.8em; line-height: 1.5;">
<div style="margin-bottom: 5px;">
<i class="fa-solid fa-microchip"></i> <strong data-i18n="settings.recommendedModels.title">Recommended Models:</strong>
<i class="fa-solid fa-microchip"></i> <strong
data-i18n="settings.recommendedModels.title">Recommended Models:</strong>
</div>
<div style="opacity: 0.8; font-size: 0.9em;" data-i18n="settings.recommendedModels.description">
For the extension to work properly, <strong>it is not recommended to use any models below 20B, especially if they're old.</strong> It works best with the SOTA models such as Deepseek, Claude, GPT, or Gemini.
For the extension to work properly, <strong>it is not recommended to use any models below 20B,
especially if they're old.</strong> It works best with the SOTA models such as Deepseek, Claude,
GPT, or Gemini.
</div>
</div>
@@ -44,7 +51,8 @@
<i class="fa-solid fa-users"></i> <strong>Contributors:</strong>
</div>
<div style="opacity: 0.8; font-size: 0.9em;">
SpicyMarinara, Paperboygold, Munimunigamer, Subarashimo, Lilminzyu, Claude, IDeathByte, Chungchandev, Joenunezb, Amauragis, Tomt610, and Jakstein.
SpicyMarinara, Paperboygold, Munimunigamer, Subarashimo, Lilminzyu, Claude, IDeathByte,
Chungchandev, Joenunezb, Amauragis, Tomt610, and Jakstein.
</div>
</div>
@@ -53,4 +61,4 @@
</div>
</div>
</div>
</div>
</div>