16 lines
680 B
Swift
16 lines
680 B
Swift
// SPDX-FileCopyrightText: 2026 Kaede Akino
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
extension LocalizedStringResource {
|
|
/// Bridges resource-backed copy to SwiftUI APIs that accept keys on our
|
|
/// minimum OS versions. Resource interpolation preserves its localization
|
|
/// metadata; converting the resource to an ordinary String would lose it.
|
|
/// APIs with a `LocalizedStringResource` overload, notably
|
|
/// `alert` and `confirmationDialog`, should receive the resource directly because
|
|
/// UIKit-backed presentations can expose interpolated locale metadata.
|
|
public var swiftUIKey: LocalizedStringKey { "\(self)" }
|
|
}
|