{"id":296313,"date":"2019-12-24T15:00:22","date_gmt":"2019-12-24T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296313"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296313","title":{"rendered":"\u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f React \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/477618\/\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>  <\/p>\n<p>\u0414\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u043d\u0438. \u041d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 2019-\u043c, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0425\u0430\u0431\u0440. \u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0441\u043a\u043e\u0447\u0438\u0442\u044c \u0432 \u0443\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432\u0430\u0433\u043e\u043d)<\/p>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u043f\u0438\u0430\u0440\u044e \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0412\u0430\u043c \u043d\u0435 \u043f\u043e \u0434\u0443\u0448\u0435, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043c\u0435\u043b\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e)<\/p>\n<p>  <\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f?<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u044b. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442, \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u0430\u0436\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u0432 \u0447\u0438\u0441\u043b\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u0440\u043e\u043b\u044c.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041c\u043e\u0442\u0438\u0432\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0447\u0435\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f? \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u0435\u0441\u043b\u043e\u0432\u0443\u0442\u043e\u0435 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0433\u0440\u0443\u043f\u043f\u0443 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<h2>\u0427\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>  <\/p>\n<ol>\n<li>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 ICU \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0438<\/li>\n<li>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442<\/li>\n<li>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u0427\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/ibitcy\/eo-locale\" rel=\"nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 (\u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0443) \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 React \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 react-intl. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c react-intl \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442 intl-messageformat-parser \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0442\u0440\u043e\u0438\u0442 AST \u0434\u0435\u0440\u0435\u0432\u043e. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/bundlephobia.com\/result?p=react-intl@3.9.2\" rel=\"nofollow\">bundlephobia<\/a> \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0441\u0435\u0440. \u041e\u043d \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0440\u0443\u043a\u0430\u043c\u0438, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 PEG.js. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0441\u0432\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0441\u0438\u0442 \u0432 6 \u0440\u0430\u0437 \u043c\u0435\u043d\u044c\u0448\u0435. \u041e\u0447\u0435\u043d\u044c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u044f \u043c\u043e\u0433 \u0443\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u0435\u0439\u0441, \u0431\u0443\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442)<\/p>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 <a href=\"https:\/\/caniuse.com\/#feat=internationalization\" rel=\"nofollow\">Internationalization API<\/a> \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u043c\u0438, \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442 \u0438 \u0447\u0438\u0441\u0435\u043b \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439. \u0412\u0441\u0451 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u044d\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u044f\u0437\u044b\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043a \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 api, \u0432 \u0432\u0438\u0434\u0435 <code>formatSomething(value, options)<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0430\u043a\u0435\u0442 <a href=\"https:\/\/github.com\/eo-locale\/core\" rel=\"nofollow\">@eo-locale\/core<\/a> \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043b\u0438\u0431\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 \u0438\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0438\u0431\u043a\u043e.<\/p>\n<p>  <\/p>\n<h2>React<\/h2>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f React \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0438 \u0445\u0443\u043a\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>eo-locale<\/code> \u043e\u0431\u0435\u0440\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Provider.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">import { EOLocale } from 'eo-locale';  const locales = [   {     language: 'en',     messages: {       hello: 'Hello {name}!'     }   }, ];  &lt;EOLocale.Provider language=\"en\" locales={locales}&gt;   &lt;span&gt;     &lt;EOLocale.Text id=\"hello\" name=\"World\" \/&gt; \/\/ Helo World!   &lt;\/span&gt; &lt;\/EOLocale.Provider&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/NumberFormat\" rel=\"nofollow\">Intl.NumberFormat<\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">import { EOLocale } from 'eo-locale';  &lt;EOLocale.Number value={1000} \/&gt; \/\/ 1,000  &lt;EOLocale.Number   value={1000}   currency=\"EUR\"   maximumFractionDigits={2}   minimumFractionDigits={2}   style=\"currency\" \/&gt; \/\/ \u20ac1,000.00<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">import { EOLocale } from 'eo-locale';  &lt;EOLocale.Date value={new Date(2019, 2, 19)} \/&gt; \/\/ 3\/19\/2019  &lt;EOLocale.Date   value={new Date(2019, 2, 19)}   day=\"numeric\"   month=\"long\"   year=\"numeric\"   weekday=\"long\"  \/&gt;  \/\/ Tuesday, March 19, 2019<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0445\u0443\u043a\u0430 <code>useTranslator<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">import { useTranslator } from 'eo-locale';  function SomeComponent() {   const translator = useTranslator();    return &lt;div&gt;{translator.formatNumber(1000)}&lt;\/div&gt;; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u043f\u0435\u0440\u0435\u0434 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0441\u0447\u0438\u0442\u0430\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 props. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Money<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0446\u0432\u0435\u0442\u0435, \u0430 \u0437\u043d\u0430\u043a \u0432\u0430\u043b\u044e\u0442\u044b \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">import { EOLocale } from 'eo-locale'; import { Money } from '...somewhere';  const locales = [   {     language: 'en',     messages: {       total: 'Total price is {price}'     }   }, ];  &lt;EOLocale.Text   id=\"total\"   price={&lt;Money amount={1000} \/&gt;} \/&gt; \/\/ Total price is \u20ac1,000.00<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c plural \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041e\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>Intl.PluralRules<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">import { EOLocale } from 'eo-locale';  const locales = [   {     language: 'en',     messages: {       items: '{count, plural, one {You have one item} other {You have {count} items}}'     }   }, ];  &lt;EOLocale.Text id=\"items\" count={3} \/&gt; \/\/ You have 3 items<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"preact\">Preact<\/h2>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0442\u0435 \u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0438 \u0434\u043b\u044f Preact \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c <a href=\"https:\/\/github.com\/eo-locale\/preact\" rel=\"nofollow\">\u043f\u0430\u043a\u0435\u0442\u0435<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"nekotorye-osobennosti\">\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>  <\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u0430 Typescript, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u0439\u043f\u0438\u043d\u0433\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u044b \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 Provider \u0431\u044b\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u043a\u0438\u043d\u0443\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a <code>onIdMissing<\/code>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0438 \u0437\u0434\u043e\u0440\u043e\u0432\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0435. \u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0430\u0448 \u0441\u0430\u0439\u0442 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u044f\u0437\u044b\u043a, \u0442\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u044d\u0442\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c\u0441\u044f. \u0417\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043c\u0443\u043b\u044c\u0442\u0438\u044f\u0437\u044b\u0447\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043e\u0441\u043e\u0431\u044b\u0445 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0430\u0442, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \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\/post\/477618\/\"> https:\/\/habr.com\/ru\/post\/477618\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/477618\/\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>  <\/p>\n<p>\u0414\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u043d\u0438. \u041d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0441\u0432\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 2019-\u043c, \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u043d\u0430 \u0425\u0430\u0431\u0440. \u0421\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0441\u043a\u043e\u0447\u0438\u0442\u044c \u0432 \u0443\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432\u0430\u0433\u043e\u043d)<\/p>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u043f\u0438\u0430\u0440\u044e \u0441\u0432\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u0412\u0430\u043c \u043d\u0435 \u043f\u043e \u0434\u0443\u0448\u0435, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043c\u0435\u043b\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e)<\/p>\n<p>  <\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f?<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u0434 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u044b. \u041b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u044d\u0442\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u0442, \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u0430\u0436\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438 \u0432 \u0447\u0438\u0441\u043b\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u0438\u0433\u0440\u0430\u0442\u044c \u0440\u043e\u043b\u044c.<\/p>\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-296313","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296313","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=296313"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296313\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}