@@ -20,26 +20,41 @@ public static class LocalizationBuilderExtensions
20
20
public static LocalizationBuilder AddLocalization (
21
21
this LocalizationBuilder builder ,
22
22
CultureInfo culture ,
23
- IDictionary < string , string ? > localizations
23
+ IEnumerable < KeyValuePair < string , string ? > > localizations
24
24
)
25
25
{
26
26
builder . AddLocalization ( new LocalizationSet ( default , culture , localizations ) ) ;
27
27
28
28
return builder ;
29
29
}
30
30
31
+ /// <summary>
32
+ /// Adds localized strings from a resource in the calling assembly to the <see cref="LocalizationBuilder"/>.
33
+ /// </summary>
34
+ /// <typeparam name="TResource">The type of the resource.</typeparam>
35
+ /// <param name="builder">The <see cref="LocalizationBuilder"/> to add the localized strings to.</param>
36
+ /// <param name="culture">The culture for which the localized strings are provided.</param>
37
+ /// <returns>The <see cref="LocalizationBuilder"/> with the added localized strings.</returns>
31
38
public static LocalizationBuilder FromResource < TResource > (
32
39
this LocalizationBuilder builder ,
33
40
CultureInfo culture
34
41
)
35
42
{
36
- return builder . FromResource < TResource > ( culture , Assembly . GetCallingAssembly ( ) ) ;
43
+ return builder . FromResource < TResource > ( Assembly . GetCallingAssembly ( ) , culture ) ;
37
44
}
38
45
46
+ /// <summary>
47
+ /// Adds localized strings from a resource in the specified assembly to the <see cref="LocalizationBuilder"/>.
48
+ /// </summary>
49
+ /// <typeparam name="TResource">The type of the resource.</typeparam>
50
+ /// <param name="builder">The <see cref="LocalizationBuilder"/> to add the localized strings to.</param>
51
+ /// <param name="assembly">The assembly that contains the resource.</param>
52
+ /// <param name="culture">The culture for which the localized strings are provided.</param>
53
+ /// <returns>The <see cref="LocalizationBuilder"/> with the added localized strings.</returns>
39
54
public static LocalizationBuilder FromResource < TResource > (
40
55
this LocalizationBuilder builder ,
41
- CultureInfo culture ,
42
- Assembly assembly
56
+ Assembly assembly ,
57
+ CultureInfo culture
43
58
)
44
59
{
45
60
string ? resourceName = typeof ( TResource ) . FullName ;
@@ -52,6 +67,15 @@ Assembly assembly
52
67
return builder . FromResource ( assembly , resourceName , culture ) ;
53
68
}
54
69
70
+ /// <summary>
71
+ /// Adds localized strings from a resource with the specified base name in the specified assembly to the <see cref="LocalizationBuilder"/>.
72
+ /// </summary>
73
+ /// <param name="builder">The <see cref="LocalizationBuilder"/> to add the localized strings to.</param>
74
+ /// <param name="assembly">The assembly that contains the resource.</param>
75
+ /// <param name="baseName">The base name of the resource.</param>
76
+ /// <param name="culture">The culture for which the localized strings are provided.</param>
77
+ /// <returns>The <see cref="LocalizationBuilder"/> with the added localized strings.</returns>
78
+ /// <exception cref="LocalizationBuilderException">Thrown when the resource cannot be found.</exception>
55
79
public static LocalizationBuilder FromResource (
56
80
this LocalizationBuilder builder ,
57
81
Assembly assembly ,
0 commit comments