-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathchunk-2EWYYQMT.js
More file actions
90 lines (78 loc) · 24.2 KB
/
chunk-2EWYYQMT.js
File metadata and controls
90 lines (78 loc) · 24.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import{n as f,o as h,u}from"./chunk-QORTSMW2.js";import"./chunk-JXJD3VJV.js";import"./chunk-5Z4PBTXV.js";import{$ as s,$a as r,Be as c,Cb as e,Fa as S,La as E,_ as o,ab as n,bb as t,cb as d,cf as g,df as _,lb as p,xa as m}from"./chunk-NAM4QUWH.js";import"./chunk-DAQOROHW.js";function w(i,a){i&1&&(n(0,"span"),e(1,"Internationalization"),t())}function I(i,a){i&1&&d(0,"span")}var x=class i{goLink(a){window&&(window.location.hash=a)}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=S({type:i,selectors:[["nz-doc-i18n-en"]],decls:1165,vars:2,consts:[[1,"markdown"],[4,"nzSpaceItem"],[1,"toc-affix",3,"nzOffsetTop"],["nzShowInkInFixed","",3,"nzClick","nzAffix"],["nzHref","#default_i18n_language","nzTitle","Default i18n Language",1,"toc-indent-1"],["nzHref","#work_with_angular_localize","nzTitle","Work with Angular localize",1,"toc-indent-1"],["nzHref","#service","nzTitle","Service",1,"toc-indent-1"],["nzHref","#how_to_format_a_date_using_date-fns","nzTitle","How to format a date using date-fns",1,"toc-indent-1"],["nzHref","#nz_date_config_(date_global_configuration)","nzTitle","NZ_DATE_CONFIG (Date global configuration)",1,"toc-indent-2"],["nzHref","#language_supported_by_date-fns","nzTitle","Language supported by date-fns",1,"toc-indent-1"],["nzHref","#how_to_override_internationalization_configuration","nzTitle","How to override internationalization configuration",1,"toc-indent-1"],["id","default_i18n_language"],["onclick","window.location.hash = 'default_i18n_language'",1,"anchor"],["href","https://date-fns.org/docs/I18n","target","_blank","rel","noopener"],[1,"language-ts"],[1,"token","comment"],[1,"token","keyword"],[1,"token","punctuation"],[1,"token","string"],[1,"token","function"],[1,"token","operator"],["id","work_with_angular_localize"],["onclick","window.location.hash = 'work_with_angular_localize'",1,"anchor"],["href","https://angular.dev/guide/i18n/add-package","target","_blank","rel","noopener"],["href","https://angular.dev/api/core/LOCALE_ID","target","_blank","rel","noopener"],[1,"token","constant"],["id","service"],["onclick","window.location.hash = 'service'",1,"anchor"],[1,"token","class-name"],["id","how_to_format_a_date_using_date-fns"],["onclick","window.location.hash = 'how_to_format_a_date_using_date-fns'",1,"anchor"],["href","https://angular.dev/api/common/DatePipe","target","_blank","rel","noopener"],["href","https://github.com/angular/angular/issues/25380","target","_blank","rel","noopener"],["href","https://github.com/NG-ZORRO/ng-zorro-antd/issues/2406","target","_blank","rel","noopener"],["href","https://github.com/NG-ZORRO/ng-zorro-antd/issues/2819","target","_blank","rel","noopener"],["href","https://date-fns.org/docs/format#description","target","_blank","rel","noopener"],["id","nz_date_config_date_global_configuration"],["onclick","window.location.hash = 'nz_date_config_date_global_configuration'",1,"anchor"],["id","language_supported_by_date-fns"],["onclick","window.location.hash = 'language_supported_by_date-fns'",1,"anchor"],["href","https://date-fns.org/docs/I18n#supported-languages","target","_blank","rel","noopener"],["id","how_to_override_internationalization_configuration"],["onclick","window.location.hash = 'how_to_override_internationalization_configuration'",1,"anchor"]],template:function(l,z){l&1&&(n(0,"article",0)(1,"h1")(2,"nz-space"),E(3,w,2,0,"span",1)(4,I,1,0,"span",1),t()(),n(5,"nz-affix",2)(6,"nz-anchor",3),p("nzClick",function(k){return z.goLink(k)}),d(7,"nz-link",4)(8,"nz-link",5)(9,"nz-link",6)(10,"nz-link",7)(11,"nz-link",8)(12,"nz-link",9)(13,"nz-link",10),t()(),n(14,"section",0),s(),n(15,"p"),e(16,"The default language of "),n(17,"code"),e(18,"ng-zorro-antd"),t(),e(19,` is Chinese yet.
If you want to use other languages, you can follow the instructions below.
You can also set the language with `),n(20,"code"),e(21,"ng add ng-zorro-antd"),t(),e(22," when creating project."),t(),n(23,"h2",11)(24,"span"),e(25,"Default i18n Language"),t(),n(26,"a",12),e(27,"#"),t()(),n(28,"p")(29,"code"),e(30,"ng-zorro-antd"),t(),e(31,` provides several configuration tokens for global configuration of international copy and date,
`),n(32,"code"),e(33,"NZ_I18N"),t(),e(34," for the international copy, and "),n(35,"code"),e(36,"NZ_DATE_CONFIG"),t(),e(37,` for date-related features. In addition, we use Angular's
language pack for date formatting by default (need to introduce the corresponding Angular language pack).`),t(),n(38,"p"),e(39,"In addition, we also provide an optional "),n(40,"code"),e(41,"NZ_DATE_LOCALE"),t(),e(42," for date-fns mode to format local dates (depending on the "),n(43,"a",13)(44,"code"),e(45,"date-fns"),t()(),e(46,` library,
see `),n(47,"code"),e(48,"How to use date-fns for date formatting"),t(),e(49,") below."),t(),n(50,"pre")(51,"code",14)(52,"span",15),e(53,"/** config angular i18n **/"),t(),e(54,`
`),n(55,"span",16),e(56,"import"),t(),e(57," "),n(58,"span",17),e(59,"{"),t(),e(60," registerLocaleData "),n(61,"span",17),e(62,"}"),t(),e(63," "),n(64,"span",16),e(65,"from"),t(),e(66," "),n(67,"span",18),e(68,"'@angular/common'"),t(),n(69,"span",17),e(70,";"),t(),e(71,`
`),n(72,"span",16),e(73,"import"),t(),e(74," en "),n(75,"span",16),e(76,"from"),t(),e(77," "),n(78,"span",18),e(79,"'@angular/common/locales/en'"),t(),n(80,"span",17),e(81,";"),t(),e(82,`
`),n(83,"span",19),e(84,"registerLocaleData"),t(),n(85,"span",17),e(86,"("),t(),e(87,"en"),n(88,"span",17),e(89,")"),t(),n(90,"span",17),e(91,";"),t(),e(92,`
`),n(93,"span",15),e(94,"/** config ng-zorro-antd i18n **/"),t(),e(95,`
`),n(96,"span",16),e(97,"import"),t(),e(98," "),n(99,"span",17),e(100,"{"),t(),e(101," provideNzI18n"),n(102,"span",17),e(103,","),t(),e(104," en_US "),n(105,"span",17),e(106,"}"),t(),e(107," "),n(108,"span",16),e(109,"from"),t(),e(110," "),n(111,"span",18),e(112,"'ng-zorro-antd/i18n'"),t(),n(113,"span",17),e(114,";"),t(),e(115,`
`),n(116,"span",15),e(117,"/** set the default i18n config **/"),t(),e(118,`
`),n(119,"span",16),e(120,"export"),t(),e(121," "),n(122,"span",16),e(123,"const"),t(),e(124," appConfig"),n(125,"span",20),e(126,":"),t(),e(127," ApplicationConfig "),n(128,"span",20),e(129,"="),t(),e(130," "),n(131,"span",17),e(132,"{"),t(),e(133,`
providers`),n(134,"span",20),e(135,":"),t(),e(136," "),n(137,"span",17),e(138,"["),t(),e(139,`
`),n(140,"span",15),e(141,"// ..."),t(),e(142,`
`),n(143,"span",19),e(144,"provideNzI18n"),t(),n(145,"span",17),e(146,"("),t(),e(147,"en_US"),n(148,"span",17),e(149,")"),t(),e(150,`
`),n(151,"span",17),e(152,"]"),t(),e(153,`
`),n(154,"span",17),e(155,"}"),t(),n(156,"span",17),e(157,";"),t(),e(158,`
`),t()(),n(159,"h2",21)(160,"span"),e(161,"Work with Angular localize"),t(),n(162,"a",22),e(163,"#"),t()(),n(164,"p"),e(165,"When using "),n(166,"a",23),e(167,"@angular/localize"),t(),e(168,", ng-zorro-antd could keep the same localization with angular via "),n(169,"a",24),e(170,"LOCALE_ID"),t()(),n(171,"pre")(172,"code",14)(173,"span",15),e(174,"/** import all locales data **/"),t(),e(175,`
`),n(176,"span",16),e(177,"import"),t(),e(178," "),n(179,"span",17),e(180,"{"),t(),e(181," "),n(182,"span",25),e(183,"LOCALE_ID"),t(),e(184," "),n(185,"span",17),e(186,"}"),t(),e(187," "),n(188,"span",16),e(189,"from"),t(),e(190," "),n(191,"span",18),e(192,"'@angular/core'"),t(),n(193,"span",17),e(194,";"),t(),e(195,`
`),n(196,"span",16),e(197,"import"),t(),e(198," "),n(199,"span",17),e(200,"{"),t(),e(201," registerLocaleData "),n(202,"span",17),e(203,"}"),t(),e(204," "),n(205,"span",16),e(206,"from"),t(),e(207," "),n(208,"span",18),e(209,"'@angular/common'"),t(),n(210,"span",17),e(211,";"),t(),e(212,`
`),n(213,"span",16),e(214,"import"),t(),e(215," en "),n(216,"span",16),e(217,"from"),t(),e(218," "),n(219,"span",18),e(220,"'@angular/common/locales/en'"),t(),n(221,"span",17),e(222,";"),t(),e(223,`
`),n(224,"span",16),e(225,"import"),t(),e(226," zh "),n(227,"span",16),e(228,"from"),t(),e(229," "),n(230,"span",18),e(231,"'@angular/common/locales/zh'"),t(),n(232,"span",17),e(233,";"),t(),e(234,`
`),n(235,"span",19),e(236,"registerLocaleData"),t(),n(237,"span",17),e(238,"("),t(),e(239,"en"),n(240,"span",17),e(241,")"),t(),n(242,"span",17),e(243,";"),t(),e(244,`
`),n(245,"span",19),e(246,"registerLocaleData"),t(),n(247,"span",17),e(248,"("),t(),e(249,"zh"),n(250,"span",17),e(251,")"),t(),n(252,"span",17),e(253,";"),t(),e(254,`
`),n(255,"span",15),e(256,"/** config ng-zorro-antd i18n **/"),t(),e(257,`
`),n(258,"span",16),e(259,"import"),t(),e(260," "),n(261,"span",17),e(262,"{"),t(),e(263," en_US"),n(264,"span",17),e(265,","),t(),e(266," provideNzI18n"),n(267,"span",17),e(268,","),t(),e(269," fr_FR "),n(270,"span",17),e(271,"}"),t(),e(272," "),n(273,"span",16),e(274,"from"),t(),e(275," "),n(276,"span",18),e(277,"'ng-zorro-antd/i18n'"),t(),n(278,"span",17),e(279,";"),t(),e(280,`
`),n(281,"span",15),e(282,"/** switch ng-zorro-antd locales via LOCALE_ID **/"),t(),e(283,`
`),n(284,"span",16),e(285,"export"),t(),e(286," "),n(287,"span",16),e(288,"const"),t(),e(289," appConfig"),n(290,"span",20),e(291,":"),t(),e(292," ApplicationConfig "),n(293,"span",20),e(294,"="),t(),e(295," "),n(296,"span",17),e(297,"{"),t(),e(298,`
providers`),n(299,"span",20),e(300,":"),t(),e(301," "),n(302,"span",17),e(303,"["),t(),e(304,`
`),n(305,"span",15),e(306,"// ..."),t(),e(307,`
`),n(308,"span",19),e(309,"provideNzI18n"),t(),n(310,"span",17),e(311,"("),t(),n(312,"span",17),e(313,"("),t(),n(314,"span",17),e(315,")"),t(),e(316," "),n(317,"span",20),e(318,"=>"),t(),e(319," "),n(320,"span",17),e(321,"("),t(),n(322,"span",19),e(323,"inject"),t(),n(324,"span",17),e(325,"("),t(),n(326,"span",25),e(327,"LOCALE_ID"),t(),n(328,"span",17),e(329,")"),t(),e(330," "),n(331,"span",20),e(332,"==="),t(),e(333," "),n(334,"span",18),e(335,"'fr'"),t(),e(336," "),n(337,"span",20),e(338,"?"),t(),e(339," fr_FR "),n(340,"span",20),e(341,":"),t(),e(342," en_US"),n(343,"span",17),e(344,")"),t(),n(345,"span",17),e(346,")"),t(),e(347,`
`),n(348,"span",17),e(349,"]"),t(),e(350,`
`),n(351,"span",17),e(352,"}"),t(),n(353,"span",17),e(354,";"),t(),e(355,`
`),t()(),n(356,"h2",26)(357,"span"),e(358,"Service"),t(),n(359,"a",27),e(360,"#"),t()(),n(361,"p")(362,"code"),e(363,"ng-zorro-antd"),t(),e(364," provides the service of "),n(365,"code"),e(366,"NzI18nService"),t(),e(367," to dynamic change the locale text."),t(),n(368,"pre")(369,"code",14)(370,"span",16),e(371,"import"),t(),e(372," "),n(373,"span",17),e(374,"{"),t(),e(375," en_US"),n(376,"span",17),e(377,","),t(),e(378," NzI18nService "),n(379,"span",17),e(380,"}"),t(),e(381," "),n(382,"span",16),e(383,"from"),t(),e(384," "),n(385,"span",18),e(386,"'ng-zorro-antd/i18n'"),t(),n(387,"span",17),e(388,";"),t(),e(389,`
`),n(390,"span",16),e(391,"class"),t(),e(392," "),n(393,"span",28),e(394,"DemoComponent"),t(),e(395," "),n(396,"span",17),e(397,"{"),t(),e(398,`
`),n(399,"span",16),e(400,"private"),t(),e(401," i18n "),n(402,"span",20),e(403,"="),t(),e(404," "),n(405,"span",19),e(406,"inject"),t(),n(407,"span",17),e(408,"("),t(),e(409,"NzI18nService"),n(410,"span",17),e(411,")"),t(),n(412,"span",17),e(413,";"),t(),e(414,`
`),n(415,"span",19),e(416,"switchLanguage"),t(),n(417,"span",17),e(418,"("),t(),n(419,"span",17),e(420,")"),t(),e(421," "),n(422,"span",17),e(423,"{"),t(),e(424,`
`),n(425,"span",16),e(426,"this"),t(),n(427,"span",17),e(428,"."),t(),e(429,"i18n"),n(430,"span",17),e(431,"."),t(),n(432,"span",19),e(433,"setLocale"),t(),n(434,"span",17),e(435,"("),t(),e(436,"en_US"),n(437,"span",17),e(438,")"),t(),n(439,"span",17),e(440,";"),t(),e(441,`
`),n(442,"span",17),e(443,"}"),t(),e(444,`
`),n(445,"span",17),e(446,"}"),t(),e(447,`
`),t()(),n(448,"p"),e(449,"Note: "),n(450,"code"),e(451,"en_US"),t(),e(452," is the package name, follow below."),t(),n(453,"p"),e(454,"Supported languages:"),t(),n(455,"table")(456,"thead")(457,"tr")(458,"th"),e(459,"Package Name"),t(),n(460,"th"),e(461,"Language"),t()()(),n(462,"tbody")(463,"tr")(464,"td"),e(465,"ar_EG"),t(),n(466,"td"),e(467,"Arabic"),t()(),n(468,"tr")(469,"td"),e(470,"az_AZ"),t(),n(471,"td"),e(472,"Azerbaijani"),t()(),n(473,"tr")(474,"td"),e(475,"bg_BG"),t(),n(476,"td"),e(477,"Bulgarian"),t()(),n(478,"tr")(479,"td"),e(480,"bn_BD"),t(),n(481,"td"),e(482,"Bangla (Bangladesh)"),t()(),n(483,"tr")(484,"td"),e(485,"by_BY"),t(),n(486,"td"),e(487,"Belarusian"),t()(),n(488,"tr")(489,"td"),e(490,"ca_ES"),t(),n(491,"td"),e(492,"Catalan"),t()(),n(493,"tr")(494,"td"),e(495,"cs_CZ"),t(),n(496,"td"),e(497,"Czech"),t()(),n(498,"tr")(499,"td"),e(500,"da_DK"),t(),n(501,"td"),e(502,"Danish"),t()(),n(503,"tr")(504,"td"),e(505,"de_DE"),t(),n(506,"td"),e(507,"German"),t()(),n(508,"tr")(509,"td"),e(510,"el_GR"),t(),n(511,"td"),e(512,"Greek"),t()(),n(513,"tr")(514,"td"),e(515,"en_AU"),t(),n(516,"td"),e(517,"English (Australia)"),t()(),n(518,"tr")(519,"td"),e(520,"en_GB"),t(),n(521,"td"),e(522,"English"),t()(),n(523,"tr")(524,"td"),e(525,"en_US"),t(),n(526,"td"),e(527,"English (America)"),t()(),n(528,"tr")(529,"td"),e(530,"es_ES"),t(),n(531,"td"),e(532,"Spanish"),t()(),n(533,"tr")(534,"td"),e(535,"et_EE"),t(),n(536,"td"),e(537,"Estonian"),t()(),n(538,"tr")(539,"td"),e(540,"fa_IR"),t(),n(541,"td"),e(542,"Persian"),t()(),n(543,"tr")(544,"td"),e(545,"fi_FI"),t(),n(546,"td"),e(547,"Finnish"),t()(),n(548,"tr")(549,"td"),e(550,"fr_BE"),t(),n(551,"td"),e(552,"French (Belgium)"),t()(),n(553,"tr")(554,"td"),e(555,"fr_CA"),t(),n(556,"td"),e(557,"French (Canada)"),t()(),n(558,"tr")(559,"td"),e(560,"fr_FR"),t(),n(561,"td"),e(562,"French (France)"),t()(),n(563,"tr")(564,"td"),e(565,"ga_IE"),t(),n(566,"td"),e(567,"Irish Gaelic"),t()(),n(568,"tr")(569,"td"),e(570,"gl_ES"),t(),n(571,"td"),e(572,"Galician (Spain)"),t()(),n(573,"tr")(574,"td"),e(575,"he_IL"),t(),n(576,"td"),e(577,"Hebrew"),t()(),n(578,"tr")(579,"td"),e(580,"hi_IN"),t(),n(581,"td"),e(582,"Hindi"),t()(),n(583,"tr")(584,"td"),e(585,"hr_HR"),t(),n(586,"td"),e(587,"Croatian"),t()(),n(588,"tr")(589,"td"),e(590,"hu_HU"),t(),n(591,"td"),e(592,"Hungarian"),t()(),n(593,"tr")(594,"td"),e(595,"hy_AM"),t(),n(596,"td"),e(597,"Armenian"),t()(),n(598,"tr")(599,"td"),e(600,"id_ID"),t(),n(601,"td"),e(602,"Indonesian"),t()(),n(603,"tr")(604,"td"),e(605,"is_IS"),t(),n(606,"td"),e(607,"Icelandic"),t()(),n(608,"tr")(609,"td"),e(610,"it_IT"),t(),n(611,"td"),e(612,"Italian"),t()(),n(613,"tr")(614,"td"),e(615,"ja_JP"),t(),n(616,"td"),e(617,"Japanese"),t()(),n(618,"tr")(619,"td"),e(620,"ka_GE"),t(),n(621,"td"),e(622,"Georgian"),t()(),n(623,"tr")(624,"td"),e(625,"kk_KZ"),t(),n(626,"td"),e(627,"Kazakh"),t()(),n(628,"tr")(629,"td"),e(630,"km_KH"),t(),n(631,"td"),e(632,"Khmer"),t()(),n(633,"tr")(634,"td"),e(635,"kmr_IQ"),t(),n(636,"td"),e(637,"Kurmanji"),t()(),n(638,"tr")(639,"td"),e(640,"kn_IN"),t(),n(641,"td"),e(642,"Kannada"),t()(),n(643,"tr")(644,"td"),e(645,"ko_KR"),t(),n(646,"td"),e(647,"Korean"),t()(),n(648,"tr")(649,"td"),e(650,"ku_IQ"),t(),n(651,"td"),e(652,"Kurdish"),t()(),n(653,"tr")(654,"td"),e(655,"lt_LT"),t(),n(656,"td"),e(657,"Lithuanian"),t()(),n(658,"tr")(659,"td"),e(660,"lv_LV"),t(),n(661,"td"),e(662,"Latvian"),t()(),n(663,"tr")(664,"td"),e(665,"mk_MK"),t(),n(666,"td"),e(667,"Macedonian"),t()(),n(668,"tr")(669,"td"),e(670,"ml_IN"),t(),n(671,"td"),e(672,"Malayalam (India)"),t()(),n(673,"tr")(674,"td"),e(675,"mn_MN"),t(),n(676,"td"),e(677,"Mongolian"),t()(),n(678,"tr")(679,"td"),e(680,"ms_MY"),t(),n(681,"td"),e(682,"Malay"),t()(),n(683,"tr")(684,"td"),e(685,"nb_NO"),t(),n(686,"td"),e(687,"Norwegian"),t()(),n(688,"tr")(689,"td"),e(690,"ne_NP"),t(),n(691,"td"),e(692,"Nepali"),t()(),n(693,"tr")(694,"td"),e(695,"nl_BE"),t(),n(696,"td"),e(697,"Dutch (Belgium)"),t()(),n(698,"tr")(699,"td"),e(700,"nl_NL"),t(),n(701,"td"),e(702,"Dutch"),t()(),n(703,"tr")(704,"td"),e(705,"pl_PL"),t(),n(706,"td"),e(707,"Polish"),t()(),n(708,"tr")(709,"td"),e(710,"pt_BR"),t(),n(711,"td"),e(712,"Portuguese (Brazil)"),t()(),n(713,"tr")(714,"td"),e(715,"pt_PT"),t(),n(716,"td"),e(717,"Portuguese"),t()(),n(718,"tr")(719,"td"),e(720,"ro_RO"),t(),n(721,"td"),e(722,"Romanian"),t()(),n(723,"tr")(724,"td"),e(725,"ru_RU"),t(),n(726,"td"),e(727,"Russian"),t()(),n(728,"tr")(729,"td"),e(730,"sk_SK"),t(),n(731,"td"),e(732,"Slovak"),t()(),n(733,"tr")(734,"td"),e(735,"sl_SI"),t(),n(736,"td"),e(737,"Slovenian"),t()(),n(738,"tr")(739,"td"),e(740,"sr_RS"),t(),n(741,"td"),e(742,"Serbian"),t()(),n(743,"tr")(744,"td"),e(745,"sv_SE"),t(),n(746,"td"),e(747,"Swedish"),t()(),n(748,"tr")(749,"td"),e(750,"ta_IN"),t(),n(751,"td"),e(752,"Tamil"),t()(),n(753,"tr")(754,"td"),e(755,"th_TH"),t(),n(756,"td"),e(757,"Thai"),t()(),n(758,"tr")(759,"td"),e(760,"tr_TR"),t(),n(761,"td"),e(762,"Turkish"),t()(),n(763,"tr")(764,"td"),e(765,"uk_UA"),t(),n(766,"td"),e(767,"Ukrainian"),t()(),n(768,"tr")(769,"td"),e(770,"ur_PK"),t(),n(771,"td"),e(772,"Urdu (Pakistan)"),t()(),n(773,"tr")(774,"td"),e(775,"vi_VN"),t(),n(776,"td"),e(777,"Vietnamese"),t()(),n(778,"tr")(779,"td"),e(780,"zh_CN"),t(),n(781,"td"),e(782,"Chinese (Simplified)"),t()(),n(783,"tr")(784,"td"),e(785,"zh_HK"),t(),n(786,"td"),e(787,"Chinese (Traditional)"),t()(),n(788,"tr")(789,"td"),e(790,"zh_TW"),t(),n(791,"td"),e(792,"Chinese (Traditional)"),t()()()(),n(793,"h2",29)(794,"span"),e(795,"How to format a date using date-fns"),t(),n(796,"a",30),e(797,"#"),t()(),n(798,"p"),e(799,"For date formatting, we use Angular's DatePipe ("),n(800,"a",31),e(801,"syntax reference"),t(),e(802,` to implement (depending on Angular's locale language pack),
but due to Angular's own DatePipe is not implemented according to the ISO standard algorithm (`),n(803,"a",32),e(804,"issue #25380"),t(),e(805,`),
the week number may not match expectations (related issues: `),n(806,"a",33),e(807,"#2406"),t(),e(808,", "),n(809,"a",34),e(810,"#2819"),t(),e(811," )."),t(),n(812,"p"),e(813,"So we have a new "),n(814,"code"),e(815,"date-fns"),t(),e(816," method ("),n(817,"a",35),e(818,"syntax reference"),t(),e(819,`) for standard date formatting, you can switch to it by the following way
(after switching, it will affect the date formatting of all date related components such as Calendar/DatePicker):`),t(),n(820,"pre")(821,"code",14)(822,"span",15),e(823,"// Set the value of NZ_DATE_LOCALE in the `app.config.ts` to activate date-fns mode"),t(),e(824,`
`),n(825,"span",16),e(826,"import"),t(),e(827," "),n(828,"span",17),e(829,"{"),t(),e(830," enUS"),n(831,"span",17),e(832,","),t(),e(833," ja "),n(834,"span",17),e(835,"}"),t(),e(836," "),n(837,"span",16),e(838,"from"),t(),e(839," "),n(840,"span",18),e(841,"'date-fns/locale'"),t(),n(842,"span",17),e(843,";"),t(),e(844,`
`),n(845,"span",16),e(846,"export"),t(),e(847," "),n(848,"span",16),e(849,"const"),t(),e(850," appConfig"),n(851,"span",20),e(852,":"),t(),e(853," ApplicationConfig "),n(854,"span",20),e(855,"="),t(),e(856," "),n(857,"span",17),e(858,"{"),t(),e(859,`
providers`),n(860,"span",20),e(861,":"),t(),e(862," "),n(863,"span",17),e(864,"["),t(),n(865,"span",17),e(866,"{"),t(),e(867," provide"),n(868,"span",20),e(869,":"),t(),e(870," "),n(871,"span",25),e(872,"NZ_DATE_LOCALE"),t(),n(873,"span",17),e(874,","),t(),e(875," useValue"),n(876,"span",20),e(877,":"),t(),e(878," enUS "),n(879,"span",17),e(880,"}"),t(),n(881,"span",17),e(882,"]"),t(),e(883,`
`),n(884,"span",17),e(885,"}"),t(),n(886,"span",17),e(887,";"),t(),e(888,`
`),n(889,"span",15),e(890,"// Switch language to Japanese at runtime"),t(),e(891,`
`),n(892,"span",16),e(893,"import"),t(),e(894," "),n(895,"span",17),e(896,"{"),t(),e(897," NzI18nService "),n(898,"span",17),e(899,"}"),t(),e(900," "),n(901,"span",16),e(902,"from"),t(),e(903," "),n(904,"span",18),e(905,"'ng-zorro-antd/i18n'"),t(),n(906,"span",17),e(907,";"),t(),e(908,`
`),n(909,"span",16),e(910,"export"),t(),e(911," "),n(912,"span",16),e(913,"class"),t(),e(914," "),n(915,"span",28),e(916,"AppComponent"),t(),e(917," "),n(918,"span",17),e(919,"{"),t(),e(920,`
`),n(921,"span",16),e(922,"private"),t(),e(923," i18n "),n(924,"span",20),e(925,"="),t(),e(926," "),n(927,"span",19),e(928,"inject"),t(),n(929,"span",17),e(930,"("),t(),e(931,"NzI18nService"),n(932,"span",17),e(933,")"),t(),n(934,"span",17),e(935,";"),t(),e(936,`
`),n(937,"span",19),e(938,"switchLanguage"),t(),n(939,"span",17),e(940,"("),t(),n(941,"span",17),e(942,")"),t(),e(943," "),n(944,"span",17),e(945,"{"),t(),e(946,`
`),n(947,"span",16),e(948,"this"),t(),n(949,"span",17),e(950,"."),t(),e(951,"i18n"),n(952,"span",17),e(953,"."),t(),n(954,"span",19),e(955,"setDateLocale"),t(),n(956,"span",17),e(957,"("),t(),e(958,"ja"),n(959,"span",17),e(960,")"),t(),n(961,"span",17),e(962,";"),t(),e(963,`
`),n(964,"span",17),e(965,"}"),t(),e(966,`
`),n(967,"span",17),e(968,"}"),t(),e(969,`
`),t()(),n(970,"p"),e(971,"After the switch is successful, you can also choose to remove the dependency on the Angular Locales package (remove the code below) to reduce the package size:"),t(),n(972,"pre")(973,"code",14)(974,"span",15),e(975,"// The following code can be removed as needed"),t(),e(976,`
`),n(977,"span",16),e(978,"import"),t(),e(979," "),n(980,"span",17),e(981,"{"),t(),e(982," registerLocaleData "),n(983,"span",17),e(984,"}"),t(),e(985," "),n(986,"span",16),e(987,"from"),t(),e(988," "),n(989,"span",18),e(990,"'@angular/common'"),t(),n(991,"span",17),e(992,";"),t(),e(993,`
`),n(994,"span",16),e(995,"import"),t(),e(996," en "),n(997,"span",16),e(998,"from"),t(),e(999," "),n(1e3,"span",18),e(1001,"'@angular/common/locales/en'"),t(),n(1002,"span",17),e(1003,";"),t(),e(1004,`
`),n(1005,"span",19),e(1006,"registerLocaleData"),t(),n(1007,"span",17),e(1008,"("),t(),e(1009,"en"),n(1010,"span",17),e(1011,")"),t(),n(1012,"span",17),e(1013,";"),t(),e(1014,`
`),t()(),n(1015,"h3",36)(1016,"span"),e(1017,"NZ_DATE_CONFIG (Date global configuration)"),t(),n(1018,"a",37),e(1019,"#"),t()(),n(1020,"p"),e(1021,"The default configuration is as follows:"),t(),n(1022,"pre")(1023,"code",14)(1024,"span",17),e(1025,"{"),t(),e(1026,`
`),n(1027,"span",15),e(1028,"/** Specify which day is the beginning of the week (null for default, 0 for Sunday, 1 for Monday, and so on) */"),t(),e(1029,`
firstDayOfWeek`),n(1030,"span",20),e(1031,":"),t(),e(1032," "),n(1033,"span",16),e(1034,"null"),t(),n(1035,"span",17),e(1036,";"),t(),e(1037,`
`),n(1038,"span",17),e(1039,"}"),t(),e(1040,`
`),t()(),n(1041,"h2",38)(1042,"span"),e(1043,"Language supported by date-fns"),t(),n(1044,"a",39),e(1045,"#"),t()(),n(1046,"p")(1047,"a",40),e(1048,"https://date-fns.org/docs/I18n#supported-languages"),t()(),n(1049,"h2",41)(1050,"span"),e(1051,"How to override internationalization configuration"),t(),n(1052,"a",42),e(1053,"#"),t()(),n(1054,"p"),e(1055,"The text of some components in "),n(1056,"code"),e(1057,"ng-zorro"),t(),e(1058," depends on the internationalized text, such as the "),n(1059,"code"),e(1060,"size changer"),t(),e(1061," in "),n(1062,"code"),e(1063,"nz-pagination"),t(),e(1064,". At this time, you can modify the internationalization configuration to change the text content in the "),n(1065,"code"),e(1066,"size changer"),t(),e(1067,":"),t(),n(1068,"pre")(1069,"code",14)(1070,"span",16),e(1071,"import"),t(),e(1072," "),n(1073,"span",17),e(1074,"{"),t(),e(1075," en_US"),n(1076,"span",17),e(1077,","),t(),e(1078," provideNzI18n "),n(1079,"span",17),e(1080,"}"),t(),e(1081," "),n(1082,"span",16),e(1083,"from"),t(),e(1084," "),n(1085,"span",18),e(1086,"'ng-zorro-antd/i18n'"),t(),n(1087,"span",17),e(1088,";"),t(),e(1089,`
`),n(1090,"span",16),e(1091,"const"),t(),e(1092," customLanguagePack "),n(1093,"span",20),e(1094,"="),t(),e(1095," "),n(1096,"span",17),e(1097,"{"),t(),e(1098,`
en_US`),n(1099,"span",17),e(1100,","),t(),e(1101,`
`),n(1102,"span",20),e(1103,"..."),t(),n(1104,"span",17),e(1105,"{"),t(),e(1106,`
Pagination`),n(1107,"span",20),e(1108,":"),t(),e(1109," "),n(1110,"span",17),e(1111,"{"),t(),e(1112,`
items_per_page`),n(1113,"span",20),e(1114,":"),t(),e(1115," "),n(1116,"span",18),e(1117,"'per page'"),t(),e(1118,`
`),n(1119,"span",17),e(1120,"}"),t(),e(1121,`
`),n(1122,"span",17),e(1123,"}"),t(),e(1124,`
`),n(1125,"span",17),e(1126,"}"),t(),n(1127,"span",17),e(1128,";"),t(),e(1129,`
`),n(1130,"span",16),e(1131,"export"),t(),e(1132," "),n(1133,"span",16),e(1134,"const"),t(),e(1135," appConfig"),n(1136,"span",20),e(1137,":"),t(),e(1138," ApplicationConfig "),n(1139,"span",20),e(1140,"="),t(),e(1141," "),n(1142,"span",17),e(1143,"{"),t(),e(1144,`
providers`),n(1145,"span",20),e(1146,":"),t(),e(1147," "),n(1148,"span",17),e(1149,"["),t(),n(1150,"span",19),e(1151,"provideNzI18n"),t(),n(1152,"span",17),e(1153,"("),t(),e(1154,"customLanguagePack"),n(1155,"span",17),e(1156,")"),t(),n(1157,"span",17),e(1158,"]"),t(),e(1159,`
`),n(1160,"span",17),e(1161,"}"),t(),n(1162,"span",17),e(1163,";"),t(),e(1164,`
`),t()(),o(),t()()),l&2&&(m(5),r("nzOffsetTop",16),m(),r("nzAffix",!1))},dependencies:[u,f,h,c,_,g],encapsulation:2})};export{x as default};