feat: add button to open translation guide

This commit is contained in:
KOWX712
2025-06-05 05:17:41 +08:00
parent f1c600df7a
commit c38813cd62
5 changed files with 18 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="system_default">System Default</string>
<string name="more_language">More</string>
<!-- Header -->
<string name="header_title">Tricky Addon</string>
<!-- Help Menu-->

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="system_default">系统默认</string>
<string name="more_language">更多</string>
<!-- Header -->
<string name="header_title">TS 插件</string>
<!-- Help Menu-->

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="system_default">系統預設</string>
<string name="more_language">更多</string>
<!-- Header -->
<string name="header_title">TS 插件</string>
<!-- Help Menu-->

View File

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="language">English</string>
<string name="system_default">System Default</string>
<string name="more_language">More</string>
<!-- Header -->
<string name="header_title">Tricky Addon</string>
<!-- Help Menu-->
<string name="help_help_instructions">Instructions</string>
<string name="help_save_and_update">Save</string>
@@ -28,24 +26,19 @@
<string name="help_set_security_patch_description">Set custom security patch spoof. Auto config will use security patch from PIF module. Leave blank and save to disable auto config.</string>
<string name="help_set_verified_boot_hash">Set Verified Boot Hash</string>
<string name="help_set_verified_boot_hash_description">Get verifiedBootHash value from Key Attestation Demo. Fix abnormal boot state by resetting ro.boot.vbmeta.digest.</string>
<!-- Update -->
<string name="update_update_available">A new version is ready</string>
<string name="update_redirect_to_release">tap to download the latest version</string>
<string name="update_changelog">Changelog</string>
<string name="update_install">Install</string>
<string name="update_reboot">Reboot</string>
<!-- Search -->
<string name="search_bar_search_placeholder">Search</string>
<!-- Functional Button -->
<string name="functional_button_save_and_update_button">Save</string>
<string name="functional_button_uninstall_webui">Uninstall WebUI</string>
<!-- Loading -->
<string name="loading_loading">Loading...</string>
<!-- Menu -->
<string name="menu_refresh">Refresh</string>
<string name="menu_select_all">Select All</string>
@@ -61,21 +54,17 @@
<string name="menu_set_security_patch">Set Security Patch</string>
<string name="menu_about">About</string>
<string name="menu_shortcut">Create home screen shortcut</string>
<!-- Boot Hash -->
<string name="boot_hash_title">Boot Hash</string>
<string name="boot_hash_input_placeholder">Paste your verified Boot Hash here</string>
<string name="boot_hash_save_button">Save</string>
<!-- About -->
<string name="about_module_name_line1">Tricky Addon</string>
<string name="about_module_name_line2">Update Target List</string>
<string name="about_by">by</string>
<string name="about_telegram_channel">Telegram Channel</string>
<string name="about_github">GitHub</string>
<string name="about_disclaimer">This module is not a part of the Tricky Store module. DO NOT report any issues to Tricky Store if encountered.</string>
<string name="about_acknowledgment">Acknowledgment</string>
<!-- Prompt -->
<string name="prompt_no_internet">Please check your Internet connection</string>
<string name="prompt_aosp_key_set">AOSP keybox set successfully</string>
@@ -104,7 +93,6 @@
<string name="prompt_system_app_not_found">System app not found</string>
<string name="prompt_system_app_error">Failed to add system app</string>
<string name="prompt_shortcut_created">Home screen shortcut created</string>
<!-- Security Patch -->
<string name="security_patch_title">Security Patch</string>
<string name="security_patch_advanced_mode">Advanced</string>
@@ -114,6 +102,7 @@
<string name="security_patch_fetching">Fetching...</string>
<string name="security_patch_fetched">Done</string>
<string name="security_patch_get_failed">Failed to fetch security patch date</string>
<string name="security_patch_unable_to_connect">Unable to connect to source.android.com</string>
<string name="security_patch_auto_success">Auto config enabled successfully</string>
<string name="security_patch_auto_failed">Failed to enable auto config</string>
<string name="security_patch_save_success">Security patch saved successfully</string>
@@ -123,15 +112,13 @@
<string name="security_patch_invalid_boot">Invalid boot format</string>
<string name="security_patch_invalid_system">Invalid system format</string>
<string name="security_patch_invalid_vendor">Invalid vendor format</string>
<!-- Add System App -->
<string name="add_system_app_title">Add System App</string>
<string name="add_system_app_add">Add</string>
<string name="add_system_app_current_list">Current System App List</string>
<!-- Uninstall confirmation -->
<string name="confirmation_uninstall_title">Confirm Uninstall?</string>
<string name="confirmation_uninstall_message">Are you sure you want to uninstall Tricky Addon</string>
<string name="confirmation_uninstall_cancel">Cancel</string>
<string name="confirmation_uninstall_confirm">Confirm</string>
</resources>
</resources>

View File

@@ -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);
}