@dso-toolkit/core 67.2.0 → 67.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{annotation-body-0cf33638.js → annotation-body-9e62da5c.js} +2 -2
- package/dist/cjs/{annotation-body-0cf33638.js.map → annotation-body-9e62da5c.js.map} +1 -1
- package/dist/cjs/{annotation-symbol-slot-6665ae62.js → annotation-symbol-slot-46421527.js} +2 -2
- package/dist/cjs/{annotation-symbol-slot-6665ae62.js.map → annotation-symbol-slot-46421527.js.map} +1 -1
- package/dist/cjs/dso-accordion-section.cjs.entry.js +2 -2
- package/dist/cjs/dso-accordion-section.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-accordion.cjs.entry.js +1 -1
- package/dist/cjs/dso-action-list-item.cjs.entry.js +1 -1
- package/dist/cjs/dso-action-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-action-list.cjs.entry.js +2 -2
- package/dist/cjs/dso-action-list.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-advanced-select.cjs.entry.js +2 -2
- package/dist/cjs/dso-alert_6.cjs.entry.js +7 -7
- package/dist/cjs/dso-alert_6.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-activiteit.cjs.entry.js +4 -4
- package/dist/cjs/dso-annotation-activiteit.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-gebiedsaanwijzing.cjs.entry.js +4 -4
- package/dist/cjs/dso-annotation-gebiedsaanwijzing.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-kaart.cjs.entry.js +3 -3
- package/dist/cjs/dso-annotation-kaart.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js +5 -5
- package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-omgevingsnormwaarde.cjs.entry.js +5 -5
- package/dist/cjs/dso-annotation-omgevingsnormwaarde.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-attachments-counter_2.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +4 -4
- package/dist/cjs/dso-autosuggest.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-banner.cjs.entry.js +1 -1
- package/dist/cjs/dso-card-container.cjs.entry.js +1 -1
- package/dist/cjs/dso-card.cjs.entry.js +2 -2
- package/dist/cjs/dso-card.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-date-picker-legacy.cjs.entry.js +1 -1
- package/dist/cjs/dso-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/dso-document-card.cjs.entry.js +1 -1
- package/dist/cjs/dso-dropdown-menu.cjs.entry.js +1 -1
- package/dist/cjs/dso-header.cjs.entry.js +2 -2
- package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +2 -2
- package/dist/cjs/dso-highlight-box.cjs.entry.js +1 -1
- package/dist/cjs/dso-icon.cjs.entry.js +1 -1
- package/dist/cjs/dso-info-button.cjs.entry.js +1 -1
- package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-info_2.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-input-range.cjs.entry.js +1 -1
- package/dist/cjs/dso-label_2.cjs.entry.js +1 -1
- package/dist/cjs/dso-legend-item.cjs.entry.js +1 -1
- package/dist/cjs/dso-list-button.cjs.entry.js +2 -2
- package/dist/cjs/dso-logo.cjs.entry.js +1 -1
- package/dist/cjs/dso-map-base-layers.cjs.entry.js +2 -2
- package/dist/cjs/dso-map-controls.cjs.entry.js +2 -2
- package/dist/cjs/dso-map-overlays.cjs.entry.js +2 -2
- package/dist/cjs/dso-mark-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-modal.cjs.entry.js +2 -2
- package/dist/cjs/dso-pagination.cjs.entry.js +1 -1
- package/dist/cjs/dso-plekinfo-card.cjs.entry.js +2 -2
- package/dist/cjs/dso-plekinfo-card.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/dso-progress-indicator.cjs.entry.js +2 -2
- package/dist/cjs/dso-project-item.cjs.entry.js +1 -1
- package/dist/cjs/dso-renvooi_2.cjs.entry.js +2 -2
- package/dist/cjs/dso-renvooi_2.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-responsive-element.cjs.entry.js +1 -1
- package/dist/cjs/dso-scrollable.cjs.entry.js +1 -1
- package/dist/cjs/dso-skiplink.cjs.entry.js +1 -1
- package/dist/cjs/dso-tab.cjs.entry.js +1 -1
- package/dist/cjs/dso-tabs.cjs.entry.js +1 -1
- package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
- package/dist/cjs/dso-toolkit.cjs.js +2 -2
- package/dist/cjs/dso-toolkit.cjs.js.map +1 -1
- package/dist/cjs/dso-tree-view.cjs.entry.js +1 -1
- package/dist/cjs/dso-viewer-grid.cjs.entry.js +1 -1
- package/dist/cjs/dsot-document-component-demo.cjs.entry.js +1 -1
- package/dist/cjs/{focus-trap.esm-2a6637e5.js → focus-trap.esm-b5c60ce2.js} +4 -18
- package/dist/cjs/focus-trap.esm-b5c60ce2.js.map +1 -0
- package/dist/cjs/{i18n-f7bc1cee.js → i18n-0da568ee.js} +105 -286
- package/dist/cjs/i18n-0da568ee.js.map +1 -0
- package/dist/cjs/{index-af1ebee1.js → index-9c71ed34.js} +3 -3
- package/dist/cjs/index-9c71ed34.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion/components/accordion-section.css +30 -2
- package/dist/collection/components/action-list/action-list.css +4 -4
- package/dist/collection/components/alert/alert.css +16 -16
- package/dist/collection/components/annotation/annotation-omgevingsnormwaarde/annotation-omgevingsnormwaarde.js +1 -1
- package/dist/collection/components/annotation/annotation-omgevingsnormwaarde/annotation-omgevingsnormwaarde.js.map +1 -1
- package/dist/collection/components/annotation/annotation.css +16 -16
- package/dist/collection/components/autosuggest/autosuggest.css +1 -1
- package/dist/collection/components/autosuggest/autosuggest.js +1 -1
- package/dist/collection/components/autosuggest/autosuggest.js.map +1 -1
- package/dist/collection/components/card/card.css +8 -8
- package/dist/collection/components/document-component/document-component.css +22 -28
- package/dist/collection/components/image-overlay/image-overlay.css +16 -16
- package/dist/collection/components/info/info.css +4 -4
- package/dist/collection/components/ozon-content/ozon-content.css +38 -44
- package/dist/collection/components/plekinfo-card/plekinfo-card.css +8 -8
- package/dist/collection/components/renvooi/renvooi.css +8 -8
- package/dist/collection/components/table/table.css +14 -20
- package/dist/collection/utils/i18n.js +1 -0
- package/dist/collection/utils/i18n.js.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/annotation-locatie.js +1 -1
- package/dist/components/annotation-locatie.js.map +1 -1
- package/dist/components/document-component.js +1 -1
- package/dist/components/document-component.js.map +1 -1
- package/dist/components/dso-accordion-section.js +1 -1
- package/dist/components/dso-accordion-section.js.map +1 -1
- package/dist/components/dso-action-list-item.js.map +1 -1
- package/dist/components/dso-action-list.js +1 -1
- package/dist/components/dso-action-list.js.map +1 -1
- package/dist/components/dso-annotation-activiteit.js +1 -1
- package/dist/components/dso-annotation-activiteit.js.map +1 -1
- package/dist/components/dso-annotation-gebiedsaanwijzing.js +1 -1
- package/dist/components/dso-annotation-gebiedsaanwijzing.js.map +1 -1
- package/dist/components/dso-annotation-kaart.js +1 -1
- package/dist/components/dso-annotation-kaart.js.map +1 -1
- package/dist/components/dso-annotation-omgevingsnormwaarde.js +2 -2
- package/dist/components/dso-annotation-omgevingsnormwaarde.js.map +1 -1
- package/dist/components/dso-autosuggest.js +2 -2
- package/dist/components/dso-autosuggest.js.map +1 -1
- package/dist/components/dso-card.js +1 -1
- package/dist/components/dso-card.js.map +1 -1
- package/dist/components/dso-plekinfo-card.js +1 -1
- package/dist/components/dso-plekinfo-card.js.map +1 -1
- package/dist/components/focus-trap.esm.js +3 -17
- package/dist/components/focus-trap.esm.js.map +1 -1
- package/dist/components/i18n.js +104 -285
- package/dist/components/i18n.js.map +1 -1
- package/dist/components/image-overlay.js +1 -1
- package/dist/components/image-overlay.js.map +1 -1
- package/dist/components/info.js +1 -1
- package/dist/components/info.js.map +1 -1
- package/dist/components/ozon-content.js +1 -1
- package/dist/components/ozon-content.js.map +1 -1
- package/dist/components/renvooi.js +1 -1
- package/dist/components/renvooi.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
- package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
- package/dist/dso-toolkit/{p-9d8395bc.entry.js → p-098ff158.entry.js} +2 -2
- package/dist/dso-toolkit/{p-d3857319.entry.js → p-0baa02fe.entry.js} +2 -2
- package/dist/dso-toolkit/p-0baa02fe.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-47ae7799.entry.js → p-0bb48c73.entry.js} +2 -2
- package/dist/dso-toolkit/{p-a2db4965.entry.js → p-0c8a8830.entry.js} +2 -2
- package/dist/dso-toolkit/{p-9df0ed5f.entry.js → p-17795a3a.entry.js} +2 -2
- package/dist/dso-toolkit/p-19421acf.entry.js +2 -0
- package/dist/dso-toolkit/{p-f3717d91.entry.js.map → p-19421acf.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-fb5e4dc9.entry.js → p-1b0a9864.entry.js} +2 -2
- package/dist/dso-toolkit/{p-de63f553.entry.js → p-1d087bc6.entry.js} +2 -2
- package/dist/dso-toolkit/{p-921fe0b7.entry.js → p-20b90390.entry.js} +2 -2
- package/dist/dso-toolkit/p-22af5661.entry.js +2 -0
- package/dist/dso-toolkit/{p-c64628c7.entry.js.map → p-22af5661.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-99995b02.entry.js → p-264f31ed.entry.js} +2 -2
- package/dist/dso-toolkit/{p-39d0a5be.entry.js → p-28182fdb.entry.js} +2 -2
- package/dist/dso-toolkit/p-289d338d.entry.js +2 -0
- package/dist/dso-toolkit/{p-a3c7e119.entry.js.map → p-289d338d.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-7d47fedb.entry.js → p-29ab9e47.entry.js} +2 -2
- package/dist/dso-toolkit/{p-4831099c.entry.js → p-2f25bf04.entry.js} +2 -2
- package/dist/dso-toolkit/{p-c05d8f55.entry.js → p-3b3ee91d.entry.js} +2 -2
- package/dist/dso-toolkit/{p-e42e0cb4.entry.js → p-4094d996.entry.js} +2 -2
- package/dist/dso-toolkit/{p-3e9068cd.entry.js → p-43365ccd.entry.js} +2 -2
- package/dist/dso-toolkit/{p-7b3f08da.entry.js → p-45c45f06.entry.js} +2 -2
- package/dist/dso-toolkit/p-4b21a36d.entry.js +2 -0
- package/dist/dso-toolkit/{p-3e9082b8.entry.js.map → p-4b21a36d.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-cdbb39ad.entry.js → p-51385dad.entry.js} +2 -2
- package/dist/dso-toolkit/p-51385dad.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-7fc1e494.js → p-53096a64.js} +2 -2
- package/dist/dso-toolkit/p-53096a64.js.map +1 -0
- package/dist/dso-toolkit/p-559d80cb.js +2 -0
- package/dist/dso-toolkit/{p-c3e38404.entry.js → p-583222e7.entry.js} +2 -2
- package/dist/dso-toolkit/{p-7dfc15c1.entry.js → p-65ed101b.entry.js} +2 -2
- package/dist/dso-toolkit/{p-b2f92815.entry.js → p-671dc9e8.entry.js} +2 -2
- package/dist/dso-toolkit/{p-1d7b22a2.entry.js → p-6a319038.entry.js} +2 -2
- package/dist/dso-toolkit/{p-a64e9cd5.entry.js → p-6ea8333e.entry.js} +2 -2
- package/dist/dso-toolkit/p-75b53abf.entry.js +2 -0
- package/dist/dso-toolkit/p-75b53abf.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-83f89965.entry.js → p-78b43f2d.entry.js} +2 -2
- package/dist/dso-toolkit/p-8383d346.entry.js +2 -0
- package/dist/dso-toolkit/{p-c2f086f2.entry.js.map → p-8383d346.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-88411ea2.entry.js +2 -0
- package/dist/dso-toolkit/{p-4cb8ef54.entry.js.map → p-88411ea2.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-8b0b2029.entry.js +2 -0
- package/dist/dso-toolkit/{p-2d2eae19.entry.js.map → p-8b0b2029.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-8f1a91bc.entry.js +2 -0
- package/dist/dso-toolkit/{p-a83d9abb.entry.js.map → p-8f1a91bc.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-8fce6b98.entry.js +2 -0
- package/dist/dso-toolkit/{p-52831719.entry.js.map → p-8fce6b98.entry.js.map} +1 -1
- package/dist/dso-toolkit/p-93d7574c.js +2 -0
- package/dist/dso-toolkit/{p-b032496d.entry.js → p-971e3998.entry.js} +2 -2
- package/dist/dso-toolkit/{p-826609e4.entry.js → p-977cc2f7.entry.js} +2 -2
- package/dist/dso-toolkit/{p-38cc23e1.entry.js → p-98899b90.entry.js} +2 -2
- package/dist/dso-toolkit/{p-5e6704bb.entry.js → p-a421fb7b.entry.js} +2 -2
- package/dist/dso-toolkit/{p-21f133e4.entry.js → p-b2899bee.entry.js} +2 -2
- package/dist/dso-toolkit/{p-cb0a7103.entry.js → p-c2f8f46c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-5c047dfd.entry.js → p-c425fe06.entry.js} +2 -2
- package/dist/dso-toolkit/p-c67a3896.entry.js +2 -0
- package/dist/dso-toolkit/{p-d88ebb12.entry.js.map → p-c67a3896.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-5b758af0.entry.js → p-c688843d.entry.js} +2 -2
- package/dist/dso-toolkit/p-c9b922b2.entry.js +2 -0
- package/dist/dso-toolkit/{p-6789163b.entry.js.map → p-c9b922b2.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-75c65097.entry.js → p-de463284.entry.js} +2 -2
- package/dist/dso-toolkit/p-e7a14497.entry.js +2 -0
- package/dist/dso-toolkit/{p-ea87d930.entry.js.map → p-e7a14497.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-ef087d87.entry.js → p-e8ea7939.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8bc5ab4d.entry.js → p-ef108c9f.entry.js} +2 -2
- package/dist/dso-toolkit/p-f02dcd60.entry.js +2 -0
- package/dist/dso-toolkit/{p-b9023062.entry.js.map → p-f02dcd60.entry.js.map} +1 -1
- package/dist/dso-toolkit/{p-08121fee.entry.js → p-f17bf401.entry.js} +2 -2
- package/dist/dso-toolkit/{p-10e0d3c8.entry.js → p-f26ade44.entry.js} +2 -2
- package/dist/dso-toolkit/p-f279a706.js +2 -0
- package/dist/dso-toolkit/p-f279a706.js.map +1 -0
- package/dist/dso-toolkit/p-f31285ef.js +6 -0
- package/dist/dso-toolkit/p-f31285ef.js.map +1 -0
- package/dist/dso-toolkit/{p-bd3ed39f.entry.js → p-fc225870.entry.js} +2 -2
- package/dist/esm/{annotation-body-b9b58856.js → annotation-body-732ca768.js} +2 -2
- package/dist/esm/{annotation-body-b9b58856.js.map → annotation-body-732ca768.js.map} +1 -1
- package/dist/esm/{annotation-symbol-slot-74bf6f43.js → annotation-symbol-slot-568fe5cc.js} +2 -2
- package/dist/esm/{annotation-symbol-slot-74bf6f43.js.map → annotation-symbol-slot-568fe5cc.js.map} +1 -1
- package/dist/esm/dso-accordion-section.entry.js +2 -2
- package/dist/esm/dso-accordion-section.entry.js.map +1 -1
- package/dist/esm/dso-accordion.entry.js +1 -1
- package/dist/esm/dso-action-list-item.entry.js +1 -1
- package/dist/esm/dso-action-list-item.entry.js.map +1 -1
- package/dist/esm/dso-action-list.entry.js +2 -2
- package/dist/esm/dso-action-list.entry.js.map +1 -1
- package/dist/esm/dso-advanced-select.entry.js +2 -2
- package/dist/esm/dso-alert_6.entry.js +7 -7
- package/dist/esm/dso-alert_6.entry.js.map +1 -1
- package/dist/esm/dso-annotation-activiteit.entry.js +4 -4
- package/dist/esm/dso-annotation-activiteit.entry.js.map +1 -1
- package/dist/esm/dso-annotation-gebiedsaanwijzing.entry.js +4 -4
- package/dist/esm/dso-annotation-gebiedsaanwijzing.entry.js.map +1 -1
- package/dist/esm/dso-annotation-kaart.entry.js +3 -3
- package/dist/esm/dso-annotation-kaart.entry.js.map +1 -1
- package/dist/esm/dso-annotation-locatie_2.entry.js +5 -5
- package/dist/esm/dso-annotation-locatie_2.entry.js.map +1 -1
- package/dist/esm/dso-annotation-omgevingsnormwaarde.entry.js +5 -5
- package/dist/esm/dso-annotation-omgevingsnormwaarde.entry.js.map +1 -1
- package/dist/esm/dso-attachments-counter_2.entry.js +1 -1
- package/dist/esm/dso-autosuggest.entry.js +4 -4
- package/dist/esm/dso-autosuggest.entry.js.map +1 -1
- package/dist/esm/dso-banner.entry.js +1 -1
- package/dist/esm/dso-card-container.entry.js +1 -1
- package/dist/esm/dso-card.entry.js +2 -2
- package/dist/esm/dso-card.entry.js.map +1 -1
- package/dist/esm/dso-date-picker-legacy.entry.js +1 -1
- package/dist/esm/dso-date-picker.entry.js +1 -1
- package/dist/esm/dso-document-card.entry.js +1 -1
- package/dist/esm/dso-dropdown-menu.entry.js +1 -1
- package/dist/esm/dso-header.entry.js +2 -2
- package/dist/esm/dso-helpcenter-panel.entry.js +2 -2
- package/dist/esm/dso-highlight-box.entry.js +1 -1
- package/dist/esm/dso-icon.entry.js +1 -1
- package/dist/esm/dso-info-button.entry.js +1 -1
- package/dist/esm/dso-info_2.entry.js +2 -2
- package/dist/esm/dso-info_2.entry.js.map +1 -1
- package/dist/esm/dso-input-range.entry.js +1 -1
- package/dist/esm/dso-label_2.entry.js +1 -1
- package/dist/esm/dso-legend-item.entry.js +1 -1
- package/dist/esm/dso-list-button.entry.js +2 -2
- package/dist/esm/dso-logo.entry.js +1 -1
- package/dist/esm/dso-map-base-layers.entry.js +2 -2
- package/dist/esm/dso-map-controls.entry.js +2 -2
- package/dist/esm/dso-map-overlays.entry.js +2 -2
- package/dist/esm/dso-mark-bar.entry.js +1 -1
- package/dist/esm/dso-modal.entry.js +2 -2
- package/dist/esm/dso-pagination.entry.js +1 -1
- package/dist/esm/dso-plekinfo-card.entry.js +2 -2
- package/dist/esm/dso-plekinfo-card.entry.js.map +1 -1
- package/dist/esm/dso-progress-bar.entry.js +1 -1
- package/dist/esm/dso-progress-indicator.entry.js +2 -2
- package/dist/esm/dso-project-item.entry.js +1 -1
- package/dist/esm/dso-renvooi_2.entry.js +2 -2
- package/dist/esm/dso-renvooi_2.entry.js.map +1 -1
- package/dist/esm/dso-responsive-element.entry.js +1 -1
- package/dist/esm/dso-scrollable.entry.js +1 -1
- package/dist/esm/dso-skiplink.entry.js +1 -1
- package/dist/esm/dso-tab.entry.js +1 -1
- package/dist/esm/dso-tabs.entry.js +1 -1
- package/dist/esm/dso-toggletip.entry.js +1 -1
- package/dist/esm/dso-toolkit.js +3 -3
- package/dist/esm/dso-toolkit.js.map +1 -1
- package/dist/esm/dso-tree-view.entry.js +1 -1
- package/dist/esm/dso-viewer-grid.entry.js +1 -1
- package/dist/esm/dsot-document-component-demo.entry.js +1 -1
- package/dist/esm/{focus-trap.esm-c9e1f389.js → focus-trap.esm-26a44fc9.js} +4 -18
- package/dist/esm/focus-trap.esm-26a44fc9.js.map +1 -0
- package/dist/esm/{i18n-f2d58c82.js → i18n-43c79e8f.js} +105 -286
- package/dist/esm/i18n-43c79e8f.js.map +1 -0
- package/dist/esm/{index-75547ccd.js → index-60b7c895.js} +3 -3
- package/dist/esm/index-60b7c895.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/package.json +9 -9
- package/dist/cjs/focus-trap.esm-2a6637e5.js.map +0 -1
- package/dist/cjs/i18n-f7bc1cee.js.map +0 -1
- package/dist/cjs/index-af1ebee1.js.map +0 -1
- package/dist/dso-toolkit/p-13396f6d.js +0 -2
- package/dist/dso-toolkit/p-2d2eae19.entry.js +0 -2
- package/dist/dso-toolkit/p-3e9082b8.entry.js +0 -2
- package/dist/dso-toolkit/p-4cb8ef54.entry.js +0 -2
- package/dist/dso-toolkit/p-52831719.entry.js +0 -2
- package/dist/dso-toolkit/p-52a2c0b3.entry.js +0 -2
- package/dist/dso-toolkit/p-52a2c0b3.entry.js.map +0 -1
- package/dist/dso-toolkit/p-5f4e8468.js +0 -6
- package/dist/dso-toolkit/p-5f4e8468.js.map +0 -1
- package/dist/dso-toolkit/p-672b0b80.js +0 -2
- package/dist/dso-toolkit/p-672b0b80.js.map +0 -1
- package/dist/dso-toolkit/p-6789163b.entry.js +0 -2
- package/dist/dso-toolkit/p-7fc1e494.js.map +0 -1
- package/dist/dso-toolkit/p-a3c7e119.entry.js +0 -2
- package/dist/dso-toolkit/p-a83d9abb.entry.js +0 -2
- package/dist/dso-toolkit/p-b9023062.entry.js +0 -2
- package/dist/dso-toolkit/p-c2f086f2.entry.js +0 -2
- package/dist/dso-toolkit/p-c64628c7.entry.js +0 -2
- package/dist/dso-toolkit/p-cdbb39ad.entry.js.map +0 -1
- package/dist/dso-toolkit/p-d3857319.entry.js.map +0 -1
- package/dist/dso-toolkit/p-d88ebb12.entry.js +0 -2
- package/dist/dso-toolkit/p-ea87d930.entry.js +0 -2
- package/dist/dso-toolkit/p-f11d080a.js +0 -2
- package/dist/dso-toolkit/p-f3717d91.entry.js +0 -2
- package/dist/esm/focus-trap.esm-c9e1f389.js.map +0 -1
- package/dist/esm/i18n-f2d58c82.js.map +0 -1
- package/dist/esm/index-75547ccd.js.map +0 -1
- /package/dist/dso-toolkit/{p-9d8395bc.entry.js.map → p-098ff158.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-47ae7799.entry.js.map → p-0bb48c73.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-a2db4965.entry.js.map → p-0c8a8830.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-9df0ed5f.entry.js.map → p-17795a3a.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-fb5e4dc9.entry.js.map → p-1b0a9864.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-de63f553.entry.js.map → p-1d087bc6.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-921fe0b7.entry.js.map → p-20b90390.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-99995b02.entry.js.map → p-264f31ed.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-39d0a5be.entry.js.map → p-28182fdb.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-7d47fedb.entry.js.map → p-29ab9e47.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-4831099c.entry.js.map → p-2f25bf04.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-c05d8f55.entry.js.map → p-3b3ee91d.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-e42e0cb4.entry.js.map → p-4094d996.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-3e9068cd.entry.js.map → p-43365ccd.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-7b3f08da.entry.js.map → p-45c45f06.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-13396f6d.js.map → p-559d80cb.js.map} +0 -0
- /package/dist/dso-toolkit/{p-c3e38404.entry.js.map → p-583222e7.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-7dfc15c1.entry.js.map → p-65ed101b.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-b2f92815.entry.js.map → p-671dc9e8.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-1d7b22a2.entry.js.map → p-6a319038.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-a64e9cd5.entry.js.map → p-6ea8333e.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-83f89965.entry.js.map → p-78b43f2d.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-f11d080a.js.map → p-93d7574c.js.map} +0 -0
- /package/dist/dso-toolkit/{p-b032496d.entry.js.map → p-971e3998.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-826609e4.entry.js.map → p-977cc2f7.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-38cc23e1.entry.js.map → p-98899b90.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-5e6704bb.entry.js.map → p-a421fb7b.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-21f133e4.entry.js.map → p-b2899bee.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-cb0a7103.entry.js.map → p-c2f8f46c.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-5c047dfd.entry.js.map → p-c425fe06.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-5b758af0.entry.js.map → p-c688843d.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-75c65097.entry.js.map → p-de463284.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-ef087d87.entry.js.map → p-e8ea7939.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-8bc5ab4d.entry.js.map → p-ef108c9f.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-08121fee.entry.js.map → p-f17bf401.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-10e0d3c8.entry.js.map → p-f26ade44.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-bd3ed39f.entry.js.map → p-fc225870.entry.js.map} +0 -0
|
@@ -60,7 +60,7 @@ const setPath = (object, path, newValue) => {
|
|
|
60
60
|
e = `${p[p.length - 1]}.${e}`;
|
|
61
61
|
p = p.slice(0, p.length - 1);
|
|
62
62
|
last = getLastOfPath(object, p, Object);
|
|
63
|
-
if (last
|
|
63
|
+
if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
|
|
64
64
|
last.obj = undefined;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -187,7 +187,7 @@ const deepFind = function (obj, path) {
|
|
|
187
187
|
}
|
|
188
188
|
return current;
|
|
189
189
|
};
|
|
190
|
-
const getCleanedCode = code => code
|
|
190
|
+
const getCleanedCode = code => code?.replace('_', '-');
|
|
191
191
|
|
|
192
192
|
const consoleLogger = {
|
|
193
193
|
type: 'logger',
|
|
@@ -201,7 +201,7 @@ const consoleLogger = {
|
|
|
201
201
|
this.output('error', args);
|
|
202
202
|
},
|
|
203
203
|
output(type, args) {
|
|
204
|
-
|
|
204
|
+
console?.[type]?.apply?.(console, args);
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
207
|
class Logger {
|
|
@@ -359,7 +359,7 @@ class ResourceStore extends EventEmitter {
|
|
|
359
359
|
key = path.slice(2).join('.');
|
|
360
360
|
}
|
|
361
361
|
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
362
|
-
return deepFind(this.data
|
|
362
|
+
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
363
363
|
}
|
|
364
364
|
addResource(lng, ns, key, value) {
|
|
365
365
|
let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
@@ -426,10 +426,6 @@ class ResourceStore extends EventEmitter {
|
|
|
426
426
|
}
|
|
427
427
|
getResourceBundle(lng, ns) {
|
|
428
428
|
if (!ns) ns = this.options.defaultNS;
|
|
429
|
-
if (this.options.compatibilityAPI === 'v1') return {
|
|
430
|
-
...{},
|
|
431
|
-
...this.getResource(lng, ns)
|
|
432
|
-
};
|
|
433
429
|
return this.getResource(lng, ns);
|
|
434
430
|
}
|
|
435
431
|
getDataByLanguage(lng) {
|
|
@@ -452,7 +448,7 @@ var postProcessor = {
|
|
|
452
448
|
},
|
|
453
449
|
handle(processors, value, key, options, translator) {
|
|
454
450
|
processors.forEach(processor => {
|
|
455
|
-
|
|
451
|
+
value = this.processors[processor]?.process(value, key, options, translator) ?? value;
|
|
456
452
|
});
|
|
457
453
|
return value;
|
|
458
454
|
}
|
|
@@ -481,7 +477,7 @@ class Translator extends EventEmitter {
|
|
|
481
477
|
return false;
|
|
482
478
|
}
|
|
483
479
|
const resolved = this.resolve(key, options);
|
|
484
|
-
return resolved
|
|
480
|
+
return resolved?.res !== undefined;
|
|
485
481
|
}
|
|
486
482
|
extractFromKey(key, options) {
|
|
487
483
|
let nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
|
|
@@ -526,7 +522,7 @@ class Translator extends EventEmitter {
|
|
|
526
522
|
const namespace = namespaces[namespaces.length - 1];
|
|
527
523
|
const lng = options.lng || this.language;
|
|
528
524
|
const appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
529
|
-
if (lng
|
|
525
|
+
if (lng?.toLowerCase() === 'cimode') {
|
|
530
526
|
if (appendNamespaceToCIMode) {
|
|
531
527
|
const nsSeparator = options.nsSeparator || this.options.nsSeparator;
|
|
532
528
|
if (returnDetails) {
|
|
@@ -554,9 +550,9 @@ class Translator extends EventEmitter {
|
|
|
554
550
|
return key;
|
|
555
551
|
}
|
|
556
552
|
const resolved = this.resolve(keys, options);
|
|
557
|
-
let res = resolved
|
|
558
|
-
const resUsedKey = resolved
|
|
559
|
-
const resExactUsedKey = resolved
|
|
553
|
+
let res = resolved?.res;
|
|
554
|
+
const resUsedKey = resolved?.usedKey || key;
|
|
555
|
+
const resExactUsedKey = resolved?.exactUsedKey || key;
|
|
560
556
|
const resType = Object.prototype.toString.apply(res);
|
|
561
557
|
const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
|
|
562
558
|
const joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
|
|
@@ -609,7 +605,7 @@ class Translator extends EventEmitter {
|
|
|
609
605
|
const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
|
|
610
606
|
ordinal: false
|
|
611
607
|
}) : '';
|
|
612
|
-
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0
|
|
608
|
+
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
|
|
613
609
|
const defaultValue = needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] || options[`defaultValue${defaultValueSuffix}`] || options[`defaultValue${defaultValueSuffixOrdinalFallback}`] || options.defaultValue;
|
|
614
610
|
if (!this.isValidLookup(res) && hasDefaultValue) {
|
|
615
611
|
usedDefault = true;
|
|
@@ -646,7 +642,7 @@ class Translator extends EventEmitter {
|
|
|
646
642
|
const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
|
647
643
|
if (this.options.missingKeyHandler) {
|
|
648
644
|
this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
649
|
-
} else if (this.backendConnector
|
|
645
|
+
} else if (this.backendConnector?.saveMissing) {
|
|
650
646
|
this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
651
647
|
}
|
|
652
648
|
this.emit('missingKey', l, namespace, k, res);
|
|
@@ -670,11 +666,7 @@ class Translator extends EventEmitter {
|
|
|
670
666
|
res = this.extendTranslation(res, keys, options, resolved, lastKey);
|
|
671
667
|
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;
|
|
672
668
|
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
673
|
-
|
|
674
|
-
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);
|
|
675
|
-
} else {
|
|
676
|
-
res = this.options.parseMissingKeyHandler(res);
|
|
677
|
-
}
|
|
669
|
+
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);
|
|
678
670
|
}
|
|
679
671
|
}
|
|
680
672
|
if (returnDetails) {
|
|
@@ -686,7 +678,7 @@ class Translator extends EventEmitter {
|
|
|
686
678
|
}
|
|
687
679
|
extendTranslation(res, key, options, resolved, lastKey) {
|
|
688
680
|
var _this = this;
|
|
689
|
-
if (this.i18nFormat
|
|
681
|
+
if (this.i18nFormat?.parse) {
|
|
690
682
|
res = this.i18nFormat.parse(res, {
|
|
691
683
|
...this.options.interpolation.defaultVariables,
|
|
692
684
|
...options
|
|
@@ -703,7 +695,7 @@ class Translator extends EventEmitter {
|
|
|
703
695
|
}
|
|
704
696
|
}
|
|
705
697
|
});
|
|
706
|
-
const skipOnVariables = isString(res) && (options
|
|
698
|
+
const skipOnVariables = isString(res) && (options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
707
699
|
let nestBef;
|
|
708
700
|
if (skipOnVariables) {
|
|
709
701
|
const nb = res.match(this.interpolator.nestingRegexp);
|
|
@@ -720,12 +712,12 @@ class Translator extends EventEmitter {
|
|
|
720
712
|
const nestAft = na && na.length;
|
|
721
713
|
if (nestBef < nestAft) options.nest = false;
|
|
722
714
|
}
|
|
723
|
-
if (!options.lng &&
|
|
715
|
+
if (!options.lng && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
|
|
724
716
|
if (options.nest !== false) res = this.interpolator.nest(res, function () {
|
|
725
717
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
726
718
|
args[_key] = arguments[_key];
|
|
727
719
|
}
|
|
728
|
-
if (lastKey
|
|
720
|
+
if (lastKey?.[0] === args[0] && !options.context) {
|
|
729
721
|
_this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
|
|
730
722
|
return null;
|
|
731
723
|
}
|
|
@@ -735,7 +727,7 @@ class Translator extends EventEmitter {
|
|
|
735
727
|
}
|
|
736
728
|
const postProcess = options.postProcess || this.options.postProcess;
|
|
737
729
|
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
738
|
-
if (res !== undefined && res !== null && postProcessorNames
|
|
730
|
+
if (res !== undefined && res !== null && postProcessorNames?.length && options.applyPostProcessor !== false) {
|
|
739
731
|
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
740
732
|
i18nResolved: {
|
|
741
733
|
...resolved,
|
|
@@ -762,13 +754,13 @@ class Translator extends EventEmitter {
|
|
|
762
754
|
let namespaces = extracted.namespaces;
|
|
763
755
|
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
764
756
|
const needsPluralHandling = options.count !== undefined && !isString(options.count);
|
|
765
|
-
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0
|
|
757
|
+
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
|
|
766
758
|
const needsContextHandling = options.context !== undefined && (isString(options.context) || typeof options.context === 'number') && options.context !== '';
|
|
767
759
|
const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
|
|
768
760
|
namespaces.forEach(ns => {
|
|
769
761
|
if (this.isValidLookup(found)) return;
|
|
770
762
|
usedNS = ns;
|
|
771
|
-
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils
|
|
763
|
+
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
|
|
772
764
|
checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
773
765
|
this.logger.warn(`key "${usedKey}" for languages "${codes.join(', ')}" won't get resolved as namespace "${usedNS}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
774
766
|
}
|
|
@@ -776,7 +768,7 @@ class Translator extends EventEmitter {
|
|
|
776
768
|
if (this.isValidLookup(found)) return;
|
|
777
769
|
usedLng = code;
|
|
778
770
|
const finalKeys = [key];
|
|
779
|
-
if (this.i18nFormat
|
|
771
|
+
if (this.i18nFormat?.addLookupKeys) {
|
|
780
772
|
this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
|
|
781
773
|
} else {
|
|
782
774
|
let pluralSuffix;
|
|
@@ -829,7 +821,7 @@ class Translator extends EventEmitter {
|
|
|
829
821
|
}
|
|
830
822
|
getResource(code, ns, key) {
|
|
831
823
|
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
832
|
-
if (this.i18nFormat
|
|
824
|
+
if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
|
833
825
|
return this.resourceStore.getResource(code, ns, key, options);
|
|
834
826
|
}
|
|
835
827
|
getUsedParamsDetails() {
|
|
@@ -867,7 +859,6 @@ class Translator extends EventEmitter {
|
|
|
867
859
|
}
|
|
868
860
|
}
|
|
869
861
|
|
|
870
|
-
const capitalize = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
871
862
|
class LanguageUtil {
|
|
872
863
|
constructor(options) {
|
|
873
864
|
this.options = options;
|
|
@@ -891,31 +882,18 @@ class LanguageUtil {
|
|
|
891
882
|
}
|
|
892
883
|
formatLanguageCode(code) {
|
|
893
884
|
if (isString(code) && code.indexOf('-') > -1) {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
if (formattedCode) return formattedCode;
|
|
901
|
-
} catch (e) {}
|
|
885
|
+
let formattedCode;
|
|
886
|
+
try {
|
|
887
|
+
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
888
|
+
} catch (e) {}
|
|
889
|
+
if (formattedCode && this.options.lowerCaseLng) {
|
|
890
|
+
formattedCode = formattedCode.toLowerCase();
|
|
902
891
|
}
|
|
903
|
-
|
|
904
|
-
let p = code.split('-');
|
|
892
|
+
if (formattedCode) return formattedCode;
|
|
905
893
|
if (this.options.lowerCaseLng) {
|
|
906
|
-
|
|
907
|
-
} else if (p.length === 2) {
|
|
908
|
-
p[0] = p[0].toLowerCase();
|
|
909
|
-
p[1] = p[1].toUpperCase();
|
|
910
|
-
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
911
|
-
} else if (p.length === 3) {
|
|
912
|
-
p[0] = p[0].toLowerCase();
|
|
913
|
-
if (p[1].length === 2) p[1] = p[1].toUpperCase();
|
|
914
|
-
if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();
|
|
915
|
-
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
916
|
-
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
|
|
894
|
+
return code.toLowerCase();
|
|
917
895
|
}
|
|
918
|
-
return
|
|
896
|
+
return code;
|
|
919
897
|
}
|
|
920
898
|
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
|
921
899
|
}
|
|
@@ -987,125 +965,6 @@ class LanguageUtil {
|
|
|
987
965
|
}
|
|
988
966
|
}
|
|
989
967
|
|
|
990
|
-
let sets = [{
|
|
991
|
-
lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],
|
|
992
|
-
nr: [1, 2],
|
|
993
|
-
fc: 1
|
|
994
|
-
}, {
|
|
995
|
-
lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],
|
|
996
|
-
nr: [1, 2],
|
|
997
|
-
fc: 2
|
|
998
|
-
}, {
|
|
999
|
-
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
|
|
1000
|
-
nr: [1],
|
|
1001
|
-
fc: 3
|
|
1002
|
-
}, {
|
|
1003
|
-
lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],
|
|
1004
|
-
nr: [1, 2, 5],
|
|
1005
|
-
fc: 4
|
|
1006
|
-
}, {
|
|
1007
|
-
lngs: ['ar'],
|
|
1008
|
-
nr: [0, 1, 2, 3, 11, 100],
|
|
1009
|
-
fc: 5
|
|
1010
|
-
}, {
|
|
1011
|
-
lngs: ['cs', 'sk'],
|
|
1012
|
-
nr: [1, 2, 5],
|
|
1013
|
-
fc: 6
|
|
1014
|
-
}, {
|
|
1015
|
-
lngs: ['csb', 'pl'],
|
|
1016
|
-
nr: [1, 2, 5],
|
|
1017
|
-
fc: 7
|
|
1018
|
-
}, {
|
|
1019
|
-
lngs: ['cy'],
|
|
1020
|
-
nr: [1, 2, 3, 8],
|
|
1021
|
-
fc: 8
|
|
1022
|
-
}, {
|
|
1023
|
-
lngs: ['fr'],
|
|
1024
|
-
nr: [1, 2],
|
|
1025
|
-
fc: 9
|
|
1026
|
-
}, {
|
|
1027
|
-
lngs: ['ga'],
|
|
1028
|
-
nr: [1, 2, 3, 7, 11],
|
|
1029
|
-
fc: 10
|
|
1030
|
-
}, {
|
|
1031
|
-
lngs: ['gd'],
|
|
1032
|
-
nr: [1, 2, 3, 20],
|
|
1033
|
-
fc: 11
|
|
1034
|
-
}, {
|
|
1035
|
-
lngs: ['is'],
|
|
1036
|
-
nr: [1, 2],
|
|
1037
|
-
fc: 12
|
|
1038
|
-
}, {
|
|
1039
|
-
lngs: ['jv'],
|
|
1040
|
-
nr: [0, 1],
|
|
1041
|
-
fc: 13
|
|
1042
|
-
}, {
|
|
1043
|
-
lngs: ['kw'],
|
|
1044
|
-
nr: [1, 2, 3, 4],
|
|
1045
|
-
fc: 14
|
|
1046
|
-
}, {
|
|
1047
|
-
lngs: ['lt'],
|
|
1048
|
-
nr: [1, 2, 10],
|
|
1049
|
-
fc: 15
|
|
1050
|
-
}, {
|
|
1051
|
-
lngs: ['lv'],
|
|
1052
|
-
nr: [1, 2, 0],
|
|
1053
|
-
fc: 16
|
|
1054
|
-
}, {
|
|
1055
|
-
lngs: ['mk'],
|
|
1056
|
-
nr: [1, 2],
|
|
1057
|
-
fc: 17
|
|
1058
|
-
}, {
|
|
1059
|
-
lngs: ['mnk'],
|
|
1060
|
-
nr: [0, 1, 2],
|
|
1061
|
-
fc: 18
|
|
1062
|
-
}, {
|
|
1063
|
-
lngs: ['mt'],
|
|
1064
|
-
nr: [1, 2, 11, 20],
|
|
1065
|
-
fc: 19
|
|
1066
|
-
}, {
|
|
1067
|
-
lngs: ['or'],
|
|
1068
|
-
nr: [2, 1],
|
|
1069
|
-
fc: 2
|
|
1070
|
-
}, {
|
|
1071
|
-
lngs: ['ro'],
|
|
1072
|
-
nr: [1, 2, 20],
|
|
1073
|
-
fc: 20
|
|
1074
|
-
}, {
|
|
1075
|
-
lngs: ['sl'],
|
|
1076
|
-
nr: [5, 1, 2, 3],
|
|
1077
|
-
fc: 21
|
|
1078
|
-
}, {
|
|
1079
|
-
lngs: ['he', 'iw'],
|
|
1080
|
-
nr: [1, 2, 20, 21],
|
|
1081
|
-
fc: 22
|
|
1082
|
-
}];
|
|
1083
|
-
let _rulesPluralsTypes = {
|
|
1084
|
-
1: n => Number(n > 1),
|
|
1085
|
-
2: n => Number(n != 1),
|
|
1086
|
-
3: n => 0,
|
|
1087
|
-
4: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1088
|
-
5: n => Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5),
|
|
1089
|
-
6: n => Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2),
|
|
1090
|
-
7: n => Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1091
|
-
8: n => Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3),
|
|
1092
|
-
9: n => Number(n >= 2),
|
|
1093
|
-
10: n => Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4),
|
|
1094
|
-
11: n => Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3),
|
|
1095
|
-
12: n => Number(n % 10 != 1 || n % 100 == 11),
|
|
1096
|
-
13: n => Number(n !== 0),
|
|
1097
|
-
14: n => Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3),
|
|
1098
|
-
15: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1099
|
-
16: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2),
|
|
1100
|
-
17: n => Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1),
|
|
1101
|
-
18: n => Number(n == 0 ? 0 : n == 1 ? 1 : 2),
|
|
1102
|
-
19: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3),
|
|
1103
|
-
20: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2),
|
|
1104
|
-
21: n => Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0),
|
|
1105
|
-
22: n => Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3)
|
|
1106
|
-
};
|
|
1107
|
-
const nonIntlVersions = ['v1', 'v2', 'v3'];
|
|
1108
|
-
const intlVersions = ['v4'];
|
|
1109
968
|
const suffixesOrder = {
|
|
1110
969
|
zero: 0,
|
|
1111
970
|
one: 1,
|
|
@@ -1114,17 +973,11 @@ const suffixesOrder = {
|
|
|
1114
973
|
many: 4,
|
|
1115
974
|
other: 5
|
|
1116
975
|
};
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
numbers: set.nr,
|
|
1123
|
-
plurals: _rulesPluralsTypes[set.fc]
|
|
1124
|
-
};
|
|
1125
|
-
});
|
|
1126
|
-
});
|
|
1127
|
-
return rules;
|
|
976
|
+
const dummyRule = {
|
|
977
|
+
select: count => count === 1 ? 'one' : 'other',
|
|
978
|
+
resolvedOptions: () => ({
|
|
979
|
+
pluralCategories: ['one', 'other']
|
|
980
|
+
})
|
|
1128
981
|
};
|
|
1129
982
|
class PluralResolver {
|
|
1130
983
|
constructor(languageUtils) {
|
|
@@ -1132,11 +985,6 @@ class PluralResolver {
|
|
|
1132
985
|
this.languageUtils = languageUtils;
|
|
1133
986
|
this.options = options;
|
|
1134
987
|
this.logger = baseLogger.create('pluralResolver');
|
|
1135
|
-
if ((!this.options.compatibilityJSON || intlVersions.includes(this.options.compatibilityJSON)) && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
|
|
1136
|
-
this.options.compatibilityJSON = 'v3';
|
|
1137
|
-
this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');
|
|
1138
|
-
}
|
|
1139
|
-
this.rules = createRules();
|
|
1140
988
|
this.pluralRulesCache = {};
|
|
1141
989
|
}
|
|
1142
990
|
addRule(lng, obj) {
|
|
@@ -1147,35 +995,37 @@ class PluralResolver {
|
|
|
1147
995
|
}
|
|
1148
996
|
getRule(code) {
|
|
1149
997
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
return;
|
|
998
|
+
const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
|
|
999
|
+
const type = options.ordinal ? 'ordinal' : 'cardinal';
|
|
1000
|
+
const cacheKey = JSON.stringify({
|
|
1001
|
+
cleanedCode,
|
|
1002
|
+
type
|
|
1003
|
+
});
|
|
1004
|
+
if (cacheKey in this.pluralRulesCache) {
|
|
1005
|
+
return this.pluralRulesCache[cacheKey];
|
|
1006
|
+
}
|
|
1007
|
+
let rule;
|
|
1008
|
+
try {
|
|
1009
|
+
rule = new Intl.PluralRules(cleanedCode, {
|
|
1010
|
+
type
|
|
1011
|
+
});
|
|
1012
|
+
} catch (err) {
|
|
1013
|
+
if (!Intl) {
|
|
1014
|
+
this.logger.error('No Intl support, please use an Intl polyfill!');
|
|
1015
|
+
return dummyRule;
|
|
1168
1016
|
}
|
|
1017
|
+
if (!code.match(/-|_/)) return dummyRule;
|
|
1018
|
+
const lngPart = this.languageUtils.getLanguagePartFromCode(code);
|
|
1019
|
+
rule = this.getRule(lngPart, options);
|
|
1169
1020
|
}
|
|
1170
|
-
|
|
1021
|
+
this.pluralRulesCache[cacheKey] = rule;
|
|
1022
|
+
return rule;
|
|
1171
1023
|
}
|
|
1172
1024
|
needsPlural(code) {
|
|
1173
1025
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1174
|
-
|
|
1175
|
-
if (this.
|
|
1176
|
-
|
|
1177
|
-
}
|
|
1178
|
-
return rule && rule.numbers.length > 1;
|
|
1026
|
+
let rule = this.getRule(code, options);
|
|
1027
|
+
if (!rule) rule = this.getRule('dev', options);
|
|
1028
|
+
return rule?.resolvedOptions().pluralCategories.length > 1;
|
|
1179
1029
|
}
|
|
1180
1030
|
getPluralFormsOfKey(code, key) {
|
|
1181
1031
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -1183,51 +1033,19 @@ class PluralResolver {
|
|
|
1183
1033
|
}
|
|
1184
1034
|
getSuffixes(code) {
|
|
1185
1035
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1186
|
-
|
|
1187
|
-
if (!rule)
|
|
1188
|
-
|
|
1189
|
-
}
|
|
1190
|
-
if (this.shouldUseIntlApi()) {
|
|
1191
|
-
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1192
|
-
}
|
|
1193
|
-
return rule.numbers.map(number => this.getSuffix(code, number, options));
|
|
1036
|
+
let rule = this.getRule(code, options);
|
|
1037
|
+
if (!rule) rule = this.getRule('dev', options);
|
|
1038
|
+
if (!rule) return [];
|
|
1039
|
+
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1194
1040
|
}
|
|
1195
1041
|
getSuffix(code, count) {
|
|
1196
1042
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1197
1043
|
const rule = this.getRule(code, options);
|
|
1198
1044
|
if (rule) {
|
|
1199
|
-
|
|
1200
|
-
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1201
|
-
}
|
|
1202
|
-
return this.getSuffixRetroCompatible(rule, count);
|
|
1045
|
+
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1203
1046
|
}
|
|
1204
1047
|
this.logger.warn(`no plural rule found for: ${code}`);
|
|
1205
|
-
return '';
|
|
1206
|
-
}
|
|
1207
|
-
getSuffixRetroCompatible(rule, count) {
|
|
1208
|
-
const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
|
|
1209
|
-
let suffix = rule.numbers[idx];
|
|
1210
|
-
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1211
|
-
if (suffix === 2) {
|
|
1212
|
-
suffix = 'plural';
|
|
1213
|
-
} else if (suffix === 1) {
|
|
1214
|
-
suffix = '';
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
const returnSuffix = () => this.options.prepend && suffix.toString() ? this.options.prepend + suffix.toString() : suffix.toString();
|
|
1218
|
-
if (this.options.compatibilityJSON === 'v1') {
|
|
1219
|
-
if (suffix === 1) return '';
|
|
1220
|
-
if (typeof suffix === 'number') return `_plural_${suffix.toString()}`;
|
|
1221
|
-
return returnSuffix();
|
|
1222
|
-
} else if (this.options.compatibilityJSON === 'v2') {
|
|
1223
|
-
return returnSuffix();
|
|
1224
|
-
} else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1225
|
-
return returnSuffix();
|
|
1226
|
-
}
|
|
1227
|
-
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
|
|
1228
|
-
}
|
|
1229
|
-
shouldUseIntlApi() {
|
|
1230
|
-
return !nonIntlVersions.includes(this.options.compatibilityJSON);
|
|
1048
|
+
return this.getSuffix('dev', count, options);
|
|
1231
1049
|
}
|
|
1232
1050
|
}
|
|
1233
1051
|
|
|
@@ -1247,7 +1065,7 @@ class Interpolator {
|
|
|
1247
1065
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1248
1066
|
this.logger = baseLogger.create('interpolator');
|
|
1249
1067
|
this.options = options;
|
|
1250
|
-
this.format = options
|
|
1068
|
+
this.format = options?.interpolation?.format || (value => value);
|
|
1251
1069
|
this.init(options);
|
|
1252
1070
|
}
|
|
1253
1071
|
init() {
|
|
@@ -1294,7 +1112,7 @@ class Interpolator {
|
|
|
1294
1112
|
}
|
|
1295
1113
|
resetRegExp() {
|
|
1296
1114
|
const getOrResetRegExp = (existingRegExp, pattern) => {
|
|
1297
|
-
if (existingRegExp
|
|
1115
|
+
if (existingRegExp?.source === pattern) {
|
|
1298
1116
|
existingRegExp.lastIndex = 0;
|
|
1299
1117
|
return existingRegExp;
|
|
1300
1118
|
}
|
|
@@ -1328,8 +1146,8 @@ class Interpolator {
|
|
|
1328
1146
|
});
|
|
1329
1147
|
};
|
|
1330
1148
|
this.resetRegExp();
|
|
1331
|
-
const missingInterpolationHandler = options
|
|
1332
|
-
const skipOnVariables = options
|
|
1149
|
+
const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
|
1150
|
+
const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1333
1151
|
const todos = [{
|
|
1334
1152
|
regex: this.regexpUnescape,
|
|
1335
1153
|
safeValue: val => regexSafe(val)
|
|
@@ -1388,7 +1206,7 @@ class Interpolator {
|
|
|
1388
1206
|
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1389
1207
|
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
1390
1208
|
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1391
|
-
if (matchedSingleQuotes
|
|
1209
|
+
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
|
|
1392
1210
|
optionsString = optionsString.replace(/'/g, '"');
|
|
1393
1211
|
}
|
|
1394
1212
|
try {
|
|
@@ -1556,7 +1374,7 @@ class Formatter {
|
|
|
1556
1374
|
if (this.formats[formatName]) {
|
|
1557
1375
|
let formatted = mem;
|
|
1558
1376
|
try {
|
|
1559
|
-
const valOptions = options
|
|
1377
|
+
const valOptions = options?.formatParams?.[options.interpolationkey] || {};
|
|
1560
1378
|
const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
|
1561
1379
|
formatted = this.formats[formatName](mem, l, {
|
|
1562
1380
|
...formatOptions,
|
|
@@ -1599,9 +1417,7 @@ class Connector extends EventEmitter {
|
|
|
1599
1417
|
this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
|
|
1600
1418
|
this.state = {};
|
|
1601
1419
|
this.queue = [];
|
|
1602
|
-
|
|
1603
|
-
this.backend.init(services, options.backend, options);
|
|
1604
|
-
}
|
|
1420
|
+
this.backend?.init?.(services, options.backend, options);
|
|
1605
1421
|
}
|
|
1606
1422
|
queueLoad(languages, namespaces, options, callback) {
|
|
1607
1423
|
const toLoad = {};
|
|
@@ -1767,12 +1583,12 @@ class Connector extends EventEmitter {
|
|
|
1767
1583
|
saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
|
1768
1584
|
let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
1769
1585
|
let clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => {};
|
|
1770
|
-
if (this.services
|
|
1586
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
|
|
1771
1587
|
this.logger.warn(`did not save key "${key}" as the namespace "${namespace}" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
|
1772
1588
|
return;
|
|
1773
1589
|
}
|
|
1774
1590
|
if (key === undefined || key === null || key === '') return;
|
|
1775
|
-
if (this.backend
|
|
1591
|
+
if (this.backend?.create) {
|
|
1776
1592
|
const opts = {
|
|
1777
1593
|
...options,
|
|
1778
1594
|
isUpdate
|
|
@@ -1805,7 +1621,7 @@ class Connector extends EventEmitter {
|
|
|
1805
1621
|
|
|
1806
1622
|
const get = () => ({
|
|
1807
1623
|
debug: false,
|
|
1808
|
-
|
|
1624
|
+
initAsync: true,
|
|
1809
1625
|
ns: ['translation'],
|
|
1810
1626
|
defaultNS: ['translation'],
|
|
1811
1627
|
fallbackLng: ['dev'],
|
|
@@ -1867,9 +1683,10 @@ const transformOptions = options => {
|
|
|
1867
1683
|
if (isString(options.ns)) options.ns = [options.ns];
|
|
1868
1684
|
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
1869
1685
|
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
1870
|
-
if (options.supportedLngs
|
|
1686
|
+
if (options.supportedLngs?.indexOf?.('cimode') < 0) {
|
|
1871
1687
|
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
|
1872
1688
|
}
|
|
1689
|
+
if (typeof options.initImmediate === 'boolean') options.initAsync = options.initImmediate;
|
|
1873
1690
|
return options;
|
|
1874
1691
|
};
|
|
1875
1692
|
|
|
@@ -1895,7 +1712,7 @@ class I18n extends EventEmitter {
|
|
|
1895
1712
|
};
|
|
1896
1713
|
bindMemberFunctions(this);
|
|
1897
1714
|
if (callback && !this.isInitialized && !options.isClone) {
|
|
1898
|
-
if (!this.options.
|
|
1715
|
+
if (!this.options.initAsync) {
|
|
1899
1716
|
this.init(options, callback);
|
|
1900
1717
|
return this;
|
|
1901
1718
|
}
|
|
@@ -1926,12 +1743,10 @@ class I18n extends EventEmitter {
|
|
|
1926
1743
|
...this.options,
|
|
1927
1744
|
...transformOptions(options)
|
|
1928
1745
|
};
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
};
|
|
1934
|
-
}
|
|
1746
|
+
this.options.interpolation = {
|
|
1747
|
+
...defOpts.interpolation,
|
|
1748
|
+
...this.options.interpolation
|
|
1749
|
+
};
|
|
1935
1750
|
if (options.keySeparator !== undefined) {
|
|
1936
1751
|
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
1937
1752
|
}
|
|
@@ -1952,7 +1767,7 @@ class I18n extends EventEmitter {
|
|
|
1952
1767
|
let formatter;
|
|
1953
1768
|
if (this.modules.formatter) {
|
|
1954
1769
|
formatter = this.modules.formatter;
|
|
1955
|
-
} else
|
|
1770
|
+
} else {
|
|
1956
1771
|
formatter = Formatter;
|
|
1957
1772
|
}
|
|
1958
1773
|
const lu = new LanguageUtil(this.options);
|
|
@@ -1963,7 +1778,6 @@ class I18n extends EventEmitter {
|
|
|
1963
1778
|
s.languageUtils = lu;
|
|
1964
1779
|
s.pluralResolver = new PluralResolver(lu, {
|
|
1965
1780
|
prepend: this.options.pluralSeparator,
|
|
1966
|
-
compatibilityJSON: this.options.compatibilityJSON,
|
|
1967
1781
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1968
1782
|
});
|
|
1969
1783
|
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
@@ -2034,10 +1848,10 @@ class I18n extends EventEmitter {
|
|
|
2034
1848
|
deferred.resolve(t);
|
|
2035
1849
|
callback(err, t);
|
|
2036
1850
|
};
|
|
2037
|
-
if (this.languages &&
|
|
1851
|
+
if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
|
|
2038
1852
|
this.changeLanguage(this.options.lng, finish);
|
|
2039
1853
|
};
|
|
2040
|
-
if (this.options.resources || !this.options.
|
|
1854
|
+
if (this.options.resources || !this.options.initAsync) {
|
|
2041
1855
|
load();
|
|
2042
1856
|
} else {
|
|
2043
1857
|
setTimeout(load, 0);
|
|
@@ -2050,7 +1864,7 @@ class I18n extends EventEmitter {
|
|
|
2050
1864
|
const usedLng = isString(language) ? language : this.language;
|
|
2051
1865
|
if (typeof language === 'function') usedCallback = language;
|
|
2052
1866
|
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
2053
|
-
if (usedLng
|
|
1867
|
+
if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
2054
1868
|
const toLoad = [];
|
|
2055
1869
|
const append = lng => {
|
|
2056
1870
|
if (!lng) return;
|
|
@@ -2067,9 +1881,7 @@ class I18n extends EventEmitter {
|
|
|
2067
1881
|
} else {
|
|
2068
1882
|
append(usedLng);
|
|
2069
1883
|
}
|
|
2070
|
-
|
|
2071
|
-
this.options.preload.forEach(l => append(l));
|
|
2072
|
-
}
|
|
1884
|
+
this.options.preload?.forEach?.(l => append(l));
|
|
2073
1885
|
this.services.backendConnector.load(toLoad, this.options.ns, e => {
|
|
2074
1886
|
if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
|
|
2075
1887
|
usedCallback(e);
|
|
@@ -2171,7 +1983,7 @@ class I18n extends EventEmitter {
|
|
|
2171
1983
|
setLngProps(l);
|
|
2172
1984
|
}
|
|
2173
1985
|
if (!this.translator.language) this.translator.changeLanguage(l);
|
|
2174
|
-
|
|
1986
|
+
this.services.languageDetector?.cacheUserLanguage?.(l);
|
|
2175
1987
|
}
|
|
2176
1988
|
this.loadResources(l, err => {
|
|
2177
1989
|
done(err, l);
|
|
@@ -2227,10 +2039,16 @@ class I18n extends EventEmitter {
|
|
|
2227
2039
|
return fixedT;
|
|
2228
2040
|
}
|
|
2229
2041
|
t() {
|
|
2230
|
-
|
|
2042
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
2043
|
+
args[_key4] = arguments[_key4];
|
|
2044
|
+
}
|
|
2045
|
+
return this.translator?.translate(...args);
|
|
2231
2046
|
}
|
|
2232
2047
|
exists() {
|
|
2233
|
-
|
|
2048
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
2049
|
+
args[_key5] = arguments[_key5];
|
|
2050
|
+
}
|
|
2051
|
+
return this.translator?.exists(...args);
|
|
2234
2052
|
}
|
|
2235
2053
|
setDefaultNamespace(ns) {
|
|
2236
2054
|
this.options.defaultNS = ns;
|
|
@@ -2295,10 +2113,10 @@ class I18n extends EventEmitter {
|
|
|
2295
2113
|
return deferred;
|
|
2296
2114
|
}
|
|
2297
2115
|
dir(lng) {
|
|
2298
|
-
if (!lng) lng = this.resolvedLanguage || (this.languages
|
|
2116
|
+
if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
|
|
2299
2117
|
if (!lng) return 'rtl';
|
|
2300
2118
|
const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
|
|
2301
|
-
const languageUtils = this.services
|
|
2119
|
+
const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
|
|
2302
2120
|
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2303
2121
|
}
|
|
2304
2122
|
static createInstance() {
|
|
@@ -2338,8 +2156,8 @@ class I18n extends EventEmitter {
|
|
|
2338
2156
|
}
|
|
2339
2157
|
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2340
2158
|
clone.translator.on('*', function (event) {
|
|
2341
|
-
for (var
|
|
2342
|
-
args[
|
|
2159
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
2160
|
+
args[_key6 - 1] = arguments[_key6];
|
|
2343
2161
|
}
|
|
2344
2162
|
clone.emit(event, ...args);
|
|
2345
2163
|
});
|
|
@@ -2384,6 +2202,7 @@ function i18n(getElement, resources) {
|
|
|
2384
2202
|
fallbackLng: DEFAULT_LANG,
|
|
2385
2203
|
resources,
|
|
2386
2204
|
defaultNS: element.tagName.toLowerCase(),
|
|
2205
|
+
interpolation: { escapeValue: false },
|
|
2387
2206
|
});
|
|
2388
2207
|
let detectedLanguage = false;
|
|
2389
2208
|
return (key, variables) => {
|
|
@@ -2398,4 +2217,4 @@ function i18n(getElement, resources) {
|
|
|
2398
2217
|
|
|
2399
2218
|
exports.i18n = i18n;
|
|
2400
2219
|
|
|
2401
|
-
//# sourceMappingURL=i18n-
|
|
2220
|
+
//# sourceMappingURL=i18n-0da568ee.js.map
|