@@ -9,30 +9,6 @@ import Foundation
9
9
import SwiftUI
10
10
11
11
extension String {
12
- init ( key: StaticString , tableName: String , source: StringResource . Source , developmentValue: String ? ) {
13
- switch source {
14
- case let . hosting( bundle) :
15
- // With fallback to developmentValue
16
- self = NSLocalizedString ( key. description, tableName: tableName, bundle: bundle, value: developmentValue ?? " " , comment: " " )
17
-
18
- case let . selected( bundle, _) :
19
- // Don't use developmentValue with selected bundle/locale
20
- self = NSLocalizedString ( key. description, tableName: tableName, bundle: bundle, value: " " , comment: " " )
21
-
22
- case . none:
23
- self = key. description
24
- }
25
- }
26
-
27
- init ( key: StaticString , tableName: String , source: StringResource . Source , developmentValue: String ? , preferredLanguages: [ String ] ) {
28
- guard let ( bundle, locale) = source. bundle? . firstBundleAndLocale ( tableName: tableName, preferredLanguages: preferredLanguages) else {
29
- self = key. description
30
- return
31
- }
32
-
33
- self . init ( key: key, tableName: tableName, source: . selected( bundle, locale) , developmentValue: developmentValue)
34
- }
35
-
36
12
init ( key: StaticString , tableName: String , source: StringResource . Source , developmentValue: String ? , locale overrideLocale: Locale ? , arguments: [ CVarArg ] ) {
37
13
switch source {
38
14
case let . hosting( bundle) :
@@ -62,11 +38,11 @@ extension String {
62
38
63
39
extension String {
64
40
public init ( resource: StringResource ) {
65
- self . init ( key: resource. key, tableName: resource. tableName, source: resource. source, developmentValue: resource. developmentValue)
41
+ self . init ( key: resource. key, tableName: resource. tableName, source: resource. source, developmentValue: resource. developmentValue, locale : nil , arguments : [ ] )
66
42
}
67
43
68
44
public init ( resource: StringResource , preferredLanguages: [ String ] , locale overrideLocale: Locale ? = nil ) {
69
- self . init ( key: resource. key, tableName: resource. tableName, source: resource. source, developmentValue: resource. developmentValue, preferredLanguages: preferredLanguages)
45
+ self . init ( key: resource. key, tableName: resource. tableName, source: resource. source, developmentValue: resource. developmentValue, preferredLanguages: preferredLanguages, locale : nil , arguments : [ ] )
70
46
}
71
47
72
48
public init < Arg1: CVarArg > ( format resource: StringResource1 < Arg1 > , locale overrideLocale: Locale ? = nil , _ arg1: Arg1 ) {
0 commit comments