4 <name>Microsoft.Extensions.Localization</name>
7 <member name="T:Microsoft.Extensions.Localization.IResourceNamesCache">
9 Represents a cache of string names in resources.
12 <member name="M:Microsoft.Extensions.Localization.IResourceNamesCache.GetOrAdd(System.String,System.Func{System.String,System.Collections.Generic.IList{System.String}})">
14 Adds a set of resource names to the cache by using the specified function, if the name does not already exist.
16 <param name="name">The resource name to add string names for.</param>
17 <param name="valueFactory">The function used to generate the string names for the resource.</param>
18 <returns>The string names for the resource.</returns>
20 <member name="T:Microsoft.Extensions.Localization.LocalizationOptions">
22 Provides programmatic configuration for localization.
25 <member name="P:Microsoft.Extensions.Localization.LocalizationOptions.ResourcesPath">
27 The relative path under application root where resource files are located.
30 <member name="P:Microsoft.Extensions.Localization.Resources.Localization_MissingManifest">
32 The manifest '{0}' was not found.
35 <member name="M:Microsoft.Extensions.Localization.Resources.FormatLocalization_MissingManifest(System.Object)">
37 The manifest '{0}' was not found.
40 <member name="P:Microsoft.Extensions.Localization.Resources.Localization_MissingManifest_Parent">
42 No manifests exist for the current culture.
45 <member name="M:Microsoft.Extensions.Localization.Resources.FormatLocalization_MissingManifest_Parent">
47 No manifests exist for the current culture.
50 <member name="T:Microsoft.Extensions.Localization.ResourceLocationAttribute">
52 Provides the location of resources for an Assembly.
55 <member name="M:Microsoft.Extensions.Localization.ResourceLocationAttribute.#ctor(System.String)">
57 Creates a new <see cref="T:Microsoft.Extensions.Localization.ResourceLocationAttribute"/>.
59 <param name="resourceLocation">The location of resources for this Assembly.</param>
61 <member name="P:Microsoft.Extensions.Localization.ResourceLocationAttribute.ResourceLocation">
63 The location of resources for this Assembly.
66 <member name="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer">
68 An <see cref="T:Microsoft.Extensions.Localization.IStringLocalizer"/> that uses the <see cref="T:System.Resources.ResourceManager"/> and
69 <see cref="T:System.Resources.ResourceReader"/> to provide localized strings.
71 <remarks>This type is thread-safe.</remarks>
73 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.#ctor(System.Resources.ResourceManager,System.Reflection.Assembly,System.String,Microsoft.Extensions.Localization.IResourceNamesCache,Microsoft.Extensions.Logging.ILogger)">
75 Creates a new <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.
77 <param name="resourceManager">The <see cref="T:System.Resources.ResourceManager"/> to read strings from.</param>
78 <param name="resourceAssembly">The <see cref="T:System.Reflection.Assembly"/> that contains the strings as embedded resources.</param>
79 <param name="baseName">The base name of the embedded resource that contains the strings.</param>
80 <param name="resourceNamesCache">Cache of the list of strings for a given resource assembly name.</param>
81 <param name="logger">The <see cref="T:Microsoft.Extensions.Logging.ILogger"/>.</param>
83 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.#ctor(System.Resources.ResourceManager,Microsoft.Extensions.Localization.Internal.AssemblyWrapper,System.String,Microsoft.Extensions.Localization.IResourceNamesCache,Microsoft.Extensions.Logging.ILogger)">
85 Intended for testing purposes only.
88 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.#ctor(System.Resources.ResourceManager,Microsoft.Extensions.Localization.Internal.IResourceStringProvider,System.String,Microsoft.Extensions.Localization.IResourceNamesCache,Microsoft.Extensions.Logging.ILogger)">
90 Intended for testing purposes only.
93 <member name="P:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.Item(System.String)">
96 <member name="P:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.Item(System.String,System.Object[])">
99 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.WithCulture(System.Globalization.CultureInfo)">
101 Creates a new <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/> for a specific <see cref="T:System.Globalization.CultureInfo"/>.
103 <param name="culture">The <see cref="T:System.Globalization.CultureInfo"/> to use.</param>
104 <returns>A culture-specific <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.</returns>
106 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.GetAllStrings(System.Boolean)">
109 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.GetAllStrings(System.Boolean,System.Globalization.CultureInfo)">
111 Returns all strings in the specified culture.
113 <param name="includeParentCultures"></param>
114 <param name="culture">The <see cref="T:System.Globalization.CultureInfo"/> to get strings for.</param>
115 <returns>The strings.</returns>
117 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer.GetStringSafely(System.String,System.Globalization.CultureInfo)">
119 Gets a resource string from the <see cref="F:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer._resourceManager"/> and returns <c>null</c> instead of
120 throwing exceptions if a match isn't found.
122 <param name="name">The name of the string resource.</param>
123 <param name="culture">The <see cref="T:System.Globalization.CultureInfo"/> to get the string for.</param>
124 <returns>The resource string, or <c>null</c> if none was found.</returns>
126 <member name="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory">
128 An <see cref="T:Microsoft.Extensions.Localization.IStringLocalizerFactory"/> that creates instances of <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.
131 <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory"/> offers multiple ways to set the relative path of
132 resources to be used. They are, in order of precedence:
133 <see cref="T:Microsoft.Extensions.Localization.ResourceLocationAttribute"/> -> <see cref="P:Microsoft.Extensions.Localization.LocalizationOptions.ResourcesPath"/> -> the project root.
136 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.#ctor(Microsoft.Extensions.Options.IOptions{Microsoft.Extensions.Localization.LocalizationOptions},Microsoft.Extensions.Logging.ILoggerFactory)">
138 Creates a new <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.
140 <param name="localizationOptions">The <see cref="T:Microsoft.Extensions.Options.IOptions`1"/>.</param>
141 <param name="loggerFactory">The <see cref="T:Microsoft.Extensions.Logging.ILoggerFactory"/>.</param>
143 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.GetResourcePrefix(System.Reflection.TypeInfo)">
145 Gets the resource prefix used to look up the resource.
147 <param name="typeInfo">The type of the resource to be looked up.</param>
148 <returns>The prefix for resource lookup.</returns>
150 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.GetResourcePrefix(System.Reflection.TypeInfo,System.String,System.String)">
152 Gets the resource prefix used to look up the resource.
154 <param name="typeInfo">The type of the resource to be looked up.</param>
155 <param name="baseNamespace">The base namespace of the application.</param>
156 <param name="resourcesRelativePath">The folder containing all resources.</param>
157 <returns>The prefix for resource lookup.</returns>
159 For the type "Sample.Controllers.Home" if there's a resourceRelativePath return
160 "Sample.Resourcepath.Controllers.Home" if there isn't one then it would return "Sample.Controllers.Home".
163 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.GetResourcePrefix(System.String,System.String)">
165 Gets the resource prefix used to look up the resource.
167 <param name="baseResourceName">The name of the resource to be looked up</param>
168 <param name="baseNamespace">The base namespace of the application.</param>
169 <returns>The prefix for resource lookup.</returns>
171 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.Create(System.Type)">
173 Creates a <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/> using the <see cref="T:System.Reflection.Assembly"/> and
174 <see cref="P:System.Type.FullName"/> of the specified <see cref="T:System.Type"/>.
176 <param name="resourceSource">The <see cref="T:System.Type"/>.</param>
177 <returns>The <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.</returns>
179 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.Create(System.String,System.String)">
181 Creates a <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.
183 <param name="baseName">The base name of the resource to load strings from.</param>
184 <param name="location">The location to load resources from.</param>
185 <returns>The <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/>.</returns>
187 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.CreateResourceManagerStringLocalizer(System.Reflection.Assembly,System.String)">
188 <summary>Creates a <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/> for the given input.</summary>
189 <param name="assembly">The assembly to create a <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/> for.</param>
190 <param name="baseName">The base name of the resource to search for.</param>
191 <returns>A <see cref="T:Microsoft.Extensions.Localization.ResourceManagerStringLocalizer"/> for the given <paramref name="assembly"/> and <paramref name="baseName"/>.</returns>
192 <remarks>This method is virtual for testing purposes only.</remarks>
194 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.GetResourcePrefix(System.String,System.String,System.String)">
196 Gets the resource prefix used to look up the resource.
198 <param name="location">The general location of the resource.</param>
199 <param name="baseName">The base name of the resource.</param>
200 <param name="resourceLocation">The location of the resource within <paramref name="location"/>.</param>
201 <returns>The resource prefix used to look up the resource.</returns>
203 <member name="M:Microsoft.Extensions.Localization.ResourceManagerStringLocalizerFactory.GetResourceLocationAttribute(System.Reflection.Assembly)">
204 <summary>Gets a <see cref="T:Microsoft.Extensions.Localization.ResourceLocationAttribute"/> from the provided <see cref="T:System.Reflection.Assembly"/>.</summary>
205 <param name="assembly">The assembly to get a <see cref="T:Microsoft.Extensions.Localization.ResourceLocationAttribute"/> from.</param>
206 <returns>The <see cref="T:Microsoft.Extensions.Localization.ResourceLocationAttribute"/> associated with the given <see cref="T:System.Reflection.Assembly"/>.</returns>
207 <remarks>This method is protected and virtual for testing purposes only.</remarks>
209 <member name="T:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer">
211 An <see cref="T:Microsoft.Extensions.Localization.IStringLocalizer"/> that uses the <see cref="T:System.Resources.ResourceManager"/> and
212 <see cref="T:System.Resources.ResourceReader"/> to provide localized strings for a specific <see cref="T:System.Globalization.CultureInfo"/>.
215 <member name="M:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer.#ctor(System.Resources.ResourceManager,Microsoft.Extensions.Localization.Internal.IResourceStringProvider,System.String,Microsoft.Extensions.Localization.IResourceNamesCache,System.Globalization.CultureInfo,Microsoft.Extensions.Logging.ILogger)">
217 Creates a new <see cref="T:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer"/>.
219 <param name="resourceManager">The <see cref="T:System.Resources.ResourceManager"/> to read strings from.</param>
220 <param name="resourceStringProvider">The <see cref="T:Microsoft.Extensions.Localization.Internal.IResourceStringProvider"/> that can find the resources.</param>
221 <param name="baseName">The base name of the embedded resource that contains the strings.</param>
222 <param name="resourceNamesCache">Cache of the list of strings for a given resource assembly name.</param>
223 <param name="culture">The specific <see cref="T:System.Globalization.CultureInfo"/> to use.</param>
224 <param name="logger">The <see cref="T:Microsoft.Extensions.Logging.ILogger"/>.</param>
226 <member name="M:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer.#ctor(System.Resources.ResourceManager,System.Reflection.Assembly,System.String,Microsoft.Extensions.Localization.IResourceNamesCache,System.Globalization.CultureInfo,Microsoft.Extensions.Logging.ILogger)">
228 Creates a new <see cref="T:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer"/>.
230 <param name="resourceManager">The <see cref="T:System.Resources.ResourceManager"/> to read strings from.</param>
231 <param name="resourceAssembly">The <see cref="T:System.Reflection.Assembly"/> that contains the strings as embedded resources.</param>
232 <param name="baseName">The base name of the embedded resource that contains the strings.</param>
233 <param name="resourceNamesCache">Cache of the list of strings for a given resource assembly name.</param>
234 <param name="culture">The specific <see cref="T:System.Globalization.CultureInfo"/> to use.</param>
235 <param name="logger">The <see cref="T:Microsoft.Extensions.Logging.ILogger"/>.</param>
237 <member name="P:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer.Item(System.String)">
240 <member name="P:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer.Item(System.String,System.Object[])">
243 <member name="M:Microsoft.Extensions.Localization.ResourceManagerWithCultureStringLocalizer.GetAllStrings(System.Boolean)">
246 <member name="T:Microsoft.Extensions.Localization.ResourceNamesCache">
248 An implementation of <see cref="T:Microsoft.Extensions.Localization.IResourceNamesCache"/> backed by a <see cref="T:System.Collections.Concurrent.ConcurrentDictionary`2"/>.
251 <member name="M:Microsoft.Extensions.Localization.ResourceNamesCache.GetOrAdd(System.String,System.Func{System.String,System.Collections.Generic.IList{System.String}})">
254 <member name="T:Microsoft.Extensions.DependencyInjection.LocalizationServiceCollectionExtensions">
256 Extension methods for setting up localization services in an <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" />.
259 <member name="M:Microsoft.Extensions.DependencyInjection.LocalizationServiceCollectionExtensions.AddLocalization(Microsoft.Extensions.DependencyInjection.IServiceCollection)">
261 Adds services required for application localization.
263 <param name="services">The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/> to add the services to.</param>
264 <returns>The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/> so that additional calls can be chained.</returns>
266 <member name="M:Microsoft.Extensions.DependencyInjection.LocalizationServiceCollectionExtensions.AddLocalization(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{Microsoft.Extensions.Localization.LocalizationOptions})">
268 Adds services required for application localization.
270 <param name="services">The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/> to add the services to.</param>
271 <param name="setupAction">
272 An <see cref="T:System.Action`1"/> to configure the <see cref="T:Microsoft.Extensions.Localization.LocalizationOptions"/>.
274 <returns>The <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection"/> so that additional calls can be chained.</returns>