From 44414d2a49a44b9567ff6d36e02d157e750e6fb4 Mon Sep 17 00:00:00 2001 From: sudoHG Date: Thu, 8 Oct 2026 22:22:37 +0800 Subject: [PATCH] Fix localized app display names in generated bundle metadata --- ...ManagementAuthenticationProcessTests.swift | 6 ++- Tests/Automation/test_app_info_plist.py | 41 +++++++++++++++++++ docs/testing.md | 1 + scripts/build-app.sh | 6 ++- 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 Tests/Automation/test_app_info_plist.py diff --git a/Tests/AskKeyAppTests/ManagementAuthenticationProcessTests.swift b/Tests/AskKeyAppTests/ManagementAuthenticationProcessTests.swift index 46b9587..960bbb6 100644 --- a/Tests/AskKeyAppTests/ManagementAuthenticationProcessTests.swift +++ b/Tests/AskKeyAppTests/ManagementAuthenticationProcessTests.swift @@ -213,8 +213,10 @@ final class ManagementAuthenticationProcessTests: AskKeyAppTestCase { - CFBundleNameAskKey - CFBundleDisplayNameAskKey + CFBundleNameAsk Key + CFBundleDisplayNameAsk Key + LSHasLocalizedDisplayName + CFBundleDevelopmentRegionen CFBundleExecutableAskKeyApp CFBundleIdentifiercom.sudohg.askkey.auth-test CFBundlePackageTypeAPPL diff --git a/Tests/Automation/test_app_info_plist.py b/Tests/Automation/test_app_info_plist.py new file mode 100644 index 0000000..1331ee6 --- /dev/null +++ b/Tests/Automation/test_app_info_plist.py @@ -0,0 +1,41 @@ +"""Validate the app's display-name plist without invoking the build script.""" + +from pathlib import Path +import plistlib +import re +import subprocess +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[2] +SCRIPT = ROOT / "scripts/build-app.sh" + + +class AppInfoPlistTests(unittest.TestCase): + def test_generated_plist_enables_localized_display_names(self): + source = SCRIPT.read_text(encoding="utf-8") + matches = re.findall( + r'^cat > "\$APP/Contents/Info\.plist" < "$APP/Contents/Info.plist" < - CFBundleNameAskKey - CFBundleDisplayNameAskKey + CFBundleNameAsk Key + CFBundleDisplayNameAsk Key + LSHasLocalizedDisplayName + CFBundleDevelopmentRegionen CFBundleExecutableAskKeyApp CFBundleIdentifier${BUNDLE_ID} CFBundleIconFileAppIcon