Files
RememBerBerandCursor 4d1d6ab33a feat(next-macos-native): localize migration, backup, crypto, and core errors
Extend zh/en/ja ToolError coverage for Electron import, workspace validation, favorites, translation words, RSA/SM2 crypto, and remaining Core engines; wire UI language through migration panel and tighten smoke find waits.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:25:14 +08:00

23 lines
798 B
Swift

import Foundation
public struct SavedHostProfile: Codable, Equatable, Identifiable {
public var id = UUID()
public var name: String
public var content: String
public var modified = Date()
public init(name: String, content: String) {
self.name = name
self.content = content
}
public func validate(language: AppLanguage = AppLocalization.preferredLanguage()) throws {
guard !name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else {
throw ToolError(AppLocalization.string("host.error.nameEmpty", language: language))
}
guard name.utf8.count <= 120, content.utf8.count <= 512 * 1024 else {
throw ToolError(AppLocalization.string("host.error.limitExceeded", language: language))
}
}
}