From 76253a95834af9f50d663c2457da52f59c1d104f Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Tue, 17 Jun 2025 10:14:02 +0800 Subject: [PATCH] hostcard localization --- Limelight/HostCardView.m | 8 +- Limelight/Localization/Localizable.xcstrings | 184 ++++++++++++++++--- 2 files changed, 165 insertions(+), 27 deletions(-) diff --git a/Limelight/HostCardView.m b/Limelight/HostCardView.m index 24d8d7f1..63496f75 100644 --- a/Limelight/HostCardView.m +++ b/Limelight/HostCardView.m @@ -262,7 +262,7 @@ static const float REFRESH_CYCLE = 2.0f; // 在线文字 self.statusLabel = [[UILabel alloc] initWithFrame:CGRectMake(205, 68, 100, 24)]; self.statusLabel.translatesAutoresizingMaskIntoConstraints = NO; - self.statusLabel.text = @"Online"; + self.statusLabel.text = [LocalizationHelper localizedStringForKey:@"Online"]; self.statusLabel.font = [UIFont systemFontOfSize:15*_sizeFactor weight:UIFontWeightMedium]; self.statusLabel.textColor = defaultGreen; // self.statusLabel.font = [UIFont systemFontOfSize:16*_sizeFactor]; @@ -510,7 +510,7 @@ static const float REFRESH_CYCLE = 2.0f; case StateOnline: [_hostSpinner stopAnimating]; _statusLabel.textColor = defaultGreen; - _statusLabel.text = @"Online"; + _statusLabel.text = [LocalizationHelper localizedStringForKey:@"Online"]; self.statusIcon.image = [[UIImage imageNamed:@"wifi_green"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; self.statusIcon.hidden = NO; _hostIconView.tintColor = [UIColor whiteColor]; @@ -550,7 +550,7 @@ static const float REFRESH_CYCLE = 2.0f; // _iconBackgroundView.backgroundColor = _userIterfaceStyle == UIUserInterfaceStyleDark ? [UIColor appBackgroundColorDark] : [UIColor appBackgroundColorLight]; _iconBackgroundView.backgroundColor = [ThemeManager appBackgroundColor]; _statusLabel.textColor = [ThemeManager textColorGray]; - _statusLabel.text = @"Offline"; + _statusLabel.text = [LocalizationHelper localizedStringForKey: @"Offline"]; _statusIcon.tintColor = [ThemeManager textColorGray]; if (@available(iOS 13.0, *)) { _statusIcon.image = [UIImage systemImageNamed:@"exclamationmark.triangle.fill"]; @@ -581,7 +581,7 @@ static const float REFRESH_CYCLE = 2.0f; // _iconBackgroundView.backgroundColor = _userIterfaceStyle == UIUserInterfaceStyleDark ? [UIColor appBackgroundColorDark] : [UIColor appBackgroundColorLight]; _iconBackgroundView.backgroundColor = [ThemeManager appPrimaryColorWithAlpha]; _statusLabel.textColor = [ThemeManager textColorGray]; - _statusLabel.text = @"Detecting..."; + _statusLabel.text = [LocalizationHelper localizedStringForKey: @"Detecting..."]; _statusIcon.tintColor = [ThemeManager textColorGray]; if (@available(iOS 13.0, *)) { _statusIcon.image = [UIImage systemImageNamed:@"antenna.radiowaves.left.and.right"]; diff --git a/Limelight/Localization/Localizable.xcstrings b/Limelight/Localization/Localizable.xcstrings index 75ff9e68..63dbda3f 100644 --- a/Limelight/Localization/Localizable.xcstrings +++ b/Limelight/Localization/Localizable.xcstrings @@ -47,6 +47,75 @@ } } }, + " Launch" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : " 启动桌面" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : " 启动桌面" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : " 启动桌面" + } + } + } + }, + " Pair with PIN" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : " 输入PIN码配对" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : " 输入PIN码配对" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : " 输入PIN码配对" + } + } + } + }, + " Wake-on-LAN" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : " 唤醒" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : " 唤醒" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : " 唤醒" + } + } + } + }, " Add Host" : { "extractionState" : "manual", "localizations" : { @@ -427,6 +496,29 @@ } } }, + "Applications" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "选择应用" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "选择应用" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "选择应用" + } + } + } + }, "Back" : { "extractionState" : "manual", "localizations" : { @@ -962,6 +1054,29 @@ } } }, + "Detecting..." : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "检测中…" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "检测中…" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "检测中…" + } + } + } + }, "Disconnect" : { "extractionState" : "manual", "localizations" : { @@ -1681,6 +1796,29 @@ } } }, + "Launch" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "启动桌面" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "启动桌面" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "启动桌面" + } + } + } + }, "Launch App" : { "extractionState" : "manual", "localizations" : { @@ -2234,6 +2372,29 @@ } } }, + "Online" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "在线" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "在线" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "在线" + } + } + } + }, "Online - Not Paired" : { "extractionState" : "manual", "localizations" : { @@ -3701,29 +3862,6 @@ } } }, - "Wake-On-LAN" : { - "extractionState" : "manual", - "localizations" : { - "zh-Hans" : { - "stringUnit" : { - "state" : "translated", - "value" : "Wake-on-LAN" - } - }, - "zh-Hant" : { - "stringUnit" : { - "state" : "translated", - "value" : "Wake-on-LAN" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "Wake-on-LAN" - } - } - } - }, "waterMarkText" : { "extractionState" : "manual", "localizations" : {