From d8e40ce83a980e1166b483f0bc20488748dc486d Mon Sep 17 00:00:00 2001 From: Rick Anderson Date: Fri, 24 Jun 2016 13:09:35 -0700 Subject: [PATCH] fix link (#1505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an optional extended description… --- aspnet/fundamentals/localization.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnet/fundamentals/localization.rst b/aspnet/fundamentals/localization.rst index 82ac0e4ba1..74d4f22cc5 100644 --- a/aspnet/fundamentals/localization.rst +++ b/aspnet/fundamentals/localization.rst @@ -22,7 +22,7 @@ App localization involves the following: Make the app's content localizable -------------------------------------- -Introduced in ASP.NET Core, `IStringLocalizer `__ and `IStringLocalizer `__ were architected to improve productivity when developing localized apps. ``IStringLocalizer`` uses the `ResourceManager `__ and `ResourceReader `__ to provide culture-specific resources at run time. The simple interface has an indexer and an ``IEnumerable`` for returning localized strings. ``IStringLocalizer`` doesn't require you to store the default language strings in a resource file. You can develop an app targeted for localization and not need to create resource files early in development. The code below shows how to wrap the string "About Title" for localization. +Introduced in ASP.NET Core, :dn:iface:`~Microsoft.Extensions.Localization.IStringLocalizer` and :dn:iface:`~Microsoft.Extensions.Localization.IStringLocalizer\` were architected to improve productivity when developing localized apps. ``IStringLocalizer`` uses the `ResourceManager `__ and `ResourceReader `__ to provide culture-specific resources at run time. The simple interface has an indexer and an ``IEnumerable`` for returning localized strings. ``IStringLocalizer`` doesn't require you to store the default language strings in a resource file. You can develop an app targeted for localization and not need to create resource files early in development. The code below shows how to wrap the string "About Title" for localization. .. literalinclude:: localization/sample/Controllers/AboutController.cs :language: c# @@ -146,7 +146,7 @@ Generating resource files with Visual Studio If you create a resource file in Visual Studio without a culture in the file name (for example, *Welcome.resx*), Visual Studio will create a C# class with a property for each string. That's usually not what you want with ASP.NET Core; you typically don't have a default *.resx* resource file (A *.resx* file without the culture name). We suggest you create the *.resx* file with a culture name (for example *Welcome.fr.resx*). When you create a *.resx* file with a culture name, Visual Studio will not generate the class file. We anticipate that many developers will **not** create a default language resource file. Adding Other Cultures -^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^ Each language and culture combination (other than the default language) requires a unique resource file. You can create resource files for different cultures and locales by creating new resource files in which the ISO language codes are part of the file name (for example, **en-us**, **fr-ca**, and **en-gb**). These ISO codes are placed between the file name and the .resx file name extension, as in *Welcome.es-MX.resx* (Spanish/Mexico). To specify a culturally neutral language, you would eliminate the country code, such as *Welcome.fr.resx* for the French language. @@ -179,7 +179,7 @@ The current culture on a request is set in the localization :doc:`/fundamentals/ :lines: 107, 136-159 :dedent: 6 -`UseRequestLocalization `__ initializes a `RequestLocalizationMiddleware `__ object. On every request the list of `RequestCultureProvider `__ in the `RequestLocalizationOptions `__ is enumerated and the first provider that can successfully determine the request culture is used. The default providers come from the ``RequestLocalizationOptions`` class: +:dn:method:`~Microsoft.AspNetCore.Builder.ApplicationBuilderExtensions.UseRequestLocalization` initializes a :dn:class:`~Microsoft.AspNetCore.Builder.RequestLocalizationOptions` object. On every request the list of `RequestCultureProvider `__ in the `RequestLocalizationOptions `__ is enumerated and the first provider that can successfully determine the request culture is used. The default providers come from the ``RequestLocalizationOptions`` class: #. `QueryStringRequestCultureProvider `__ #. `CookieRequestCultureProvider `__