From 91bc9056284a44481fefaad801366e3337268aa5 Mon Sep 17 00:00:00 2001 From: Fin Date: Fri, 5 Sep 2025 10:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=97=A0=E9=9A=9C=E7=A2=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bark/Localizable.xcstrings | 87 +++++++++++++++++++++++ Controller/HomeViewController.swift | 2 + Controller/NewServerViewController.swift | 1 + Controller/ServerListViewController.swift | 1 + View/PreviewCardCell.swift | 13 +++- View/SoundCell.swift | 7 +- 6 files changed, 108 insertions(+), 3 deletions(-) diff --git a/Bark/Localizable.xcstrings b/Bark/Localizable.xcstrings index 35243da..3774afd 100644 --- a/Bark/Localizable.xcstrings +++ b/Bark/Localizable.xcstrings @@ -668,6 +668,35 @@ } } }, + "close" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Close" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "閉じる" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Kapat" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "关闭" + } + } + } + }, "confirm" : { "extractionState" : "manual", "localizations" : { @@ -1363,6 +1392,35 @@ } } }, + "demo" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Demo" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "デモ" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Demo" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "演示" + } + } + } + }, "DeploymentDocuments" : { "extractionState" : "manual", "localizations" : { @@ -3883,6 +3941,35 @@ } } }, + "toggle" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Toggle" + } + }, + "ja" : { + "stringUnit" : { + "state" : "translated", + "value" : "表示切替" + } + }, + "tr" : { + "stringUnit" : { + "state" : "translated", + "value" : "Görünümü Değiştir" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "切换" + } + } + } + }, "unknown" : { "extractionState" : "manual", "localizations" : { diff --git a/Controller/HomeViewController.swift b/Controller/HomeViewController.swift index e0508c0..3b6df74 100644 --- a/Controller/HomeViewController.swift +++ b/Controller/HomeViewController.swift @@ -19,6 +19,7 @@ class HomeViewController: BaseViewController { btn.setImage(Icon.add, for: .normal) btn.imageView?.tintColor = BKColor.grey.darken4 btn.frame = CGRect(x: 0, y: 0, width: 40, height: 40) + btn.accessibilityIdentifier = NSLocalizedString("AddServer") return btn }() @@ -27,6 +28,7 @@ class HomeViewController: BaseViewController { btn.setImage(UIImage(named: "baseline_filter_drama_black_24pt"), for: .normal) btn.imageView?.tintColor = BKColor.grey.darken4 btn.frame = CGRect(x: 0, y: 0, width: 40, height: 40) + btn.accessibilityIdentifier = NSLocalizedString("serverList") return btn }() diff --git a/Controller/NewServerViewController.swift b/Controller/NewServerViewController.swift index df1e9b8..0324944 100644 --- a/Controller/NewServerViewController.swift +++ b/Controller/NewServerViewController.swift @@ -20,6 +20,7 @@ class NewServerViewController: BaseViewController { button.frame = CGRect(x: 0, y: 0, width: 24, height: 24) button.hitTestSlop = UIEdgeInsets(top: -10, left: -10, bottom: -10, right: -10) button.tintColor = BKColor.grey.darken3 + button.isAccessibilityElement = false return button }() diff --git a/Controller/ServerListViewController.swift b/Controller/ServerListViewController.swift index a257d97..4d88862 100644 --- a/Controller/ServerListViewController.swift +++ b/Controller/ServerListViewController.swift @@ -40,6 +40,7 @@ class ServerListViewController: BaseViewController { closeButton.frame = CGRect(x: 0, y: 0, width: 40, height: 40) closeButton.hitTestSlop = UIEdgeInsets(top: -10, left: -10, bottom: -10, right: -10) closeButton.tintColor = BKColor.grey.darken4 + closeButton.accessibilityLabel = NSLocalizedString("close") return closeButton }() diff --git a/View/PreviewCardCell.swift b/View/PreviewCardCell.swift index a6bfb93..f52b51f 100644 --- a/View/PreviewCardCell.swift +++ b/View/PreviewCardCell.swift @@ -10,8 +10,17 @@ import Material import UIKit class PreviewCardCell: BaseTableViewCell { - let previewButton = IconButton(image: Icon.cm.skipForward, tintColor: BKColor.grey.base) - let copyButton = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: BKColor.grey.base) + let previewButton: IconButton = { + let button = IconButton(image: Icon.cm.skipForward, tintColor: BKColor.grey.base) + button.accessibilityLabel = NSLocalizedString("demo") + return button + }() + + let copyButton: IconButton = { + let button = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: BKColor.grey.base) + button.accessibilityLabel = NSLocalizedString("copy") + return button + }() let titleLabel: UILabel = { let label = UILabel() diff --git a/View/SoundCell.swift b/View/SoundCell.swift index 354d6ef..3a0c589 100644 --- a/View/SoundCell.swift +++ b/View/SoundCell.swift @@ -11,7 +11,12 @@ import Material import UIKit class SoundCell: BaseTableViewCell { - let copyButton = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: BKColor.grey.base) + let copyButton: IconButton = { + let button = IconButton(image: UIImage(named: "baseline_file_copy_white_24pt"), tintColor: BKColor.grey.base) + button.accessibilityLabel = NSLocalizedString("copy") + return button + }() + let nameLabel: UILabel = { let label = UILabel() label.fontSize = 14