@dso-toolkit/core 67.2.0 → 67.3.1
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
package/dist/components/i18n.js
CHANGED
|
@@ -58,7 +58,7 @@ const setPath = (object, path, newValue) => {
|
|
|
58
58
|
e = `${p[p.length - 1]}.${e}`;
|
|
59
59
|
p = p.slice(0, p.length - 1);
|
|
60
60
|
last = getLastOfPath(object, p, Object);
|
|
61
|
-
if (last
|
|
61
|
+
if (last?.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {
|
|
62
62
|
last.obj = undefined;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -185,7 +185,7 @@ const deepFind = function (obj, path) {
|
|
|
185
185
|
}
|
|
186
186
|
return current;
|
|
187
187
|
};
|
|
188
|
-
const getCleanedCode = code => code
|
|
188
|
+
const getCleanedCode = code => code?.replace('_', '-');
|
|
189
189
|
|
|
190
190
|
const consoleLogger = {
|
|
191
191
|
type: 'logger',
|
|
@@ -199,7 +199,7 @@ const consoleLogger = {
|
|
|
199
199
|
this.output('error', args);
|
|
200
200
|
},
|
|
201
201
|
output(type, args) {
|
|
202
|
-
|
|
202
|
+
console?.[type]?.apply?.(console, args);
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
205
|
class Logger {
|
|
@@ -357,7 +357,7 @@ class ResourceStore extends EventEmitter {
|
|
|
357
357
|
key = path.slice(2).join('.');
|
|
358
358
|
}
|
|
359
359
|
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
360
|
-
return deepFind(this.data
|
|
360
|
+
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
361
361
|
}
|
|
362
362
|
addResource(lng, ns, key, value) {
|
|
363
363
|
let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
@@ -424,10 +424,6 @@ class ResourceStore extends EventEmitter {
|
|
|
424
424
|
}
|
|
425
425
|
getResourceBundle(lng, ns) {
|
|
426
426
|
if (!ns) ns = this.options.defaultNS;
|
|
427
|
-
if (this.options.compatibilityAPI === 'v1') return {
|
|
428
|
-
...{},
|
|
429
|
-
...this.getResource(lng, ns)
|
|
430
|
-
};
|
|
431
427
|
return this.getResource(lng, ns);
|
|
432
428
|
}
|
|
433
429
|
getDataByLanguage(lng) {
|
|
@@ -450,7 +446,7 @@ var postProcessor = {
|
|
|
450
446
|
},
|
|
451
447
|
handle(processors, value, key, options, translator) {
|
|
452
448
|
processors.forEach(processor => {
|
|
453
|
-
|
|
449
|
+
value = this.processors[processor]?.process(value, key, options, translator) ?? value;
|
|
454
450
|
});
|
|
455
451
|
return value;
|
|
456
452
|
}
|
|
@@ -479,7 +475,7 @@ class Translator extends EventEmitter {
|
|
|
479
475
|
return false;
|
|
480
476
|
}
|
|
481
477
|
const resolved = this.resolve(key, options);
|
|
482
|
-
return resolved
|
|
478
|
+
return resolved?.res !== undefined;
|
|
483
479
|
}
|
|
484
480
|
extractFromKey(key, options) {
|
|
485
481
|
let nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
|
|
@@ -524,7 +520,7 @@ class Translator extends EventEmitter {
|
|
|
524
520
|
const namespace = namespaces[namespaces.length - 1];
|
|
525
521
|
const lng = options.lng || this.language;
|
|
526
522
|
const appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
527
|
-
if (lng
|
|
523
|
+
if (lng?.toLowerCase() === 'cimode') {
|
|
528
524
|
if (appendNamespaceToCIMode) {
|
|
529
525
|
const nsSeparator = options.nsSeparator || this.options.nsSeparator;
|
|
530
526
|
if (returnDetails) {
|
|
@@ -552,9 +548,9 @@ class Translator extends EventEmitter {
|
|
|
552
548
|
return key;
|
|
553
549
|
}
|
|
554
550
|
const resolved = this.resolve(keys, options);
|
|
555
|
-
let res = resolved
|
|
556
|
-
const resUsedKey = resolved
|
|
557
|
-
const resExactUsedKey = resolved
|
|
551
|
+
let res = resolved?.res;
|
|
552
|
+
const resUsedKey = resolved?.usedKey || key;
|
|
553
|
+
const resExactUsedKey = resolved?.exactUsedKey || key;
|
|
558
554
|
const resType = Object.prototype.toString.apply(res);
|
|
559
555
|
const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
|
|
560
556
|
const joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
|
|
@@ -607,7 +603,7 @@ class Translator extends EventEmitter {
|
|
|
607
603
|
const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
|
|
608
604
|
ordinal: false
|
|
609
605
|
}) : '';
|
|
610
|
-
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0
|
|
606
|
+
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
|
|
611
607
|
const defaultValue = needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] || options[`defaultValue${defaultValueSuffix}`] || options[`defaultValue${defaultValueSuffixOrdinalFallback}`] || options.defaultValue;
|
|
612
608
|
if (!this.isValidLookup(res) && hasDefaultValue) {
|
|
613
609
|
usedDefault = true;
|
|
@@ -644,7 +640,7 @@ class Translator extends EventEmitter {
|
|
|
644
640
|
const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
|
645
641
|
if (this.options.missingKeyHandler) {
|
|
646
642
|
this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
647
|
-
} else if (this.backendConnector
|
|
643
|
+
} else if (this.backendConnector?.saveMissing) {
|
|
648
644
|
this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
|
|
649
645
|
}
|
|
650
646
|
this.emit('missingKey', l, namespace, k, res);
|
|
@@ -668,11 +664,7 @@ class Translator extends EventEmitter {
|
|
|
668
664
|
res = this.extendTranslation(res, keys, options, resolved, lastKey);
|
|
669
665
|
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;
|
|
670
666
|
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
671
|
-
|
|
672
|
-
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);
|
|
673
|
-
} else {
|
|
674
|
-
res = this.options.parseMissingKeyHandler(res);
|
|
675
|
-
}
|
|
667
|
+
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);
|
|
676
668
|
}
|
|
677
669
|
}
|
|
678
670
|
if (returnDetails) {
|
|
@@ -684,7 +676,7 @@ class Translator extends EventEmitter {
|
|
|
684
676
|
}
|
|
685
677
|
extendTranslation(res, key, options, resolved, lastKey) {
|
|
686
678
|
var _this = this;
|
|
687
|
-
if (this.i18nFormat
|
|
679
|
+
if (this.i18nFormat?.parse) {
|
|
688
680
|
res = this.i18nFormat.parse(res, {
|
|
689
681
|
...this.options.interpolation.defaultVariables,
|
|
690
682
|
...options
|
|
@@ -701,7 +693,7 @@ class Translator extends EventEmitter {
|
|
|
701
693
|
}
|
|
702
694
|
}
|
|
703
695
|
});
|
|
704
|
-
const skipOnVariables = isString(res) && (options
|
|
696
|
+
const skipOnVariables = isString(res) && (options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
705
697
|
let nestBef;
|
|
706
698
|
if (skipOnVariables) {
|
|
707
699
|
const nb = res.match(this.interpolator.nestingRegexp);
|
|
@@ -718,12 +710,12 @@ class Translator extends EventEmitter {
|
|
|
718
710
|
const nestAft = na && na.length;
|
|
719
711
|
if (nestBef < nestAft) options.nest = false;
|
|
720
712
|
}
|
|
721
|
-
if (!options.lng &&
|
|
713
|
+
if (!options.lng && resolved && resolved.res) options.lng = this.language || resolved.usedLng;
|
|
722
714
|
if (options.nest !== false) res = this.interpolator.nest(res, function () {
|
|
723
715
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
724
716
|
args[_key] = arguments[_key];
|
|
725
717
|
}
|
|
726
|
-
if (lastKey
|
|
718
|
+
if (lastKey?.[0] === args[0] && !options.context) {
|
|
727
719
|
_this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
|
|
728
720
|
return null;
|
|
729
721
|
}
|
|
@@ -733,7 +725,7 @@ class Translator extends EventEmitter {
|
|
|
733
725
|
}
|
|
734
726
|
const postProcess = options.postProcess || this.options.postProcess;
|
|
735
727
|
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
736
|
-
if (res !== undefined && res !== null && postProcessorNames
|
|
728
|
+
if (res !== undefined && res !== null && postProcessorNames?.length && options.applyPostProcessor !== false) {
|
|
737
729
|
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
738
730
|
i18nResolved: {
|
|
739
731
|
...resolved,
|
|
@@ -760,13 +752,13 @@ class Translator extends EventEmitter {
|
|
|
760
752
|
let namespaces = extracted.namespaces;
|
|
761
753
|
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
762
754
|
const needsPluralHandling = options.count !== undefined && !isString(options.count);
|
|
763
|
-
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0
|
|
755
|
+
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
|
|
764
756
|
const needsContextHandling = options.context !== undefined && (isString(options.context) || typeof options.context === 'number') && options.context !== '';
|
|
765
757
|
const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
|
|
766
758
|
namespaces.forEach(ns => {
|
|
767
759
|
if (this.isValidLookup(found)) return;
|
|
768
760
|
usedNS = ns;
|
|
769
|
-
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils
|
|
761
|
+
if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(usedNS)) {
|
|
770
762
|
checkedLoadedFor[`${codes[0]}-${ns}`] = true;
|
|
771
763
|
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!!!');
|
|
772
764
|
}
|
|
@@ -774,7 +766,7 @@ class Translator extends EventEmitter {
|
|
|
774
766
|
if (this.isValidLookup(found)) return;
|
|
775
767
|
usedLng = code;
|
|
776
768
|
const finalKeys = [key];
|
|
777
|
-
if (this.i18nFormat
|
|
769
|
+
if (this.i18nFormat?.addLookupKeys) {
|
|
778
770
|
this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
|
|
779
771
|
} else {
|
|
780
772
|
let pluralSuffix;
|
|
@@ -827,7 +819,7 @@ class Translator extends EventEmitter {
|
|
|
827
819
|
}
|
|
828
820
|
getResource(code, ns, key) {
|
|
829
821
|
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
830
|
-
if (this.i18nFormat
|
|
822
|
+
if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
|
831
823
|
return this.resourceStore.getResource(code, ns, key, options);
|
|
832
824
|
}
|
|
833
825
|
getUsedParamsDetails() {
|
|
@@ -865,7 +857,6 @@ class Translator extends EventEmitter {
|
|
|
865
857
|
}
|
|
866
858
|
}
|
|
867
859
|
|
|
868
|
-
const capitalize = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
869
860
|
class LanguageUtil {
|
|
870
861
|
constructor(options) {
|
|
871
862
|
this.options = options;
|
|
@@ -889,31 +880,18 @@ class LanguageUtil {
|
|
|
889
880
|
}
|
|
890
881
|
formatLanguageCode(code) {
|
|
891
882
|
if (isString(code) && code.indexOf('-') > -1) {
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
if (formattedCode) return formattedCode;
|
|
899
|
-
} catch (e) {}
|
|
883
|
+
let formattedCode;
|
|
884
|
+
try {
|
|
885
|
+
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
886
|
+
} catch (e) {}
|
|
887
|
+
if (formattedCode && this.options.lowerCaseLng) {
|
|
888
|
+
formattedCode = formattedCode.toLowerCase();
|
|
900
889
|
}
|
|
901
|
-
|
|
902
|
-
let p = code.split('-');
|
|
890
|
+
if (formattedCode) return formattedCode;
|
|
903
891
|
if (this.options.lowerCaseLng) {
|
|
904
|
-
|
|
905
|
-
} else if (p.length === 2) {
|
|
906
|
-
p[0] = p[0].toLowerCase();
|
|
907
|
-
p[1] = p[1].toUpperCase();
|
|
908
|
-
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
909
|
-
} else if (p.length === 3) {
|
|
910
|
-
p[0] = p[0].toLowerCase();
|
|
911
|
-
if (p[1].length === 2) p[1] = p[1].toUpperCase();
|
|
912
|
-
if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();
|
|
913
|
-
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
914
|
-
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
|
|
892
|
+
return code.toLowerCase();
|
|
915
893
|
}
|
|
916
|
-
return
|
|
894
|
+
return code;
|
|
917
895
|
}
|
|
918
896
|
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
|
919
897
|
}
|
|
@@ -985,125 +963,6 @@ class LanguageUtil {
|
|
|
985
963
|
}
|
|
986
964
|
}
|
|
987
965
|
|
|
988
|
-
let sets = [{
|
|
989
|
-
lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],
|
|
990
|
-
nr: [1, 2],
|
|
991
|
-
fc: 1
|
|
992
|
-
}, {
|
|
993
|
-
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'],
|
|
994
|
-
nr: [1, 2],
|
|
995
|
-
fc: 2
|
|
996
|
-
}, {
|
|
997
|
-
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
|
|
998
|
-
nr: [1],
|
|
999
|
-
fc: 3
|
|
1000
|
-
}, {
|
|
1001
|
-
lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],
|
|
1002
|
-
nr: [1, 2, 5],
|
|
1003
|
-
fc: 4
|
|
1004
|
-
}, {
|
|
1005
|
-
lngs: ['ar'],
|
|
1006
|
-
nr: [0, 1, 2, 3, 11, 100],
|
|
1007
|
-
fc: 5
|
|
1008
|
-
}, {
|
|
1009
|
-
lngs: ['cs', 'sk'],
|
|
1010
|
-
nr: [1, 2, 5],
|
|
1011
|
-
fc: 6
|
|
1012
|
-
}, {
|
|
1013
|
-
lngs: ['csb', 'pl'],
|
|
1014
|
-
nr: [1, 2, 5],
|
|
1015
|
-
fc: 7
|
|
1016
|
-
}, {
|
|
1017
|
-
lngs: ['cy'],
|
|
1018
|
-
nr: [1, 2, 3, 8],
|
|
1019
|
-
fc: 8
|
|
1020
|
-
}, {
|
|
1021
|
-
lngs: ['fr'],
|
|
1022
|
-
nr: [1, 2],
|
|
1023
|
-
fc: 9
|
|
1024
|
-
}, {
|
|
1025
|
-
lngs: ['ga'],
|
|
1026
|
-
nr: [1, 2, 3, 7, 11],
|
|
1027
|
-
fc: 10
|
|
1028
|
-
}, {
|
|
1029
|
-
lngs: ['gd'],
|
|
1030
|
-
nr: [1, 2, 3, 20],
|
|
1031
|
-
fc: 11
|
|
1032
|
-
}, {
|
|
1033
|
-
lngs: ['is'],
|
|
1034
|
-
nr: [1, 2],
|
|
1035
|
-
fc: 12
|
|
1036
|
-
}, {
|
|
1037
|
-
lngs: ['jv'],
|
|
1038
|
-
nr: [0, 1],
|
|
1039
|
-
fc: 13
|
|
1040
|
-
}, {
|
|
1041
|
-
lngs: ['kw'],
|
|
1042
|
-
nr: [1, 2, 3, 4],
|
|
1043
|
-
fc: 14
|
|
1044
|
-
}, {
|
|
1045
|
-
lngs: ['lt'],
|
|
1046
|
-
nr: [1, 2, 10],
|
|
1047
|
-
fc: 15
|
|
1048
|
-
}, {
|
|
1049
|
-
lngs: ['lv'],
|
|
1050
|
-
nr: [1, 2, 0],
|
|
1051
|
-
fc: 16
|
|
1052
|
-
}, {
|
|
1053
|
-
lngs: ['mk'],
|
|
1054
|
-
nr: [1, 2],
|
|
1055
|
-
fc: 17
|
|
1056
|
-
}, {
|
|
1057
|
-
lngs: ['mnk'],
|
|
1058
|
-
nr: [0, 1, 2],
|
|
1059
|
-
fc: 18
|
|
1060
|
-
}, {
|
|
1061
|
-
lngs: ['mt'],
|
|
1062
|
-
nr: [1, 2, 11, 20],
|
|
1063
|
-
fc: 19
|
|
1064
|
-
}, {
|
|
1065
|
-
lngs: ['or'],
|
|
1066
|
-
nr: [2, 1],
|
|
1067
|
-
fc: 2
|
|
1068
|
-
}, {
|
|
1069
|
-
lngs: ['ro'],
|
|
1070
|
-
nr: [1, 2, 20],
|
|
1071
|
-
fc: 20
|
|
1072
|
-
}, {
|
|
1073
|
-
lngs: ['sl'],
|
|
1074
|
-
nr: [5, 1, 2, 3],
|
|
1075
|
-
fc: 21
|
|
1076
|
-
}, {
|
|
1077
|
-
lngs: ['he', 'iw'],
|
|
1078
|
-
nr: [1, 2, 20, 21],
|
|
1079
|
-
fc: 22
|
|
1080
|
-
}];
|
|
1081
|
-
let _rulesPluralsTypes = {
|
|
1082
|
-
1: n => Number(n > 1),
|
|
1083
|
-
2: n => Number(n != 1),
|
|
1084
|
-
3: n => 0,
|
|
1085
|
-
4: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1086
|
-
5: n => Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5),
|
|
1087
|
-
6: n => Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2),
|
|
1088
|
-
7: n => Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1089
|
-
8: n => Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3),
|
|
1090
|
-
9: n => Number(n >= 2),
|
|
1091
|
-
10: n => Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4),
|
|
1092
|
-
11: n => Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3),
|
|
1093
|
-
12: n => Number(n % 10 != 1 || n % 100 == 11),
|
|
1094
|
-
13: n => Number(n !== 0),
|
|
1095
|
-
14: n => Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3),
|
|
1096
|
-
15: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),
|
|
1097
|
-
16: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2),
|
|
1098
|
-
17: n => Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1),
|
|
1099
|
-
18: n => Number(n == 0 ? 0 : n == 1 ? 1 : 2),
|
|
1100
|
-
19: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3),
|
|
1101
|
-
20: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2),
|
|
1102
|
-
21: n => Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0),
|
|
1103
|
-
22: n => Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3)
|
|
1104
|
-
};
|
|
1105
|
-
const nonIntlVersions = ['v1', 'v2', 'v3'];
|
|
1106
|
-
const intlVersions = ['v4'];
|
|
1107
966
|
const suffixesOrder = {
|
|
1108
967
|
zero: 0,
|
|
1109
968
|
one: 1,
|
|
@@ -1112,17 +971,11 @@ const suffixesOrder = {
|
|
|
1112
971
|
many: 4,
|
|
1113
972
|
other: 5
|
|
1114
973
|
};
|
|
1115
|
-
const
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
numbers: set.nr,
|
|
1121
|
-
plurals: _rulesPluralsTypes[set.fc]
|
|
1122
|
-
};
|
|
1123
|
-
});
|
|
1124
|
-
});
|
|
1125
|
-
return rules;
|
|
974
|
+
const dummyRule = {
|
|
975
|
+
select: count => count === 1 ? 'one' : 'other',
|
|
976
|
+
resolvedOptions: () => ({
|
|
977
|
+
pluralCategories: ['one', 'other']
|
|
978
|
+
})
|
|
1126
979
|
};
|
|
1127
980
|
class PluralResolver {
|
|
1128
981
|
constructor(languageUtils) {
|
|
@@ -1130,11 +983,6 @@ class PluralResolver {
|
|
|
1130
983
|
this.languageUtils = languageUtils;
|
|
1131
984
|
this.options = options;
|
|
1132
985
|
this.logger = baseLogger.create('pluralResolver');
|
|
1133
|
-
if ((!this.options.compatibilityJSON || intlVersions.includes(this.options.compatibilityJSON)) && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
|
|
1134
|
-
this.options.compatibilityJSON = 'v3';
|
|
1135
|
-
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.');
|
|
1136
|
-
}
|
|
1137
|
-
this.rules = createRules();
|
|
1138
986
|
this.pluralRulesCache = {};
|
|
1139
987
|
}
|
|
1140
988
|
addRule(lng, obj) {
|
|
@@ -1145,35 +993,37 @@ class PluralResolver {
|
|
|
1145
993
|
}
|
|
1146
994
|
getRule(code) {
|
|
1147
995
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
return;
|
|
996
|
+
const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
|
|
997
|
+
const type = options.ordinal ? 'ordinal' : 'cardinal';
|
|
998
|
+
const cacheKey = JSON.stringify({
|
|
999
|
+
cleanedCode,
|
|
1000
|
+
type
|
|
1001
|
+
});
|
|
1002
|
+
if (cacheKey in this.pluralRulesCache) {
|
|
1003
|
+
return this.pluralRulesCache[cacheKey];
|
|
1004
|
+
}
|
|
1005
|
+
let rule;
|
|
1006
|
+
try {
|
|
1007
|
+
rule = new Intl.PluralRules(cleanedCode, {
|
|
1008
|
+
type
|
|
1009
|
+
});
|
|
1010
|
+
} catch (err) {
|
|
1011
|
+
if (!Intl) {
|
|
1012
|
+
this.logger.error('No Intl support, please use an Intl polyfill!');
|
|
1013
|
+
return dummyRule;
|
|
1166
1014
|
}
|
|
1015
|
+
if (!code.match(/-|_/)) return dummyRule;
|
|
1016
|
+
const lngPart = this.languageUtils.getLanguagePartFromCode(code);
|
|
1017
|
+
rule = this.getRule(lngPart, options);
|
|
1167
1018
|
}
|
|
1168
|
-
|
|
1019
|
+
this.pluralRulesCache[cacheKey] = rule;
|
|
1020
|
+
return rule;
|
|
1169
1021
|
}
|
|
1170
1022
|
needsPlural(code) {
|
|
1171
1023
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1172
|
-
|
|
1173
|
-
if (this.
|
|
1174
|
-
|
|
1175
|
-
}
|
|
1176
|
-
return rule && rule.numbers.length > 1;
|
|
1024
|
+
let rule = this.getRule(code, options);
|
|
1025
|
+
if (!rule) rule = this.getRule('dev', options);
|
|
1026
|
+
return rule?.resolvedOptions().pluralCategories.length > 1;
|
|
1177
1027
|
}
|
|
1178
1028
|
getPluralFormsOfKey(code, key) {
|
|
1179
1029
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -1181,51 +1031,19 @@ class PluralResolver {
|
|
|
1181
1031
|
}
|
|
1182
1032
|
getSuffixes(code) {
|
|
1183
1033
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1184
|
-
|
|
1185
|
-
if (!rule)
|
|
1186
|
-
|
|
1187
|
-
}
|
|
1188
|
-
if (this.shouldUseIntlApi()) {
|
|
1189
|
-
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1190
|
-
}
|
|
1191
|
-
return rule.numbers.map(number => this.getSuffix(code, number, options));
|
|
1034
|
+
let rule = this.getRule(code, options);
|
|
1035
|
+
if (!rule) rule = this.getRule('dev', options);
|
|
1036
|
+
if (!rule) return [];
|
|
1037
|
+
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1192
1038
|
}
|
|
1193
1039
|
getSuffix(code, count) {
|
|
1194
1040
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1195
1041
|
const rule = this.getRule(code, options);
|
|
1196
1042
|
if (rule) {
|
|
1197
|
-
|
|
1198
|
-
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1199
|
-
}
|
|
1200
|
-
return this.getSuffixRetroCompatible(rule, count);
|
|
1043
|
+
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
1201
1044
|
}
|
|
1202
1045
|
this.logger.warn(`no plural rule found for: ${code}`);
|
|
1203
|
-
return '';
|
|
1204
|
-
}
|
|
1205
|
-
getSuffixRetroCompatible(rule, count) {
|
|
1206
|
-
const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
|
|
1207
|
-
let suffix = rule.numbers[idx];
|
|
1208
|
-
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1209
|
-
if (suffix === 2) {
|
|
1210
|
-
suffix = 'plural';
|
|
1211
|
-
} else if (suffix === 1) {
|
|
1212
|
-
suffix = '';
|
|
1213
|
-
}
|
|
1214
|
-
}
|
|
1215
|
-
const returnSuffix = () => this.options.prepend && suffix.toString() ? this.options.prepend + suffix.toString() : suffix.toString();
|
|
1216
|
-
if (this.options.compatibilityJSON === 'v1') {
|
|
1217
|
-
if (suffix === 1) return '';
|
|
1218
|
-
if (typeof suffix === 'number') return `_plural_${suffix.toString()}`;
|
|
1219
|
-
return returnSuffix();
|
|
1220
|
-
} else if (this.options.compatibilityJSON === 'v2') {
|
|
1221
|
-
return returnSuffix();
|
|
1222
|
-
} else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
|
1223
|
-
return returnSuffix();
|
|
1224
|
-
}
|
|
1225
|
-
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
|
|
1226
|
-
}
|
|
1227
|
-
shouldUseIntlApi() {
|
|
1228
|
-
return !nonIntlVersions.includes(this.options.compatibilityJSON);
|
|
1046
|
+
return this.getSuffix('dev', count, options);
|
|
1229
1047
|
}
|
|
1230
1048
|
}
|
|
1231
1049
|
|
|
@@ -1245,7 +1063,7 @@ class Interpolator {
|
|
|
1245
1063
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1246
1064
|
this.logger = baseLogger.create('interpolator');
|
|
1247
1065
|
this.options = options;
|
|
1248
|
-
this.format = options
|
|
1066
|
+
this.format = options?.interpolation?.format || (value => value);
|
|
1249
1067
|
this.init(options);
|
|
1250
1068
|
}
|
|
1251
1069
|
init() {
|
|
@@ -1292,7 +1110,7 @@ class Interpolator {
|
|
|
1292
1110
|
}
|
|
1293
1111
|
resetRegExp() {
|
|
1294
1112
|
const getOrResetRegExp = (existingRegExp, pattern) => {
|
|
1295
|
-
if (existingRegExp
|
|
1113
|
+
if (existingRegExp?.source === pattern) {
|
|
1296
1114
|
existingRegExp.lastIndex = 0;
|
|
1297
1115
|
return existingRegExp;
|
|
1298
1116
|
}
|
|
@@ -1326,8 +1144,8 @@ class Interpolator {
|
|
|
1326
1144
|
});
|
|
1327
1145
|
};
|
|
1328
1146
|
this.resetRegExp();
|
|
1329
|
-
const missingInterpolationHandler = options
|
|
1330
|
-
const skipOnVariables = options
|
|
1147
|
+
const missingInterpolationHandler = options?.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
|
1148
|
+
const skipOnVariables = options?.interpolation?.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
|
1331
1149
|
const todos = [{
|
|
1332
1150
|
regex: this.regexpUnescape,
|
|
1333
1151
|
safeValue: val => regexSafe(val)
|
|
@@ -1386,7 +1204,7 @@ class Interpolator {
|
|
|
1386
1204
|
optionsString = this.interpolate(optionsString, clonedOptions);
|
|
1387
1205
|
const matchedSingleQuotes = optionsString.match(/'/g);
|
|
1388
1206
|
const matchedDoubleQuotes = optionsString.match(/"/g);
|
|
1389
|
-
if (matchedSingleQuotes
|
|
1207
|
+
if ((matchedSingleQuotes?.length ?? 0) % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {
|
|
1390
1208
|
optionsString = optionsString.replace(/'/g, '"');
|
|
1391
1209
|
}
|
|
1392
1210
|
try {
|
|
@@ -1554,7 +1372,7 @@ class Formatter {
|
|
|
1554
1372
|
if (this.formats[formatName]) {
|
|
1555
1373
|
let formatted = mem;
|
|
1556
1374
|
try {
|
|
1557
|
-
const valOptions = options
|
|
1375
|
+
const valOptions = options?.formatParams?.[options.interpolationkey] || {};
|
|
1558
1376
|
const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
|
1559
1377
|
formatted = this.formats[formatName](mem, l, {
|
|
1560
1378
|
...formatOptions,
|
|
@@ -1597,9 +1415,7 @@ class Connector extends EventEmitter {
|
|
|
1597
1415
|
this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;
|
|
1598
1416
|
this.state = {};
|
|
1599
1417
|
this.queue = [];
|
|
1600
|
-
|
|
1601
|
-
this.backend.init(services, options.backend, options);
|
|
1602
|
-
}
|
|
1418
|
+
this.backend?.init?.(services, options.backend, options);
|
|
1603
1419
|
}
|
|
1604
1420
|
queueLoad(languages, namespaces, options, callback) {
|
|
1605
1421
|
const toLoad = {};
|
|
@@ -1765,12 +1581,12 @@ class Connector extends EventEmitter {
|
|
|
1765
1581
|
saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
|
1766
1582
|
let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
1767
1583
|
let clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => {};
|
|
1768
|
-
if (this.services
|
|
1584
|
+
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
|
|
1769
1585
|
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!!!');
|
|
1770
1586
|
return;
|
|
1771
1587
|
}
|
|
1772
1588
|
if (key === undefined || key === null || key === '') return;
|
|
1773
|
-
if (this.backend
|
|
1589
|
+
if (this.backend?.create) {
|
|
1774
1590
|
const opts = {
|
|
1775
1591
|
...options,
|
|
1776
1592
|
isUpdate
|
|
@@ -1803,7 +1619,7 @@ class Connector extends EventEmitter {
|
|
|
1803
1619
|
|
|
1804
1620
|
const get = () => ({
|
|
1805
1621
|
debug: false,
|
|
1806
|
-
|
|
1622
|
+
initAsync: true,
|
|
1807
1623
|
ns: ['translation'],
|
|
1808
1624
|
defaultNS: ['translation'],
|
|
1809
1625
|
fallbackLng: ['dev'],
|
|
@@ -1865,9 +1681,10 @@ const transformOptions = options => {
|
|
|
1865
1681
|
if (isString(options.ns)) options.ns = [options.ns];
|
|
1866
1682
|
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
1867
1683
|
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
1868
|
-
if (options.supportedLngs
|
|
1684
|
+
if (options.supportedLngs?.indexOf?.('cimode') < 0) {
|
|
1869
1685
|
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
|
1870
1686
|
}
|
|
1687
|
+
if (typeof options.initImmediate === 'boolean') options.initAsync = options.initImmediate;
|
|
1871
1688
|
return options;
|
|
1872
1689
|
};
|
|
1873
1690
|
|
|
@@ -1893,7 +1710,7 @@ class I18n extends EventEmitter {
|
|
|
1893
1710
|
};
|
|
1894
1711
|
bindMemberFunctions(this);
|
|
1895
1712
|
if (callback && !this.isInitialized && !options.isClone) {
|
|
1896
|
-
if (!this.options.
|
|
1713
|
+
if (!this.options.initAsync) {
|
|
1897
1714
|
this.init(options, callback);
|
|
1898
1715
|
return this;
|
|
1899
1716
|
}
|
|
@@ -1924,12 +1741,10 @@ class I18n extends EventEmitter {
|
|
|
1924
1741
|
...this.options,
|
|
1925
1742
|
...transformOptions(options)
|
|
1926
1743
|
};
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
};
|
|
1932
|
-
}
|
|
1744
|
+
this.options.interpolation = {
|
|
1745
|
+
...defOpts.interpolation,
|
|
1746
|
+
...this.options.interpolation
|
|
1747
|
+
};
|
|
1933
1748
|
if (options.keySeparator !== undefined) {
|
|
1934
1749
|
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
1935
1750
|
}
|
|
@@ -1950,7 +1765,7 @@ class I18n extends EventEmitter {
|
|
|
1950
1765
|
let formatter;
|
|
1951
1766
|
if (this.modules.formatter) {
|
|
1952
1767
|
formatter = this.modules.formatter;
|
|
1953
|
-
} else
|
|
1768
|
+
} else {
|
|
1954
1769
|
formatter = Formatter;
|
|
1955
1770
|
}
|
|
1956
1771
|
const lu = new LanguageUtil(this.options);
|
|
@@ -1961,7 +1776,6 @@ class I18n extends EventEmitter {
|
|
|
1961
1776
|
s.languageUtils = lu;
|
|
1962
1777
|
s.pluralResolver = new PluralResolver(lu, {
|
|
1963
1778
|
prepend: this.options.pluralSeparator,
|
|
1964
|
-
compatibilityJSON: this.options.compatibilityJSON,
|
|
1965
1779
|
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
|
1966
1780
|
});
|
|
1967
1781
|
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
|
@@ -2032,10 +1846,10 @@ class I18n extends EventEmitter {
|
|
|
2032
1846
|
deferred.resolve(t);
|
|
2033
1847
|
callback(err, t);
|
|
2034
1848
|
};
|
|
2035
|
-
if (this.languages &&
|
|
1849
|
+
if (this.languages && !this.isInitialized) return finish(null, this.t.bind(this));
|
|
2036
1850
|
this.changeLanguage(this.options.lng, finish);
|
|
2037
1851
|
};
|
|
2038
|
-
if (this.options.resources || !this.options.
|
|
1852
|
+
if (this.options.resources || !this.options.initAsync) {
|
|
2039
1853
|
load();
|
|
2040
1854
|
} else {
|
|
2041
1855
|
setTimeout(load, 0);
|
|
@@ -2048,7 +1862,7 @@ class I18n extends EventEmitter {
|
|
|
2048
1862
|
const usedLng = isString(language) ? language : this.language;
|
|
2049
1863
|
if (typeof language === 'function') usedCallback = language;
|
|
2050
1864
|
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
2051
|
-
if (usedLng
|
|
1865
|
+
if (usedLng?.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
2052
1866
|
const toLoad = [];
|
|
2053
1867
|
const append = lng => {
|
|
2054
1868
|
if (!lng) return;
|
|
@@ -2065,9 +1879,7 @@ class I18n extends EventEmitter {
|
|
|
2065
1879
|
} else {
|
|
2066
1880
|
append(usedLng);
|
|
2067
1881
|
}
|
|
2068
|
-
|
|
2069
|
-
this.options.preload.forEach(l => append(l));
|
|
2070
|
-
}
|
|
1882
|
+
this.options.preload?.forEach?.(l => append(l));
|
|
2071
1883
|
this.services.backendConnector.load(toLoad, this.options.ns, e => {
|
|
2072
1884
|
if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);
|
|
2073
1885
|
usedCallback(e);
|
|
@@ -2169,7 +1981,7 @@ class I18n extends EventEmitter {
|
|
|
2169
1981
|
setLngProps(l);
|
|
2170
1982
|
}
|
|
2171
1983
|
if (!this.translator.language) this.translator.changeLanguage(l);
|
|
2172
|
-
|
|
1984
|
+
this.services.languageDetector?.cacheUserLanguage?.(l);
|
|
2173
1985
|
}
|
|
2174
1986
|
this.loadResources(l, err => {
|
|
2175
1987
|
done(err, l);
|
|
@@ -2225,10 +2037,16 @@ class I18n extends EventEmitter {
|
|
|
2225
2037
|
return fixedT;
|
|
2226
2038
|
}
|
|
2227
2039
|
t() {
|
|
2228
|
-
|
|
2040
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
2041
|
+
args[_key4] = arguments[_key4];
|
|
2042
|
+
}
|
|
2043
|
+
return this.translator?.translate(...args);
|
|
2229
2044
|
}
|
|
2230
2045
|
exists() {
|
|
2231
|
-
|
|
2046
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
2047
|
+
args[_key5] = arguments[_key5];
|
|
2048
|
+
}
|
|
2049
|
+
return this.translator?.exists(...args);
|
|
2232
2050
|
}
|
|
2233
2051
|
setDefaultNamespace(ns) {
|
|
2234
2052
|
this.options.defaultNS = ns;
|
|
@@ -2293,10 +2111,10 @@ class I18n extends EventEmitter {
|
|
|
2293
2111
|
return deferred;
|
|
2294
2112
|
}
|
|
2295
2113
|
dir(lng) {
|
|
2296
|
-
if (!lng) lng = this.resolvedLanguage || (this.languages
|
|
2114
|
+
if (!lng) lng = this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language);
|
|
2297
2115
|
if (!lng) return 'rtl';
|
|
2298
2116
|
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'];
|
|
2299
|
-
const languageUtils = this.services
|
|
2117
|
+
const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
|
|
2300
2118
|
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2301
2119
|
}
|
|
2302
2120
|
static createInstance() {
|
|
@@ -2336,8 +2154,8 @@ class I18n extends EventEmitter {
|
|
|
2336
2154
|
}
|
|
2337
2155
|
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2338
2156
|
clone.translator.on('*', function (event) {
|
|
2339
|
-
for (var
|
|
2340
|
-
args[
|
|
2157
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
2158
|
+
args[_key6 - 1] = arguments[_key6];
|
|
2341
2159
|
}
|
|
2342
2160
|
clone.emit(event, ...args);
|
|
2343
2161
|
});
|
|
@@ -2382,6 +2200,7 @@ function i18n(getElement, resources) {
|
|
|
2382
2200
|
fallbackLng: DEFAULT_LANG,
|
|
2383
2201
|
resources,
|
|
2384
2202
|
defaultNS: element.tagName.toLowerCase(),
|
|
2203
|
+
interpolation: { escapeValue: false },
|
|
2385
2204
|
});
|
|
2386
2205
|
let detectedLanguage = false;
|
|
2387
2206
|
return (key, variables) => {
|