@@ -17,6 +17,7 @@ namespace Microsoft.Extensions.Localization
17
17
/// </summary>
18
18
public class ResourceManagerWithCultureStringLocalizer : ResourceManagerStringLocalizer
19
19
{
20
+ private readonly string _resourceBaseName ;
20
21
private readonly CultureInfo _culture ;
21
22
22
23
/// <summary>
@@ -62,6 +63,12 @@ internal ResourceManagerWithCultureStringLocalizer(
62
63
throw new ArgumentNullException ( nameof ( culture ) ) ;
63
64
}
64
65
66
+ if ( logger == null )
67
+ {
68
+ throw new ArgumentNullException ( nameof ( logger ) ) ;
69
+ }
70
+
71
+ _resourceBaseName = baseName ;
65
72
_culture = culture ;
66
73
}
67
74
@@ -108,6 +115,12 @@ public ResourceManagerWithCultureStringLocalizer(
108
115
throw new ArgumentNullException ( nameof ( culture ) ) ;
109
116
}
110
117
118
+ if ( logger == null )
119
+ {
120
+ throw new ArgumentNullException ( nameof ( logger ) ) ;
121
+ }
122
+
123
+ _resourceBaseName = baseName ;
111
124
_culture = culture ;
112
125
}
113
126
@@ -123,7 +136,7 @@ public override LocalizedString this[string name]
123
136
124
137
var value = GetStringSafely ( name , _culture ) ;
125
138
126
- return new LocalizedString ( name , value ?? name ) ;
139
+ return new LocalizedString ( name , value ?? name , resourceNotFound : value == null , searchedLocation : _resourceBaseName ) ;
127
140
}
128
141
}
129
142
@@ -140,7 +153,7 @@ public override LocalizedString this[string name]
140
153
var format = GetStringSafely ( name , _culture ) ;
141
154
var value = string . Format ( _culture , format ?? name , arguments ) ;
142
155
143
- return new LocalizedString ( name , value ?? name , resourceNotFound : format == null ) ;
156
+ return new LocalizedString ( name , value , resourceNotFound : format == null , searchedLocation : _resourceBaseName ) ;
144
157
}
145
158
}
146
159
0 commit comments