{"id":312064,"date":"2020-10-26T21:00:33","date_gmt":"2020-10-26T21:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312064"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312064","title":{"rendered":"\u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 ASP.NET Core Razor Pages \u2014 \u041a\u0443\u043b\u044c\u0442\u0443\u0440\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u041f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 OTUS \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/jv1W\/\">&#171;C# ASP.NET Core \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a&#187;<\/a>. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/otus.pw\/jv1W\/\">\u0434\u0435\u043d\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u0432\u0435\u0440\u0435\u0439<\/a>, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u043a\u0443\u0440\u0441\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/blockquote>\n<hr>\n<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0441\u0435\u0440\u0438\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 ASP.NET Core Razor Pages \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0430\u0439\u0442\u0430 \u043a \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0430\u0439\u0442\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0435\u043f\u043e\u0434\u043d\u043e\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<h4>\u0413\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 ASP.NET Core<\/h4>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441\u0430\u0439\u0442\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u044b, \u0440\u0435\u0433\u0438\u043e\u043d\u044b \u0438\u043b\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b. \u041e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044f\u0437\u044b\u043a \u0438\u043b\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0433\u0440\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>CultureInfo<\/code> \u0432 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u043b\u044f \u043d\u0438\u0445 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0448\u0430\u0433\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a Razor Pages \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f ASP.NET Core 3.0 \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042f \u043d\u0430\u0437\u0432\u0430\u043b \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u00abLocalisation\u00bb. \u0421\u0432\u043e\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0432\u0430\u043c \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>1. \u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u0430 <code>Startup.cs<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 <code>using<\/code> \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432:<\/p>\n<pre><code class=\"cs\">using System.Globalization; using Microsoft.AspNetCore.Localization; using Microsoft.Extensions.Options; <\/code><\/pre>\n<p>2. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u0447\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>ConfigureServices<\/code>, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 <code>AddLocalization<\/code>, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043d\u0436\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>RequestLocalizationOptions<\/code> \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<pre><code class=\"php\">services.Configure&lt;RequestLocalizationOptions&gt;(options =&gt; {    var supportedCultures = new[]     {         new CultureInfo(\"en\"),         new CultureInfo(\"de\"),         new CultureInfo(\"fr\"),         new CultureInfo(\"es\"),         new CultureInfo(\"ru\"),         new CultureInfo(\"ja\"),         new CultureInfo(\"ar\"),         new CultureInfo(\"zh\"),         new CultureInfo(\"en-GB\")     };     options.DefaultRequestCulture = new RequestCulture(\"en-GB\");     options.SupportedCultures = supportedCultures;     options.SupportedUICultures = supportedCultures; }); <\/code><\/pre>\n<p>\u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044f\u0437\u044b\u043a\u0438 \u0438\u043b\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 .NET \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>CultureInfo<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0447\u0438\u0441\u0435\u043b \u0438 \u0434\u0430\u0442, \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f\u0445, \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u0438\u0441\u044c\u043c\u0430, \u043f\u043e\u0440\u044f\u0434\u043a\u0430\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u043c\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <code>CultureInfo<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u0438\u043c\u044f \u044f\u0437\u044b\u043a\u0430 \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b). \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f &#8212; \u044d\u0442\u043e \u043a\u043e\u0434\u044b ISO 639-1, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u044f\u0437\u044b\u043a (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00aben\u00bb \u0434\u043b\u044f \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430), \u0441 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0441\u0443\u0431\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b ISO 3166, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0443 \u0438\u043b\u0438 \u0434\u0438\u0430\u043b\u0435\u043a\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00aben-GB\u00bb \u0434\u043b\u044f \u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u00aben-ZA\u00bb \u0434\u043b\u044f \u042e\u0436\u043d\u043e\u0439 \u0410\u0444\u0440\u0438\u043a\u0438). \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0434\u043d\u0443 \u0441\u0443\u0431\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 &#8212; \u0431\u0440\u0438\u0442\u0430\u043d\u0441\u043a\u0438\u0439 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>3. \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 <code>RequestLocalizationOptions<\/code> \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434 <code>Configure<\/code> \u043f\u043e\u0441\u043b\u0435 <code>app.UseRouting()<\/code>:<\/p>\n<pre><code class=\"cs\">app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting();  var localizationOptions = app.ApplicationServices.GetService&lt;IOptions&lt;RequestLocalizationOptions&gt;&gt;().Value; app.UseRequestLocalization(localizationOptions);<\/code><\/pre>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/h4>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 <code>RequestCultureProviders<\/code>. \u0422\u0440\u0438 \u0438\u0437 \u043d\u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<ul>\n<li>\n<p><code>QueryStringRequestCultureProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><code>CookieRequestCultureProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 cookie<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><code>AcceptHeadersRequestCultureProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0438\u0437 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Accept-Language\">\u0445\u0435\u0434\u0435\u0440\u0430&nbsp;Accept-Language<\/a> \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u043d\u0430 \u0447\u0435\u043c \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0410 \u043f\u043e\u043a\u0430 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c <a href=\"https:\/\/www.learnrazorpages.com\/razor-pages\/view-components\">\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<\/p>\n<p>1. \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 &#8212; \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <em>Models <\/em>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0435\u0435 \u0444\u0430\u0439\u043b \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>CultureSwitcherModel.cs<\/code>.<\/p>\n<pre><code class=\"cs\">using System.Collections.Generic; using System.Globalization;   namespace Localisation.Models {     public class CultureSwitcherModel     {         public CultureInfo CurrentUICulture { get; set; }         public List&lt;CultureInfo&gt; SupportedCultures { get; set; }     } } <\/code><\/pre>\n<p>2. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>ViewComponents<\/code><em> <\/em>\u0438 \u0432 \u043d\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043b\u0430\u0441\u0441\u0430 C# \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>CultureSwitcherViewcomponent.cs<\/code>. \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">using Localisation.Models; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using System.Linq;   namespace Localisation.ViewComponents {     public class CultureSwitcherViewComponent : ViewComponent     {         private readonly IOptions&lt;RequestLocalizationOptions&gt; localizationOptions;         public CultureSwitcherViewComponent(IOptions&lt;RequestLocalizationOptions&gt; localizationOptions) =&gt;             this.localizationOptions = localizationOptions;           public IViewComponentResult Invoke()         {             var cultureFeature = HttpContext.Features.Get&lt;IRequestCultureFeature&gt;();             var model = new CultureSwitcherModel             {                 SupportedCultures = localizationOptions.Value.SupportedUICultures.ToList(),                 CurrentUICulture = cultureFeature.RequestCulture.UICulture             };             return View(model);         }     } } <\/code><\/pre>\n<\/p>\n<p>3. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0432 \u043f\u0430\u043f\u043a\u0443 <code>Pages<\/code><em> <\/em>\u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0435\u0435 <code>Components<\/code>. \u0412\u043d\u0443\u0442\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>CultureSwitcher<\/code>. \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 Razor View \u0432 <code>default.cshtml<\/code><em> <\/em>\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"cs\">@model CultureSwitcherModel   &lt;div&gt;     &lt;form id=\"culture-switcher\"&gt;         &lt;select name=\"culture\" id=\"culture-options\"&gt;             &lt;option&gt;&lt;\/option&gt;             @foreach (var culture in Model.SupportedCultures)             {                 &lt;option value=\"@culture.Name\" selected=\"@(Model.CurrentUICulture.Name == culture.Name)\"&gt;@culture.DisplayName&lt;\/option&gt;             }         &lt;\/select&gt;     &lt;\/form&gt; &lt;\/div&gt;     &lt;script&gt;     document.getElementById(\"culture-options\").addEventListener(\"change\", () =&gt; {         document.getElementById(\"culture-switcher\").submit();     }); &lt;\/script&gt; <\/code><\/pre>\n<\/p>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>select<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 <code>Startup<\/code>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 <code>get<\/code> \u043c\u0435\u0442\u043e\u0434, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>culture<\/code>. <code>QueryStringRequestCultureProvider<\/code> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0430 <code>culture<\/code> (\u0438\/\u0438\u043b\u0438 <code>ui-culture<\/code>).<\/p>\n<p><code>CurrentCulture<\/code> \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043a\u0430\u043a \u0434\u0430\u0442\u044b \u0438 \u0447\u0438\u0441\u043b\u0430. <code>CurrentUICulture<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0414\u043b\u044f <code>CurrentCulture<\/code> \u0438 <code>CurrentUICulture<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0447\u0430\u0449\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0430 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430), \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u043e\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c.<\/p>\n<p>4. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443 \u0432\u0430\u0441, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0432\u043e\u043b\u043d\u0438\u0441\u0442\u044b\u0445 \u043b\u0438\u043d\u0438\u0439 \u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 &#8212; \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b&nbsp; <code>_ViewImports.cshtml<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0442\u0440\u0435\u0442\u044c\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <code>using<\/code>, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c tag-\u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">@using Localisation @using Localisation.Models @using System.Globalization @namespace Localisation.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Localisation<\/code><\/pre>\n<p>5. \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u043a\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 tag-\u0445\u0435\u043b\u043f\u0435\u0440\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<pre><code class=\"cs\">&lt;div class=\"navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse\"&gt;     &lt;ul class=\"navbar-nav flex-grow-1\"&gt;         &lt;li class=\"nav-item\"&gt;             &lt;a class=\"nav-link text-dark\" asp-area=\"\" asp-page=\"\/Index\"&gt;Home&lt;\/a&gt;         &lt;\/li&gt;         &lt;li class=\"nav-item\"&gt;             &lt;a class=\"nav-link text-dark\" asp-area=\"\" asp-page=\"\/Privacy\"&gt;Privacy&lt;\/a&gt;         &lt;\/li&gt;     &lt;\/ul&gt; &lt;\/div&gt; &lt;vc:culture-switcher\/&gt;<\/code><\/pre>\n<\/p>\n<p>6. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 <code>Index.cshtml<\/code>, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 \u043a\u043e\u0434 \u0432 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u0438 HTML-\u043a\u043e\u0434 \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cs\">@page @using Microsoft.AspNetCore.Localization @model IndexModel @{     ViewData[\"Title\"] = \"Home page\";     var requestCultureFeature = HttpContext.Features.Get&lt;IRequestCultureFeature&gt;();     var requestCulture = requestCultureFeature.RequestCulture; }   &lt;div class=\"text-center\"&gt;     &lt;h1 class=\"display-4\"&gt;Welcome&lt;\/h1&gt;     &lt;p&gt;Learn about &lt;a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\"&gt;building Web apps with ASP.NET Core&lt;\/a&gt;.&lt;\/p&gt;       &lt;table class=\"table culture-table\"&gt;         &lt;tr&gt;             &lt;td style=\"width:50%;\"&gt;Culture&lt;\/td&gt;             &lt;td&gt;@requestCulture.Culture.DisplayName {@requestCulture.Culture.Name}&lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;UI Culture&lt;\/td&gt;             &lt;td&gt;@requestCulture.UICulture.Name&lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;UICulture Parent&lt;\/td&gt;             &lt;td&gt;@requestCulture.UICulture.Parent&lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;Date&lt;\/td&gt;             &lt;td&gt;@DateTime.Now.ToLongDateString()&lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;Currency&lt;\/td&gt;             &lt;td&gt;                 @(12345.00.ToString(\"c\"))             &lt;\/td&gt;         &lt;\/tr&gt;         &lt;tr&gt;             &lt;td&gt;Number&lt;\/td&gt;             &lt;td&gt;                 @(123.45m.ToString(\"F2\"))             &lt;\/td&gt;         &lt;\/tr&gt;     &lt;\/table&gt; &lt;\/div&gt;<\/code><\/pre>\n<\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f <code>AcceptHeadersCultureRequestProvider<\/code>. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u0443\u043b\u044c\u0442\u0443\u0440, \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f <code>QueryStringCultureRequestProvider<\/code>. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043b\u044e\u0447 ui-culture \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043b\u044e\u0447\u0430 culture (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>https:\/\/localhost:xxxxx\/?culture=es&amp;ui-culture=de<\/code>), \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442.<\/p>\n<h4>\u0420\u0435\u0437\u044e\u043c\u0435<\/h4>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 Razor Pages. \u0412 \u043d\u0435\u0439 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0438 \u0442\u043e, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u043c\u0443 \u0441\u043b\u043e\u044e \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041e\u043d\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u041e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u044f\u043c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0438\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e, \u0445\u043e\u0442\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0434\u043d\u0435\u0439 \u0438 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u043e\u0439, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b (<em>.resx<\/em>) \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430\u043c\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430.<\/p>\n<hr>\n<p><a href=\"https:\/\/otus.pw\/jv1W\/\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435<\/a>.<\/p>\n<hr>\n<h4> \u0427\u0438\u0442\u0430\u0442\u044c \u0435\u0449\u0451:<\/h4>\n<ul>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/516766\/\">\u0421\u0436\u0430\u0442\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0432 GRPC \u0434\u043b\u044f ASP.NET CORE 3.0<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/otus\/blog\/525136\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/525136\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440! \u041f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 OTUS \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/jv1W\/\">&#171;C# ASP.NET Core \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a&#187;<\/a>. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043e\u043c \u0438 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 <a href=\"https:\/\/otus.pw\/jv1W\/\">\u0434\u0435\u043d\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0434\u0432\u0435\u0440\u0435\u0439<\/a>, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u043a\u0443\u0440\u0441\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u0432\u0430\u0441 \u0432\u043e\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/blockquote>\n<hr>\n<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u0441\u0435\u0440\u0438\u0438, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 ASP.NET Core Razor Pages \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441\u0430\u0439\u0442\u0430 \u043a \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0434\u043b\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0430\u0439\u0442\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u0440\u0435\u043f\u043e\u0434\u043d\u043e\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<h4>\u0413\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432 ASP.NET Core<\/h4>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0441\u0430\u0439\u0442\u0430 \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u0440\u0430\u043d\u044b, \u0440\u0435\u0433\u0438\u043e\u043d\u044b \u0438\u043b\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b. \u041e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u044f\u0437\u044b\u043a \u0438\u043b\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0438\u0433\u0440\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>CultureInfo<\/code> \u0432 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0434\u043b\u044f \u043d\u0438\u0445 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u0448\u0430\u0433\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a Razor Pages \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f ASP.NET Core 3.0 \u0431\u0435\u0437 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u042f \u043d\u0430\u0437\u0432\u0430\u043b \u0441\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u00abLocalisation\u00bb. \u0421\u0432\u043e\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0432\u0430\u043c \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043f\u0440\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>1. \u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u0430 <code>Startup.cs<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 <code>using<\/code> \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432:<\/p>\n<pre><code class=\"cs\">using System.Globalization; using Microsoft.AspNetCore.Localization; using Microsoft.Extensions.Options; <\/code><\/pre>\n<p>2. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f &#8212; \u044d\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0438\u0447\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 <code>ConfigureServices<\/code>, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 <code>AddLocalization<\/code>, \u0447\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043d\u0436\u0435\u043a\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>RequestLocalizationOptions<\/code> \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<pre><code class=\"php\">services.Configure&lt;RequestLocalizationOptions&gt;(options =&gt; {    var supportedCultures = new[]     {         new CultureInfo(\"en\"),         new CultureInfo(\"de\"),         new CultureInfo(\"fr\"),         new CultureInfo(\"es\"),         new CultureInfo(\"ru\"),         new CultureInfo(\"ja\"),         new CultureInfo(\"ar\"),         new CultureInfo(\"zh\"),         new CultureInfo(\"en-GB\")     };     options.DefaultRequestCulture = new RequestCulture(\"en-GB\");     options.SupportedCultures = supportedCultures;     options.SupportedUICultures = supportedCultures; }); <\/code><\/pre>\n<p>\u0412\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044f\u0437\u044b\u043a\u0438 \u0438\u043b\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u041a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 .NET \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>CultureInfo<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0447\u0438\u0441\u0435\u043b \u0438 \u0434\u0430\u0442, \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f\u0445, \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u043f\u0438\u0441\u044c\u043c\u0430, \u043f\u043e\u0440\u044f\u0434\u043a\u0430\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043e\u0442 \u043c\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 <code>CultureInfo<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0437\u0434\u0435\u0441\u044c, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u0438\u043c\u044f \u044f\u0437\u044b\u043a\u0430 \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 (\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b). \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f &#8212; \u044d\u0442\u043e \u043a\u043e\u0434\u044b ISO 639-1, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u044f\u0437\u044b\u043a (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00aben\u00bb \u0434\u043b\u044f \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430), \u0441 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u0441\u0443\u0431\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b ISO 3166, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0443 \u0438\u043b\u0438 \u0434\u0438\u0430\u043b\u0435\u043a\u0442 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00aben-GB\u00bb \u0434\u043b\u044f \u0412\u0435\u043b\u0438\u043a\u043e\u0431\u0440\u0438\u0442\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u00aben-ZA\u00bb \u0434\u043b\u044f \u042e\u0436\u043d\u043e\u0439 \u0410\u0444\u0440\u0438\u043a\u0438). \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043e\u0434\u043d\u0443 \u0441\u0443\u0431\u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 &#8212; \u0431\u0440\u0438\u0442\u0430\u043d\u0441\u043a\u0438\u0439 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>3. \u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 <code>RequestLocalizationOptions<\/code> \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434 <code>Configure<\/code> \u043f\u043e\u0441\u043b\u0435 <code>app.UseRouting()<\/code>:<\/p>\n<pre><code class=\"cs\">app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting();  var localizationOptions = app.ApplicationServices.GetService&lt;IOptions&lt;RequestLocalizationOptions&gt;&gt;().Value; app.UseRequestLocalization(localizationOptions);<\/code><\/pre>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/h4>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0441\u043b\u043e\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 <code>RequestCultureProviders<\/code>. \u0422\u0440\u0438 \u0438\u0437 \u043d\u0438\u0445 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<ul>\n<li>\n<p><code>QueryStringRequestCultureProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0438\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><code>CookieRequestCultureProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 cookie<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p><code>AcceptHeadersRequestCultureProvider<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0438\u0437 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Accept-Language\">\u0445\u0435\u0434\u0435\u0440\u0430&nbsp;Accept-Language<\/a> \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0437\u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430, \u043d\u0430 \u0447\u0435\u043c \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435. \u0410 \u043f\u043e\u043a\u0430 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c <a href=\"https:\/\/www.learnrazorpages.com\/razor-pages\/view-components\">\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<\/p>\n<p>1. \u041f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 &#8212; \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <em>Models <\/em>\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0435\u0435 \u0444\u0430\u0439\u043b \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>CultureSwitcherModel.cs<\/code>.<\/p>\n<pre><code class=\"cs\">using System.Collections.Generic; using System.Globalization;   namespace Localisation.Models {     public class CultureSwitcherModel     {         public CultureInfo CurrentUICulture { get; set; }         public List&lt;CultureInfo&gt; SupportedCultures { get; set; }     } } <\/code><\/pre>\n<p>2. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>ViewComponents<\/code><em> <\/em>\u0438 \u0432 \u043d\u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043b\u0430\u0441\u0441\u0430 C# \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>CultureSwitcherViewcomponent.cs<\/code>. \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">using Localisation.Models; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using System.Linq;   namespace Localisation.ViewComponents {     public class CultureSwitcherViewComponent : ViewComponent     {         private readonly IOptions&lt;RequestLocalizationOptions&gt; localizationOptions;         public CultureSwitcherViewComponent(IOptions&lt;RequestLocalizationOptions&gt; localizationOptions) =&gt;             this.localizationOptions = localizationOptions;           public IViewComponentResult Invoke()         {             var cultureFeature = HttpContext.Features.Get&lt;IRequestCultureFeature&gt;();             var model = new CultureSwitcherModel             {                 SupportedCultures = localizationOptions.Value.SupportedUICultures.ToList(),                 CurrentUICulture = cultureFeature.RequestCulture.UICulture             };             return View(model);         }     } } <\/code><\/pre>\n<\/p>\n<p>3. \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0432 \u043f\u0430\u043f\u043a\u0443 <code>Pages<\/code><em> <\/em>\u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0435\u0435 <code>Components<\/code>. \u0412\u043d\u0443\u0442\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>CultureSwitcher<\/code>. \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 Razor View \u0432 <code>default.cshtml<\/code><em> <\/em>\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<pre><code class=\"cs\">@model CultureSwitcherModel   &lt;div&gt;     &lt;form id=\"culture-switcher\"&gt;         &lt;select name=\"culture\" id=\"culture-options\"&gt;             &lt;option&gt;&lt;\/option&gt;             @foreach (var culture in Model.SupportedCultures)             {                 &lt;option value=\"@culture.Name\" selected=\"@(Model.CurrentUICulture.Name == culture.Name)\"&gt;@culture.DisplayName&lt;\/option&gt;             }         &lt;\/select&gt;     &lt;\/form&gt; &lt;\/div&gt;     &lt;script&gt;     document.getElementById(\"culture-options\").addEventListener(\"change\", () =&gt; {         document.getElementById(\"culture-switcher\").submit();     }); &lt;\/script&gt; <\/code><\/pre>\n<\/p>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f &#8212; \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 <code>select<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 <code>Startup<\/code>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 <code>get<\/code> \u043c\u0435\u0442\u043e\u0434, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>culture<\/code>. <code>QueryStringRequestCultureProvider<\/code> \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0430 <code>culture<\/code> (\u0438\/\u0438\u043b\u0438 <code>ui-culture<\/code>).<\/p>\n<p><code>CurrentCulture<\/code> \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0441\u0442\u043d\u043e\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439 \u043a\u0430\u043a \u0434\u0430\u0442\u044b \u0438 \u0447\u0438\u0441\u043b\u0430. <code>CurrentUICulture<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044d\u0442\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0414\u043b\u044f <code>CurrentCulture<\/code> \u0438 <code>CurrentUICulture<\/code> \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u0447\u0430\u0449\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0430 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0438. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430), \u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u043e\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c.<\/p>\n<p>4. \u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0443 \u0432\u0430\u0441, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0432\u043e\u043b\u043d\u0438\u0441\u0442\u044b\u0445 \u043b\u0438\u043d\u0438\u0439 \u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 &#8212; \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b&nbsp; <code>_ViewImports.cshtml<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432\u0442\u043e\u0440\u0443\u044e \u0438 \u0442\u0440\u0435\u0442\u044c\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b <code>using<\/code>, \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c tag-\u0445\u0435\u043b\u043f\u0435\u0440 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">@using Localisation @using Localisation.Models @using System.Globalization @namespace Localisation.Pages @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Localisation<\/code><\/pre>\n<p>5. \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u043a\u0443\u043b\u044c\u0442\u0443\u0440\u044b \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u0430\u043a\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 tag-\u0445\u0435\u043b\u043f\u0435\u0440\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n<pre><code class=\"cs\">&lt;div class=\"navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse\"&gt;     &lt;ul class=\"navbar-nav flex-grow-1\"&gt;         &lt;li class=\"nav-item\"&gt;             &lt;a class=\"nav-link text-dark\" asp-area=\"\" asp-page=\"\/Index\"&gt;Home&lt;\/a&gt;         &lt;\/li&gt;         &lt;li class=\"nav-item\"&gt;             &lt;a class=\"nav-link text-dark\" asp-area=\"\" asp-page=\"\/Privacy\"&gt;Privacy&lt;\/a&gt;         &lt;\/li&gt;     &lt;\/ul&gt; &lt;\/div&gt; &lt;vc:culture-switcher\/&gt;<\/code><\/pre>\n<\/p>\n<p>6. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 <code>Index.cshtml<\/code>, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 \u043a\u043e\u0434 \u0432 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u0438 HTML-\u043a\u043e\u0434 \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cs\">@page @using Microsoft.AspNetCore.Localization @model IndexModel @{     ViewData[\"Title\"] = \"Home page\";     var requestCultureFeature = HttpContext.Features.Get&lt;IRequestCultureFeature&gt;();     var requestCulture = requestCultureFeature.RequestCulture; }   &lt;div class=\"text-center\"&gt;     &lt;h1 class=\"display-4\"&gt;Welcome&lt;\/h1&gt;     &lt;p&gt;Learn about &lt;a href=\"https:\/\/docs.microsoft.com\/aspnet\/core\"&gt;building Web apps with ASP.NET Core&lt;\/a&gt;.&lt;\/p&gt;       &lt;table class=\"table culture-table\"&gt;         &lt;tr&gt;             &lt;td style=\"width:50%;\"&gt;Culture&lt;\/td&gt;             &lt;td&gt;@requestCulture.Culture.DisplayName {@requestCulture.Culture.Name}&lt;\/td&gt;  <\/code><\/pre>\n<\/hr>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-312064","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=312064"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312064\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}