misc: update translation field

This commit is contained in:
KOWX712
2025-05-18 20:51:42 +08:00
parent 4947d00f9d
commit 7058c3cbca
6 changed files with 102 additions and 102 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ saveButton.addEventListener("click", async () => {
}
`, { env: { PATH: "/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:$PATH" } })
.then(() => {
showPrompt("prompt.boot_hash_set");
showPrompt("prompt_boot_hash_set");
closeBootHashMenu();
});
});
+5 -5
View File
@@ -139,10 +139,10 @@ document.getElementById("save").addEventListener("click", () => {
for (const app of appsWithQuestion) {
exec(`sed -i 's/^${app}$/${app}?/' /data/adb/tricky_store/target.txt`);
}
showPrompt("prompt.saved_target");
showPrompt("prompt_saved_target");
refreshAppList();
} else {
showPrompt("prompt.save_error", false);
showPrompt("prompt_save_error", false);
}
});
});
@@ -178,9 +178,9 @@ document.querySelector(".uninstall-container").addEventListener("click", () => {
exec(`sh ${basePath}/common/get_extra.sh --uninstall`)
.then(({ errno }) => {
if (errno === 0) {
showPrompt("prompt.uninstall_prompt");
showPrompt("prompt_uninstall_prompt");
} else {
showPrompt("prompt.uninstall_failed", false);
showPrompt("prompt_uninstall_failed", false);
}
});
})
@@ -197,7 +197,7 @@ function checkMMRL() {
shortcutButton.style.display = 'flex';
shortcutButton.addEventListener('click', () => {
$tricky_store.createShortcut();
showPrompt("prompt.shortcut_created", true);
showPrompt("prompt_shortcut_created", true);
});
}
}
+7 -7
View File
@@ -115,7 +115,7 @@ export async function setupSystemAppMenu() {
exec(`pm list packages -s | grep -q ${packageName}`)
.then(({ errno }) => {
if (errno !== 0) {
showPrompt("prompt.system_app_not_found", false);
showPrompt("prompt_system_app_not_found", false);
} else {
exec(`
touch "/data/adb/tricky_store/system_app"
@@ -193,7 +193,7 @@ KB_EOF
async function aospkb() {
const { stdout } = await exec(`xxd -r -p ${basePath}/common/.default | base64 -d`);
const result = setKeybox(stdout);
showPrompt(result ? "prompt.aosp_key_set" : "prompt.key_set_error", result);
showPrompt(result ? "prompt_aosp_key_set" : "prompt_key_set_error", result);
}
// aosp kb eventlistener
@@ -220,7 +220,7 @@ async function fetchkb(link, fallbackLink) {
})
.then(data => {
if (!data.trim()) {
showPrompt("prompt.no_valid", false);
showPrompt("prompt_no_valid", false);
return;
}
try {
@@ -229,7 +229,7 @@ async function fetchkb(link, fallbackLink) {
const source = atob(decodedHex);
const result = setKeybox(source);
if (result) {
showPrompt("prompt.valid_key_set");
showPrompt("prompt_valid_key_set");
} else {
throw new Error("Failed to copy valid keybox");
}
@@ -238,7 +238,7 @@ async function fetchkb(link, fallbackLink) {
}
})
.catch(async error => {
showPrompt("prompt.no_internet", false);
showPrompt("prompt_no_internet", false);
});
}
@@ -247,7 +247,7 @@ document.getElementById("devicekb").addEventListener("click", async () => {
const output = spawn("sh", [`${basePath}/common/get_extra.sh`, "--unknown-kb"],
{ cwd: "/data/local/tmp", env: { PATH: `$PATH:${basePath}/common`, OPENSSL_CONF: "/dev/null" }});
output.on('exit', (code) => {
showPrompt(code === 0 ? "prompt.unknown_key_set" : "prompt.key_set_error", code === 0);
showPrompt(code === 0 ? "prompt_unknown_key_set" : "prompt_key_set_error", code === 0);
});
});
@@ -338,7 +338,7 @@ async function listFiles(path, skipAnimation = false) {
} else {
const { stdout } = await exec(`cat "${item.path}"`);
const result = setKeybox(stdout);
showPrompt(result ? "prompt.custom_key_set" : "prompt.custom_key_set_error", result);
showPrompt(result ? "prompt_custom_key_set" : "prompt_custom_key_set_error", result);
closeCustomKeyboxSelector();
}
});
+12 -12
View File
@@ -32,7 +32,7 @@ function handleSecurityPatch(mode, value = null) {
rm -f /data/adb/tricky_store/security_patch.txt || true
`).then(({ errno }) => {
const result = errno === 0;
showPrompt(result ? 'security_patch.value_empty' : 'security_patch.save_failed', result);
showPrompt(result ? 'security_patch_value_empty' : 'security_patch_save_failed', result);
return result;
});
} else if (mode === 'manual') {
@@ -42,7 +42,7 @@ function handleSecurityPatch(mode, value = null) {
chmod 644 /data/adb/tricky_store/security_patch.txt
`).then(({ errno }) => {
const result = errno === 0;
showPrompt(result ? 'security_patch.save_success' : 'security_patch.save_failed', result);
showPrompt(result ? 'security_patch_save_success' : 'security_patch_save_failed', result);
return result;
});
}
@@ -221,7 +221,7 @@ export function securityPatch() {
const output = spawn('sh', [`${basePath}/common/get_extra.sh`, '--security-patch']);
output.stdout.on('data', (data) => {
if (data.includes("not set")) {
showPrompt('security_patch.auto_failed', false);
showPrompt('security_patch_auto_failed', false);
}
});
output.on('exit', (code) => {
@@ -234,9 +234,9 @@ export function securityPatch() {
vendorPatchInput.value = '';
checkAdvanced(false);
showPrompt('security_patch.auto_success');
showPrompt('security_patch_auto_success');
} else {
showPrompt('security_patch.auto_failed', false);
showPrompt('security_patch_auto_failed', false);
}
hideSecurityPatchDialog();
loadCurrentConfig();
@@ -255,7 +255,7 @@ export function securityPatch() {
return;
}
if (!isValid8Digit(allValue)) {
showPrompt('security_patch.invalid_all', false);
showPrompt('security_patch_invalid_all', false);
return;
}
const value = `all=${allValue}`;
@@ -280,17 +280,17 @@ export function securityPatch() {
}
if (systemValue && !isValid6Digit(systemValue)) {
showPrompt('security_patch.invalid_system', false);
showPrompt('security_patch_invalid_system', false);
return;
}
if (bootValue && !isValidDateFormat(bootValue)) {
showPrompt('security_patch.invalid_boot', false);
showPrompt('security_patch_invalid_boot', false);
return;
}
if (vendorValue && !isValidDateFormat(vendorValue)) {
showPrompt('security_patch.invalid_vendor', false);
showPrompt('security_patch_invalid_vendor', false);
return;
}
@@ -312,11 +312,11 @@ export function securityPatch() {
// Get button
getButton.addEventListener('click', async () => {
showPrompt('security_patch.fetching');
showPrompt('security_patch_fetching');
const output = spawn('sh', [`${basePath}/common/get_extra.sh`, '--get-security-patch'],
{ env: { PATH: "/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH" }});
output.stdout.on('data', (data) => {
showPrompt('security_patch.fetched', true, 1000);
showPrompt('security_patch_fetched', true, 1000);
checkAdvanced(true);
allPatchInput.value = data.replace(/-/g, '');
@@ -325,7 +325,7 @@ export function securityPatch() {
vendorPatchInput.value = data;
});
output.on('exit', (code) => {
if (code !== 0) showPrompt('security_patch.get_failed', false);
if (code !== 0) showPrompt('security_patch_get_failed', false);
});
});
}
+10 -10
View File
@@ -55,14 +55,14 @@ export async function updateCheck() {
const output = spawn('sh', [`${basePath}/common/get_extra.sh`, '--check-update', `${remoteVersionCode}`]);
output.stdout.on('data', (data) => {
if (data.includes("update")) {
showPrompt("prompt.new_update", true, 1500);
showPrompt("prompt_new_update", true, 1500);
updateCard.style.display = "flex";
setupUpdateMenu();
}
});
} catch (error) {
console.error("Error fetching JSON or executing command:", error);
showPrompt("prompt.no_internet", false);
showPrompt("prompt_no_internet", false);
noConnection.style.display = "flex";
}
}
@@ -123,7 +123,7 @@ function setupUpdateMenu() {
rebootButton.style.display = "flex";
openUpdateMenu();
} else if (stdout.trim().includes("noChangelog")) {
showPrompt("prompt.downloading");
showPrompt("prompt_downloading");
await downloadFile(changelogURL, "changelog.md");
renderChangelog();
openUpdateMenu();
@@ -138,10 +138,10 @@ function setupUpdateMenu() {
download.on('exit', (code) => {
downloading = false;
if (code === 0) {
showPrompt("prompt.downloaded");
showPrompt("prompt_downloaded");
installButton.style.display = "flex";
} else {
showPrompt("prompt.download_fail", false);
showPrompt("prompt_download_fail", false);
}
});
} else {
@@ -159,7 +159,7 @@ function setupUpdateMenu() {
// Install button
installButton.addEventListener('click', async () => {
showPrompt("prompt.installing");
showPrompt("prompt_installing");
const output = spawn('sh', [`${basePath}/common/get_extra.sh`, '--install-update'],
{ env: { PATH: "$PATH:/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk" } });
output.stderr.on('data', (data) => {
@@ -167,11 +167,11 @@ function setupUpdateMenu() {
})
output.on('exit', (code) => {
if (code === 0) {
showPrompt("prompt.installed");
showPrompt("prompt_installed");
installButton.style.display = "none";
rebootButton.style.display = "flex";
} else {
showPrompt("prompt.install_fail", false);
showPrompt("prompt_install_fail", false);
}
});
});
@@ -179,11 +179,11 @@ function setupUpdateMenu() {
// Reboot button
rebootButton.addEventListener('click', async () => {
try {
showPrompt("prompt.rebooting");
showPrompt("prompt_rebooting");
await new Promise(resolve => setTimeout(resolve, 1000));
await exec("svc power reboot");
} catch (error) {
showPrompt("prompt.reboot_fail", false);
showPrompt("prompt_reboot_fail", false);
console.error('Fail to reboot:', error);
}
});