Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/tools/adb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ elif [[ -x "$managed_adb" ]]; then
export ADB_SERVER_SOCKET=tcp:localhost:5039
else
# The first sentence is AlvrWiredFailure.adbMissing, which the app recognizes.
print -u2 "Could not find adb; open Headset in TrailBridge and choose Get Android Platform Tools." \
"In Russian the button is «Скачать Android Platform Tools…»."
print -u2 "Could not find adb; open Headset in TrailBridge and choose Get Android Platform Tools."
exit 1
fi
export ADB_MDNS_AUTO_CONNECT=0
Expand Down
2 changes: 1 addition & 1 deletion streamer/Sources/BasaltManager/AppModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ final class BasaltAppModel: ObservableObject {
}
}

/// «Продолжить» in the network storage question.
/// "Continue" in the network storage question.
func confirmNetworkDataFolder() async {
guard let verdict = networkDataFolder else { return }
networkDataFolder = nil
Expand Down
2 changes: 1 addition & 1 deletion streamer/Sources/BasaltManagerKit/Diagnostics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public struct DiagnosticRedactor: Sendable {
}

/// A pattern for one name as text may spell it: as given, composed or
/// decomposed (file systems differ on "й"), and percent-encoded as in a
/// decomposed (file systems differ on "é"), and percent-encoded as in a
/// file URL.
private static func spellings(of name: String) -> String {
var forms = [name, name.precomposedStringWithCanonicalMapping,
Expand Down
16 changes: 2 additions & 14 deletions streamer/Sources/BasaltManagerKit/Localization/AppLanguage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,8 @@ import Foundation
public enum AppLanguage: String, CaseIterable, Codable, Sendable {
case en, ru, it, de, es, fr, uk, pl, ko, ja

public var nativeName: String {
switch self {
case .en: return "English"
case .ru: return "Русский"
case .it: return "Italiano"
case .de: return "Deutsch"
case .es: return "Español"
case .fr: return "Français"
case .uk: return "Українська"
case .pl: return "Polski"
case .ko: return "한국어"
case .ja: return "日本語"
}
}
/// The language's own name, as its table spells it: "Deutsch", "日本語".
public var nativeName: String { L10n.string(.languageNativeName, language: self) }

public var isReviewed: Bool { self == .en || self == .ru }
public var locale: Locale { Locale(identifier: rawValue) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ public enum L10nKey: String, CaseIterable, Sendable {
case licensesMissing

// MARK: - Settings language
case languageNativeName
case settingsLanguage
case settingsLanguageImmediate
case settingsTranslationNotReviewed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsDE: LocalizationTable {
.licensesTitle: "Lizenzen",
.licensesMissing: "In diesem Build wurde kein Lizenztext gefunden.",
// MARK: - Settings language
.languageNativeName: "Deutsch",
.settingsLanguage: "Sprache",
.settingsLanguageImmediate: "Die Sprache ändert sich sofort.",
.settingsTranslationNotReviewed: "Übersetzung nicht geprüft",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsEN: LocalizationTable {
.licensesTitle: "Licenses",
.licensesMissing: "License text was not found in this build.",
// MARK: - Settings language
.languageNativeName: "English",
.settingsLanguage: "Language",
.settingsLanguageImmediate: "The language changes immediately.",
.settingsTranslationNotReviewed: "translation not reviewed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsES: LocalizationTable {
.licensesTitle: "Licencias",
.licensesMissing: "No se encontró el texto de la licencia en esta compilación.",
// MARK: - Settings language
.languageNativeName: "Español",
.settingsLanguage: "Idioma",
.settingsLanguageImmediate: "El idioma cambia al instante.",
.settingsTranslationNotReviewed: "traducción sin revisar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsFR: LocalizationTable {
.licensesTitle: "Licences",
.licensesMissing: "Le texte de la licence est introuvable dans cette version.",
// MARK: - Settings language
.languageNativeName: "Français",
.settingsLanguage: "Langue",
.settingsLanguageImmediate: "La langue change immédiatement.",
.settingsTranslationNotReviewed: "traduction non relue",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsIT: LocalizationTable {
.licensesTitle: "Licenze",
.licensesMissing: "Il testo della licenza non è stato trovato in questa build.",
// MARK: - Settings language
.languageNativeName: "Italiano",
.settingsLanguage: "Lingua",
.settingsLanguageImmediate: "La lingua cambia subito.",
.settingsTranslationNotReviewed: "traduzione non revisionata",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsJA: LocalizationTable {
.licensesTitle: "ライセンス",
.licensesMissing: "このビルドにライセンスの本文が見つかりません。",
// MARK: - Settings language
.languageNativeName: "日本語",
.settingsLanguage: "言語",
.settingsLanguageImmediate: "言語はすぐに切り替わります。",
.settingsTranslationNotReviewed: "翻訳未レビュー",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsKO: LocalizationTable {
.licensesTitle: "라이선스",
.licensesMissing: "이 빌드에서 라이선스 본문을 찾지 못했어요.",
// MARK: - Settings language
.languageNativeName: "한국어",
.settingsLanguage: "언어",
.settingsLanguageImmediate: "언어가 즉시 변경돼요.",
.settingsTranslationNotReviewed: "검토되지 않은 번역",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsPL: LocalizationTable {
.licensesTitle: "Licencje",
.licensesMissing: "Nie znaleziono tekstu licencji w tej kompilacji.",
// MARK: - Settings language
.languageNativeName: "Polski",
.settingsLanguage: "Język",
.settingsLanguageImmediate: "Język zmienia się od razu.",
.settingsTranslationNotReviewed: "tłumaczenie niesprawdzone",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsRU: LocalizationTable {
.licensesTitle: "Лицензии",
.licensesMissing: "Текст лицензии не найден в этой сборке.",
// MARK: - Settings language
.languageNativeName: "Русский",
.settingsLanguage: "Язык",
.settingsLanguageImmediate: "Язык меняется сразу.",
.settingsTranslationNotReviewed: "перевод не проверен",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ final class StringsUK: LocalizationTable {
.licensesTitle: "Ліцензії",
.licensesMissing: "Текст ліцензії не знайдено в цій збірці.",
// MARK: - Settings language
.languageNativeName: "Українська",
.settingsLanguage: "Мова",
.settingsLanguageImmediate: "Мова змінюється одразу.",
.settingsTranslationNotReviewed: "переклад не перевірено",
Expand Down
52 changes: 8 additions & 44 deletions streamer/Sources/BasaltManagerKit/SteamGameWizard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public struct VerifiedMonth: Equatable, Sendable {
self.month = month
}

/// "November 2026" or "ноябрь 2026 г.", in the app's language.
/// "November 2026" or "listopad 2026", in the app's language.
public func text(locale: Locale) -> String {
var calendar = Calendar(identifier: .gregorian)
calendar.timeZone = TimeZone(secondsFromGMT: 0)!
Expand All @@ -33,8 +33,6 @@ public struct SteamCatalogGame: Identifiable, Equatable, Sendable {
public let name: String
public let appID: String?
public let environmentName: String?
public let status: String
public let note: String
public let needsOpenVR: Bool
/// When the game was last checked in a headset; nil when it never was.
public var verifiedIn: VerifiedMonth? = nil
Expand All @@ -45,32 +43,21 @@ public struct SteamCatalogGame: Identifiable, Equatable, Sendable {

public static let verified: [Self] = [
.init(id: "2669380", name: "BRUTALISTICK VR", appID: "2669380",
environmentName: "brutalistick-vr", status: "Проверена в шлеме",
note: "Проверена на Mac mini M4 и Quest 3: запуск, руки, ходьба — работает стабильно.", needsOpenVR: true,
verifiedIn: november2026),
environmentName: "brutalistick-vr", needsOpenVR: true, verifiedIn: november2026),
.init(id: "1032430", name: "Blood Trail", appID: "1032430",
environmentName: "blood-trail", status: "Проверена в шлеме",
note: "Проверена на Mac mini M4 и Quest 3: уровни, стрельба, частицы, сессия 54 минуты. Направление ходьбы зависит от настройки контроллера; бега на контроллерах нет.", needsOpenVR: true,
verifiedIn: november2026),
environmentName: "blood-trail", needsOpenVR: true, verifiedIn: november2026),
// VTOL VR draws both eyes in one pass; GameCompatibilityFix
// vtolVRSeparateEyePasses makes the right eye work.
.init(id: "667970", name: "VTOL VR", appID: "667970",
environmentName: "vtol-vr", status: "Проверена в шлеме",
note: "Проверена на Mac mini M4 и Quest 3: полёт с ботами, оба глаза. TrailBridge сам меняет настройку отрисовки игры, без неё правый глаз чёрный.", needsOpenVR: true,
verifiedIn: november2026),
environmentName: "vtol-vr", needsOpenVR: true, verifiedIn: november2026),
// BONELAB runs its own OpenXR loader and needs no OpenComposite.
.init(id: "1592190", name: "BONELAB", appID: "1592190",
environmentName: "bonelab", status: "Проверена в шлеме",
note: "Проверена на Mac mini M4 и Quest 3: запуск и игра через собственный OpenXR игры. Проверялась короткими сеансами.", needsOpenVR: false,
verifiedIn: november2026),
environmentName: "bonelab", needsOpenVR: false, verifiedIn: november2026),
.init(id: "629730", name: "Blade & Sorcery", appID: "629730",
environmentName: "blade-sorcery", status: "Проверена в шлеме",
note: "Проверена на Mac mini M4 и Quest 3: меню и игра. Проверялась короткими сеансами.", needsOpenVR: true,
verifiedIn: november2026),
environmentName: "blade-sorcery", needsOpenVR: true, verifiedIn: november2026),
]
public static let other = Self(id: "other", name: "Другая игра", appID: nil,
environmentName: nil, status: "Не проверена",
note: "В TrailBridge эта игра не проверялась. Может не запуститься или работать с ошибками.", needsOpenVR: false)
public static let other = Self(id: "other", name: "Another game", appID: nil,
environmentName: nil, needsOpenVR: false)
public static let all = verified + [other]

public func bottleName(custom: String = "steam-games") throws -> String {
Expand Down Expand Up @@ -373,32 +360,10 @@ public enum SteamTrouble: Equatable, Sendable {

public enum SteamSetupActivity: Equatable {
case installer, updating, timedOut, cancelled, stopped, openingSignIn
public var message: String {
switch self {
case .installer: "Откроется установщик Windows. Пройдите его шаги и сами примите соглашение Steam."
case .updating: "Ждём завершения обновления Steam. После проверки откроем окно входа."
case .timedOut: "За 15 минут обновление не подтвердилось. Проверьте окно Steam и повторите проверку."
case .cancelled: "Установка отменена: Steam не найден. Можно повторить установку."
case .stopped: "Ожидание остановлено. Можно продолжить позже."
case .openingSignIn: "Закрываем Steam и ждём завершения его процессов. Затем попробуем открыть окно входа."
}
}
}

public enum SteamWizardStep: Int, CaseIterable {
case choose = 1, create, prepare, steam, signIn, game, profile, done
public var title: String {
switch self {
case .choose: "Выберите игру"
case .create: "Создайте окружение"
case .prepare: "Подготовьте окружение"
case .steam: "Установите Steam"
case .signIn: "Войдите в Steam"
case .game: "Установите игру"
case .profile: "Добавьте игру в библиотеку"
case .done: "Игра добавлена"
}
}
}

public struct SteamWizardFacts {
Expand Down Expand Up @@ -486,6 +451,5 @@ public struct SteamWizardDiskState: Sendable {
}

public enum SteamWizardCopy {
public static let endToEndCaveat = "Сам мастер пока не проверен от начала до конца на чистом окружении."
public static func failure(_ lead: String, detail: String) -> String { lead + "\n" + detail }
}
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ final class GameFolderCopyTests: XCTestCase {
}

func testFolderNamesFollowWindowsRules() {
for valid in ["Beat Saber", "hello-xr", "hello_xr 2", "Игра", "COM10", "CONSOLE",
for valid in ["Beat Saber", "hello-xr", "hello_xr 2", "ゲーム", "COM10", "CONSOLE",
"a.b", String(repeating: "x", count: GameFolderName.maximumLength)] {
XCTAssertNil(GameFolderName.problem(with: valid), valid)
XCTAssertEqual(try GameFolderName.validate(valid), valid)
Expand Down
4 changes: 2 additions & 2 deletions streamer/Tests/BasaltCoreTests/AlvrControlTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ final class AlvrControlTests: XCTestCase {
"U+\(String(scalar.value, radix: 16))")
}
// An ordinary name is untouched, in any script.
var plain = Self.acceptedPrefix(protocolId: 20, name: "Quest 3 — гостиная")
var plain = Self.acceptedPrefix(protocolId: 20, name: "Quest 3 — salón")
plain.append(0)
guard case .accepted(_, let plainName, _, _) =
try AlvrClientConnectionDecoder.decode(plain) else {
return XCTFail("expected an accepted connection")
}
XCTAssertEqual(plainName, "Quest 3 — гостиная")
XCTAssertEqual(plainName, "Quest 3 — salón")
}

func testDecodesVideoCapabilitiesAndEmbeddedJSON() throws {
Expand Down
2 changes: 1 addition & 1 deletion streamer/Tests/BasaltCoreTests/HeadsetTrustTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ final class DamagedHeadsetTrustTests: XCTestCase {
now: { 0 }, signature: { _ in nil }, read: { _ in [name] })
.accept(hostname: name, ip: "192.0.2.1") { _ in XCTFail("an invalid name is never reported") })
}
for name in ["Quest 3", "Quest-3", "Шлем", "クエスト", "Quest at home"] {
for name in ["Quest 3", "Quest-3", "헤드셋", "クエスト", "Quest at home"] {
XCTAssertTrue(HeadsetTrustStore.validHostname(name), name)
}
}
Expand Down
30 changes: 16 additions & 14 deletions streamer/Tests/BasaltManagerKitTests/DataFolderCheckTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,16 @@ final class DataFolderCheckTests: XCTestCase {
text.replacingOccurrences(of: "\u{00A0}", with: " ").replacingOccurrences(of: "\u{202F}", with: " ")
}
let external = DataFolderVolume(kind: .external, freeBytes: 812_000_000_000)
// The free space is written for the app's language, not always in English units.
L10n.language = .ru
XCTAssertEqual(plain(external.summary), "Внешний диск · свободно 812 ГБ")
XCTAssertEqual(DataFolderVolume(kind: .network, freeBytes: nil).summary, "Сетевое хранилище")
XCTAssertEqual(DataFolderKind.thisMac.name, "Диск этого Mac")
let disk = L10n.string(.dataFolderKindExternal, language: .ru, arguments: [])
let free = Int64(812_000_000_000).formatted(.byteCount(style: .file).locale(Locale(identifier: "ru")))
let summary = L10n.string(.dataFolderKindAndFree, language: .ru, arguments: [disk, free])
XCTAssertEqual(plain(external.summary), plain(summary))
L10n.language = .en
XCTAssertEqual(plain(external.summary), "External disk · 812 GB free")
XCTAssertEqual(DataFolderVolume(kind: .network, freeBytes: nil).summary, "Network storage")
XCTAssertEqual(DataFolderKind.thisMac.name, "This Mac’s disk")
XCTAssertEqual(DataFolderVolume(kind: .thisMac, freeBytes: nil).summary, "This Mac’s disk")
}

Expand All @@ -407,19 +411,17 @@ final class DataFolderCheckTests: XCTestCase {
XCTAssertTrue(DataFolderProblem.fat32.message.contains("FAT32"), "\(language)")
XCTAssertTrue(DataFolderProblem.fat32.message.contains("exFAT"), "\(language)")
}
L10n.language = .ru
L10n.language = .en
XCTAssertEqual(DataFolderProblem.noSymbolicLinks.message,
"Диск с этой папкой не поддерживает символические ссылки, а без них окружения для игр "
+ "не создать. Так бывает в некоторых сетевых папках. Подойдёт диск в формате APFS "
+ "или Mac OS Extended.")
"The disk with this folder does not support symbolic links, and game environments cannot "
+ "be created without them. This happens on some network shares. A disk formatted as APFS "
+ "or Mac OS Extended will work.")
XCTAssertEqual(DataFolderProblem.fat32.message,
"Диск с этой папкой в формате FAT32: в нём нельзя хранить файлы больше 4 ГБ, а у игр "
+ "такие файлы есть. Подойдёт APFS, Mac OS Extended или exFAT.")
XCTAssertTrue(DataFolderProblem.accessDenied.message.contains(
"Системные настройки › Конфиденциальность и безопасность › Файлы и папки"))
L10n.language = .en
XCTAssertTrue(DataFolderProblem.accessDenied.message.contains(
"System Settings › Privacy & Security › Files and Folders"))
"The disk with this folder is formatted as FAT32: it cannot hold files larger than 4 GB, "
+ "and games have such files. APFS, Mac OS Extended or exFAT will work.")
XCTAssertEqual(DataFolderProblem.accessDenied.message,
"macOS does not let TrailBridge use this folder. Allow access in "
+ "System Settings › Privacy & Security › Files and Folders.")
}
}

Expand Down
Loading
Loading