From 667a89382078d7b38e6dc21c5627839fbde7f92c Mon Sep 17 00:00:00 2001
From: Ariver <ar@MacBook-Air.local>
Date: Mon, 11 May 2026 11:48:46 +0800
Subject: [PATCH] Archive TagLauncher 5.1.12
---
Apptag/L10n.swift | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/Apptag/L10n.swift b/Apptag/L10n.swift
index 9d6ac8b..9a80d8a 100644
--- a/Apptag/L10n.swift
+++ b/Apptag/L10n.swift
@@ -29,6 +29,18 @@
UserDefaults.standard.set(code, forKey: "appLanguage")
}
+ /// Load a specific key's translation for a given language code without switching.
+ static func loadedTranslation(_ key: String, for code: String) -> String? {
+ guard let url = Bundle.main.url(
+ forResource: code, withExtension: "json",
+ subdirectory: "Localization"
+ ) else { return nil }
+ guard let data = try? Data(contentsOf: url),
+ let dict = try? JSONSerialization.jsonObject(with: data) as? [String: String]
+ else { return nil }
+ return dict[key]
+ }
+
private static func load(_ code: String) {
guard let url = Bundle.main.url(
forResource: code, withExtension: "json",
--
Gitblit v1.9.3