From c8a1b811bffd13dc6dfa39a7c5c0d4ee76cd11e5 Mon Sep 17 00:00:00 2001
From: Ariver <ar@MacBook-Air.local>
Date: Mon, 11 May 2026 12:53:34 +0800
Subject: [PATCH] Release TagLauncher 5.5.0
---
Apptag/L10n.swift | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Apptag/L10n.swift b/Apptag/L10n.swift
index 9a80d8a..d2d3612 100644
--- a/Apptag/L10n.swift
+++ b/Apptag/L10n.swift
@@ -2,6 +2,10 @@
// MARK: - Localization Manager
+extension Notification.Name {
+ static let appLanguageDidChange = Notification.Name("AppLanguageDidChange")
+}
+
enum L10n {
static var current: [String: String] = [:]
private(set) static var currentCode = "en"
@@ -25,8 +29,11 @@
]
static func switchTo(_ code: String) {
+ guard supported.contains(where: { $0.code == code }) else { return }
+ guard code != currentCode else { return }
load(code)
UserDefaults.standard.set(code, forKey: "appLanguage")
+ NotificationCenter.default.post(name: .appLanguageDidChange, object: nil, userInfo: ["code": currentCode])
}
/// Load a specific key's translation for a given language code without switching.
--
Gitblit v1.9.3