From c38813cd627b739991a7b67cbd8bbba9da31af67 Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Thu, 5 Jun 2025 05:17:41 +0800 Subject: [PATCH] feat: add button to open translation guide --- module/webui/locales/strings/en.xml | 1 + module/webui/locales/strings/zh-CN.xml | 1 + module/webui/locales/strings/zh-TW.xml | 1 + module/webui/locales/template.xml | 21 ++++----------------- module/webui/scripts/language.js | 13 +++++++++++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/module/webui/locales/strings/en.xml b/module/webui/locales/strings/en.xml index 21c6f1c..30a7831 100644 --- a/module/webui/locales/strings/en.xml +++ b/module/webui/locales/strings/en.xml @@ -1,6 +1,7 @@ System Default + More Tricky Addon diff --git a/module/webui/locales/strings/zh-CN.xml b/module/webui/locales/strings/zh-CN.xml index 50d082d..6eb796a 100644 --- a/module/webui/locales/strings/zh-CN.xml +++ b/module/webui/locales/strings/zh-CN.xml @@ -1,6 +1,7 @@ 系统默认 + 更多 TS 插件 diff --git a/module/webui/locales/strings/zh-TW.xml b/module/webui/locales/strings/zh-TW.xml index 4c0937f..a597fa6 100644 --- a/module/webui/locales/strings/zh-TW.xml +++ b/module/webui/locales/strings/zh-TW.xml @@ -1,6 +1,7 @@ 系統預設 + 更多 TS 插件 diff --git a/module/webui/locales/template.xml b/module/webui/locales/template.xml index 7878b03..30a7831 100644 --- a/module/webui/locales/template.xml +++ b/module/webui/locales/template.xml @@ -1,11 +1,9 @@ - + - English System Default - + More Tricky Addon - Instructions Save @@ -28,24 +26,19 @@ Set custom security patch spoof. Auto config will use security patch from PIF module. Leave blank and save to disable auto config. Set Verified Boot Hash Get verifiedBootHash value from Key Attestation Demo. Fix abnormal boot state by resetting ro.boot.vbmeta.digest. - A new version is ready tap to download the latest version Changelog Install Reboot - Search - Save Uninstall WebUI - Loading... - Refresh Select All @@ -61,21 +54,17 @@ Set Security Patch About Create home screen shortcut - Boot Hash Paste your verified Boot Hash here Save - Tricky Addon Update Target List by Telegram Channel - GitHub This module is not a part of the Tricky Store module. DO NOT report any issues to Tricky Store if encountered. Acknowledgment - Please check your Internet connection AOSP keybox set successfully @@ -104,7 +93,6 @@ System app not found Failed to add system app Home screen shortcut created - Security Patch Advanced @@ -114,6 +102,7 @@ Fetching... Done Failed to fetch security patch date + Unable to connect to source.android.com Auto config enabled successfully Failed to enable auto config Security patch saved successfully @@ -123,15 +112,13 @@ Invalid boot format Invalid system format Invalid vendor format - Add System App Add Current System App List - Confirm Uninstall? Are you sure you want to uninstall Tricky Addon Cancel Confirm - \ No newline at end of file + diff --git a/module/webui/scripts/language.js b/module/webui/scripts/language.js index 9a79a7b..7bc2183 100644 --- a/module/webui/scripts/language.js +++ b/module/webui/scripts/language.js @@ -1,4 +1,4 @@ -import { applyRippleEffect } from './main.js'; +import { applyRippleEffect, linkRedirect } from './main.js'; const languageButton = document.querySelector('.language-button'); const languageMenu = document.querySelector('.language-menu'); @@ -45,7 +45,6 @@ async function detectUserLanguage() { const availableData = await availableResponse.json(); availableLanguages = Object.keys(availableData); languageNames = availableData; - await generateLanguageMenu(); // Fetch preferred language const prefered_language_code = localStorage.getItem('trickyAddonLanguage'); @@ -88,6 +87,9 @@ export async function loadTranslations() { } else { translations = baseTranslations; } + + // Generate language menu + await generateLanguageMenu(); } catch (error) { console.error('Error loading translations:', error); translations = baseTranslations; @@ -189,4 +191,11 @@ async function generateLanguageMenu() { button.textContent = name; languageMenu.appendChild(button); }); + + // Add translation guide button + const moreBtn = document.createElement('button'); + moreBtn.classList.add('language-option', 'ripple-element'); + moreBtn.textContent = translations.more_language; + moreBtn.onclick = () => linkRedirect('https://github.com/KOWX712/Tricky-Addon-Update-Target-List/blob/main/module/webui/locales/GUIDE.md'); + languageMenu.appendChild(moreBtn); }