@dso-toolkit/core 73.0.1 → 73.1.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-BBlFDtNQ.js → annotation-body-DiF6OSBJ.js} +3 -3
- package/dist/cjs/{annotation-body-BBlFDtNQ.js.map → annotation-body-DiF6OSBJ.js.map} +1 -1
- package/dist/cjs/{annotation-list-renvooi-values-BRsXjGPr.js → annotation-list-renvooi-values-BsuXHY9R.js} +3 -3
- package/dist/cjs/{annotation-list-renvooi-values-BRsXjGPr.js.map → annotation-list-renvooi-values-BsuXHY9R.js.map} +1 -1
- package/dist/cjs/{annotation-symbol-slot-Ko-yyBqQ.js → annotation-symbol-slot-CwCc6l70.js} +3 -3
- package/dist/cjs/{annotation-symbol-slot-Ko-yyBqQ.js.map → annotation-symbol-slot-CwCc6l70.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-section.entry.cjs.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.cjs.entry.js +1 -1
- package/dist/cjs/dso-advanced-select.cjs.entry.js +1 -1
- package/dist/cjs/dso-alert_6.cjs.entry.js +2 -2
- package/dist/cjs/dso-annotation-activiteit.cjs.entry.js +5 -5
- package/dist/cjs/dso-annotation-activiteit.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-annotation-activiteit.entry.cjs.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-gebiedsaanwijzing.entry.cjs.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-kaart.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-annotation-locatie.dso-document-component.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-annotation-locatie_2.cjs.entry.js +4 -4
- 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-annotation-omgevingsnormwaarde.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-attachments-counter_2.cjs.entry.js +1 -1
- package/dist/cjs/dso-autosuggest.cjs.entry.js +2 -2
- 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 +1 -1
- package/dist/cjs/dso-contact-information.cjs.entry.js +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-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 +1 -1
- package/dist/cjs/dso-input-range.cjs.entry.js +1 -1
- package/dist/cjs/dso-label_3.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 +1 -1
- 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 +3 -3
- package/dist/cjs/dso-map-controls.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-map-controls.entry.cjs.js.map +1 -1
- 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-onboarding-tip.cjs.entry.js +28 -16
- package/dist/cjs/dso-onboarding-tip.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-onboarding-tip.entry.cjs.js.map +1 -1
- package/dist/cjs/dso-pagination.cjs.entry.js +1 -1
- package/dist/cjs/dso-plekinfo-card.cjs.entry.js +3 -3
- package/dist/cjs/dso-plekinfo-card.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-plekinfo-card.entry.cjs.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-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-survey-rating.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-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/dso-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/dso-tooltip.entry.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/{i18n-D9iWFntP.js → i18n-D6gzajyT.js} +120 -203
- package/dist/cjs/i18n-D6gzajyT.js.map +1 -0
- package/dist/cjs/{index-DvrTSHdI.js → index-Bfuot2fD.js} +3 -3
- package/dist/cjs/{index-DvrTSHdI.js.map → index-Bfuot2fD.js.map} +1 -1
- 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 +1 -1
- package/dist/collection/components/annotation/annotation.css +1 -1
- package/dist/collection/components/map-controls/map-controls.css +8 -1
- package/dist/collection/components/onboarding-tip/onboarding-tip.css +1 -1
- package/dist/collection/components/plekinfo-card/plekinfo-card.css +12 -4
- package/dist/collection/components/plekinfo-card/plekinfo-card.js +1 -1
- package/dist/collection/components/plekinfo-card/plekinfo-card.js.map +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/components/annotation-locatie.js +1 -1
- package/dist/components/annotation-locatie.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-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 +1 -1
- package/dist/components/dso-annotation-omgevingsnormwaarde.js.map +1 -1
- package/dist/components/dso-map-controls.js +1 -1
- package/dist/components/dso-map-controls.js.map +1 -1
- package/dist/components/dso-onboarding-tip.js +27 -15
- package/dist/components/dso-onboarding-tip.js.map +1 -1
- package/dist/components/dso-plekinfo-card.js +2 -2
- package/dist/components/dso-plekinfo-card.js.map +1 -1
- package/dist/components/i18n.js +118 -201
- package/dist/components/i18n.js.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/dso-toolkit/dso-accordion-section.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-annotation-activiteit.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-annotation-gebiedsaanwijzing.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-annotation-kaart.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-annotation-locatie.dso-document-component.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-annotation-omgevingsnormwaarde.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-map-controls.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-onboarding-tip.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/dso-plekinfo-card.entry.esm.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/dso-tooltip.entry.esm.js.map +1 -1
- package/dist/dso-toolkit/{p-a0960751.entry.js → p-0764520c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-ce882c53.entry.js → p-0775a693.entry.js} +2 -2
- package/dist/dso-toolkit/{p-13042742.entry.js → p-1107be6c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-f0d63537.entry.js → p-12dfeddc.entry.js} +2 -2
- package/dist/dso-toolkit/{p-0917a964.entry.js → p-189729b9.entry.js} +2 -2
- package/dist/dso-toolkit/p-189729b9.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-1f7f6d8b.entry.js → p-1a22b0dc.entry.js} +2 -2
- package/dist/dso-toolkit/{p-45a523e5.entry.js → p-1b3db27c.entry.js} +2 -2
- package/dist/dso-toolkit/{p-f35cd2b5.entry.js → p-25121130.entry.js} +2 -2
- package/dist/dso-toolkit/{p-47936ff6.entry.js → p-2b70dfec.entry.js} +2 -2
- package/dist/dso-toolkit/{p-621a9bbb.entry.js → p-2edbb43d.entry.js} +2 -2
- package/dist/dso-toolkit/{p-23c5e409.entry.js → p-2ef001ae.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8123ed2f.entry.js → p-2f5521cb.entry.js} +2 -2
- package/dist/dso-toolkit/{p-33acabc1.entry.js → p-3645517b.entry.js} +2 -2
- package/dist/dso-toolkit/p-3645517b.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-38a17746.entry.js → p-3c74fd03.entry.js} +2 -2
- package/dist/dso-toolkit/p-3e3efd7f.entry.js +2 -0
- package/dist/dso-toolkit/p-3e3efd7f.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-4a034e40.entry.js → p-3e60b05f.entry.js} +2 -2
- package/dist/dso-toolkit/{p-a676810d.entry.js → p-3ec9e63e.entry.js} +2 -2
- package/dist/dso-toolkit/{p-3dc6df90.entry.js → p-4222c5b4.entry.js} +2 -2
- package/dist/dso-toolkit/{p-60a2339f.entry.js → p-4728d309.entry.js} +2 -2
- package/dist/dso-toolkit/{p-6841ccee.entry.js → p-4d9f250d.entry.js} +2 -2
- package/dist/dso-toolkit/p-5663e142.entry.js +2 -0
- package/dist/dso-toolkit/p-5663e142.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-6bbde78f.entry.js → p-5db88bab.entry.js} +2 -2
- package/dist/dso-toolkit/p-5db88bab.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-fa1cbcb0.entry.js → p-64c4fbb5.entry.js} +2 -2
- package/dist/dso-toolkit/{p-e3ddc3cf.entry.js → p-66be9677.entry.js} +2 -2
- package/dist/dso-toolkit/{p-49c301fd.entry.js → p-670ea4fe.entry.js} +2 -2
- package/dist/dso-toolkit/p-6a156238.entry.js +2 -0
- package/dist/dso-toolkit/p-6a156238.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-15700a11.entry.js → p-6c1feb1f.entry.js} +2 -2
- package/dist/dso-toolkit/{p-78420f02.entry.js → p-6cc9e6a1.entry.js} +2 -2
- package/dist/dso-toolkit/{p-eebf32bf.entry.js → p-6d475b54.entry.js} +2 -2
- package/dist/dso-toolkit/{p-1882b8ad.entry.js → p-6e13ae72.entry.js} +2 -2
- package/dist/dso-toolkit/{p-e097b372.entry.js → p-715ed1f5.entry.js} +2 -2
- package/dist/dso-toolkit/{p-487f46df.entry.js → p-7d1adc2e.entry.js} +2 -2
- package/dist/dso-toolkit/{p-13b2dc83.entry.js → p-7e2d432b.entry.js} +2 -2
- package/dist/dso-toolkit/p-7e2d432b.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-aa6c0df1.entry.js → p-802d9be8.entry.js} +2 -2
- package/dist/dso-toolkit/{p-638cfb25.entry.js → p-85db5881.entry.js} +2 -2
- package/dist/dso-toolkit/{p-0b902049.entry.js → p-90ead8a5.entry.js} +2 -2
- package/dist/dso-toolkit/{p-08aa7f78.entry.js → p-9a30700a.entry.js} +2 -2
- package/dist/dso-toolkit/{p-eea3b9c8.entry.js → p-9ccc682a.entry.js} +2 -2
- package/dist/dso-toolkit/{p-D2Jo0W7B.js → p-C-b4jsbt.js} +1 -1
- package/dist/dso-toolkit/{p-D2Jo0W7B.js.map → p-C-b4jsbt.js.map} +1 -1
- package/dist/dso-toolkit/p-CrdKfv3R.js +2 -0
- package/dist/dso-toolkit/p-CrdKfv3R.js.map +1 -0
- package/dist/dso-toolkit/{p-ChsEPkam.js → p-D5RszRxh.js} +2 -2
- package/dist/dso-toolkit/{p-ChsEPkam.js.map → p-D5RszRxh.js.map} +1 -1
- package/dist/dso-toolkit/p-Ds10WquL.js +2 -0
- package/dist/dso-toolkit/{p-COKRRU_q.js.map → p-Ds10WquL.js.map} +1 -1
- package/dist/dso-toolkit/p-JeFk1Yvm.js +2 -0
- package/dist/dso-toolkit/{p-D4cSA4l8.js.map → p-JeFk1Yvm.js.map} +1 -1
- package/dist/dso-toolkit/{p-4fd85452.entry.js → p-aa5dc824.entry.js} +2 -2
- package/dist/dso-toolkit/{p-e990ee37.entry.js → p-b3588a49.entry.js} +2 -2
- package/dist/dso-toolkit/{p-0a38c6fa.entry.js → p-bff9db69.entry.js} +2 -2
- package/dist/dso-toolkit/p-bff9db69.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-be3f30c8.entry.js → p-c02f13f7.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8941035f.entry.js → p-c4fe6ee2.entry.js} +2 -2
- package/dist/dso-toolkit/{p-49fc2235.entry.js → p-c5003184.entry.js} +2 -2
- package/dist/dso-toolkit/{p-52cd0064.entry.js → p-c52827dc.entry.js} +2 -2
- package/dist/dso-toolkit/{p-c1f19841.entry.js → p-ca2bef1c.entry.js} +2 -2
- package/dist/dso-toolkit/p-cc784131.entry.js +2 -0
- package/dist/dso-toolkit/p-cc784131.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-ee4c2669.entry.js → p-e0289156.entry.js} +2 -2
- package/dist/dso-toolkit/{p-3ada9fe0.entry.js → p-e9236c1f.entry.js} +2 -2
- package/dist/dso-toolkit/p-e9236c1f.entry.js.map +1 -0
- package/dist/dso-toolkit/{p-75819075.entry.js → p-f1f414b6.entry.js} +2 -2
- package/dist/dso-toolkit/{p-f579815f.entry.js → p-f3d04785.entry.js} +2 -2
- package/dist/dso-toolkit/{p-2d22eaa5.entry.js → p-fda975de.entry.js} +2 -2
- package/dist/dso-toolkit/{p-8a677aba.entry.js → p-ffa5a867.entry.js} +2 -2
- package/dist/esm/{annotation-body-C13C3XCU.js → annotation-body-CHp1npGM.js} +3 -3
- package/dist/esm/{annotation-body-C13C3XCU.js.map → annotation-body-CHp1npGM.js.map} +1 -1
- package/dist/esm/{annotation-list-renvooi-values-D75KxHAC.js → annotation-list-renvooi-values-D1J_Fugb.js} +3 -3
- package/dist/esm/{annotation-list-renvooi-values-D75KxHAC.js.map → annotation-list-renvooi-values-D1J_Fugb.js.map} +1 -1
- package/dist/esm/{annotation-symbol-slot-CRK43mu1.js → annotation-symbol-slot-BCge7vfY.js} +3 -3
- package/dist/esm/{annotation-symbol-slot-CRK43mu1.js.map → annotation-symbol-slot-BCge7vfY.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.entry.js +1 -1
- package/dist/esm/dso-advanced-select.entry.js +1 -1
- package/dist/esm/dso-alert_6.entry.js +2 -2
- package/dist/esm/dso-annotation-activiteit.entry.js +5 -5
- 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.dso-document-component.entry.js.map +1 -1
- package/dist/esm/dso-annotation-locatie_2.entry.js +4 -4
- 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 +2 -2
- 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 +1 -1
- package/dist/esm/dso-contact-information.entry.js +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-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 +1 -1
- package/dist/esm/dso-input-range.entry.js +1 -1
- package/dist/esm/dso-label_3.entry.js +1 -1
- package/dist/esm/dso-legend-item.entry.js +1 -1
- package/dist/esm/dso-list-button.entry.js +1 -1
- 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 +3 -3
- package/dist/esm/dso-map-controls.entry.js.map +1 -1
- 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-onboarding-tip.entry.js +28 -16
- package/dist/esm/dso-onboarding-tip.entry.js.map +1 -1
- package/dist/esm/dso-pagination.entry.js +1 -1
- package/dist/esm/dso-plekinfo-card.entry.js +3 -3
- 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-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-survey-rating.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-tooltip.entry.js +2 -2
- package/dist/esm/dso-tooltip.entry.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/{i18n-BbNJ4wXp.js → i18n-CrdKfv3R.js} +120 -203
- package/dist/esm/i18n-CrdKfv3R.js.map +1 -0
- package/dist/esm/{index-D2Jo0W7B.js → index-C-b4jsbt.js} +3 -3
- package/dist/esm/{index-D2Jo0W7B.js.map → index-C-b4jsbt.js.map} +1 -1
- package/dist/esm/loader.js +2 -2
- package/package.json +8 -8
- package/dist/cjs/i18n-D9iWFntP.js.map +0 -1
- package/dist/dso-toolkit/p-0917a964.entry.js.map +0 -1
- package/dist/dso-toolkit/p-0a38c6fa.entry.js.map +0 -1
- package/dist/dso-toolkit/p-13b2dc83.entry.js.map +0 -1
- package/dist/dso-toolkit/p-2a0e7fab.entry.js +0 -2
- package/dist/dso-toolkit/p-2a0e7fab.entry.js.map +0 -1
- package/dist/dso-toolkit/p-2cac4eb4.entry.js +0 -2
- package/dist/dso-toolkit/p-2cac4eb4.entry.js.map +0 -1
- package/dist/dso-toolkit/p-33acabc1.entry.js.map +0 -1
- package/dist/dso-toolkit/p-33e435a4.entry.js +0 -2
- package/dist/dso-toolkit/p-33e435a4.entry.js.map +0 -1
- package/dist/dso-toolkit/p-3ada9fe0.entry.js.map +0 -1
- package/dist/dso-toolkit/p-6bbde78f.entry.js.map +0 -1
- package/dist/dso-toolkit/p-BbNJ4wXp.js +0 -2
- package/dist/dso-toolkit/p-BbNJ4wXp.js.map +0 -1
- package/dist/dso-toolkit/p-COKRRU_q.js +0 -2
- package/dist/dso-toolkit/p-D4cSA4l8.js +0 -2
- package/dist/dso-toolkit/p-ad5f409c.entry.js +0 -2
- package/dist/dso-toolkit/p-ad5f409c.entry.js.map +0 -1
- package/dist/esm/i18n-BbNJ4wXp.js.map +0 -1
- /package/dist/dso-toolkit/{p-a0960751.entry.js.map → p-0764520c.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-ce882c53.entry.js.map → p-0775a693.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-13042742.entry.js.map → p-1107be6c.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-f0d63537.entry.js.map → p-12dfeddc.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-1f7f6d8b.entry.js.map → p-1a22b0dc.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-45a523e5.entry.js.map → p-1b3db27c.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-f35cd2b5.entry.js.map → p-25121130.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-47936ff6.entry.js.map → p-2b70dfec.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-621a9bbb.entry.js.map → p-2edbb43d.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-23c5e409.entry.js.map → p-2ef001ae.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-8123ed2f.entry.js.map → p-2f5521cb.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-38a17746.entry.js.map → p-3c74fd03.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-4a034e40.entry.js.map → p-3e60b05f.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-a676810d.entry.js.map → p-3ec9e63e.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-3dc6df90.entry.js.map → p-4222c5b4.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-60a2339f.entry.js.map → p-4728d309.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-6841ccee.entry.js.map → p-4d9f250d.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-fa1cbcb0.entry.js.map → p-64c4fbb5.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-e3ddc3cf.entry.js.map → p-66be9677.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-49c301fd.entry.js.map → p-670ea4fe.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-15700a11.entry.js.map → p-6c1feb1f.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-78420f02.entry.js.map → p-6cc9e6a1.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-eebf32bf.entry.js.map → p-6d475b54.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-1882b8ad.entry.js.map → p-6e13ae72.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-e097b372.entry.js.map → p-715ed1f5.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-487f46df.entry.js.map → p-7d1adc2e.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-aa6c0df1.entry.js.map → p-802d9be8.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-638cfb25.entry.js.map → p-85db5881.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-0b902049.entry.js.map → p-90ead8a5.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-08aa7f78.entry.js.map → p-9a30700a.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-eea3b9c8.entry.js.map → p-9ccc682a.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-4fd85452.entry.js.map → p-aa5dc824.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-e990ee37.entry.js.map → p-b3588a49.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-be3f30c8.entry.js.map → p-c02f13f7.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-8941035f.entry.js.map → p-c4fe6ee2.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-49fc2235.entry.js.map → p-c5003184.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-52cd0064.entry.js.map → p-c52827dc.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-c1f19841.entry.js.map → p-ca2bef1c.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-ee4c2669.entry.js.map → p-e0289156.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-75819075.entry.js.map → p-f1f414b6.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-f579815f.entry.js.map → p-f3d04785.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-2d22eaa5.entry.js.map → p-fda975de.entry.js.map} +0 -0
- /package/dist/dso-toolkit/{p-8a677aba.entry.js.map → p-ffa5a867.entry.js.map} +0 -0
package/dist/components/i18n.js
CHANGED
|
@@ -156,8 +156,7 @@ const looksLikeObjectPath = (key, nsSeparator, keySeparator) => {
|
|
|
156
156
|
}
|
|
157
157
|
return matched;
|
|
158
158
|
};
|
|
159
|
-
const deepFind =
|
|
160
|
-
let keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
|
159
|
+
const deepFind = (obj, path, keySeparator = '.') => {
|
|
161
160
|
if (!obj) return undefined;
|
|
162
161
|
if (obj[path]) {
|
|
163
162
|
if (!Object.prototype.hasOwnProperty.call(obj, path)) return undefined;
|
|
@@ -207,39 +206,25 @@ const consoleLogger = {
|
|
|
207
206
|
}
|
|
208
207
|
};
|
|
209
208
|
class Logger {
|
|
210
|
-
constructor(concreteLogger) {
|
|
211
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
209
|
+
constructor(concreteLogger, options = {}) {
|
|
212
210
|
this.init(concreteLogger, options);
|
|
213
211
|
}
|
|
214
|
-
init(concreteLogger) {
|
|
215
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
212
|
+
init(concreteLogger, options = {}) {
|
|
216
213
|
this.prefix = options.prefix || 'i18next:';
|
|
217
214
|
this.logger = concreteLogger || consoleLogger;
|
|
218
215
|
this.options = options;
|
|
219
216
|
this.debug = options.debug;
|
|
220
217
|
}
|
|
221
|
-
log() {
|
|
222
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
223
|
-
args[_key] = arguments[_key];
|
|
224
|
-
}
|
|
218
|
+
log(...args) {
|
|
225
219
|
return this.forward(args, 'log', '', true);
|
|
226
220
|
}
|
|
227
|
-
warn() {
|
|
228
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
229
|
-
args[_key2] = arguments[_key2];
|
|
230
|
-
}
|
|
221
|
+
warn(...args) {
|
|
231
222
|
return this.forward(args, 'warn', '', true);
|
|
232
223
|
}
|
|
233
|
-
error() {
|
|
234
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
235
|
-
args[_key3] = arguments[_key3];
|
|
236
|
-
}
|
|
224
|
+
error(...args) {
|
|
237
225
|
return this.forward(args, 'error', '');
|
|
238
226
|
}
|
|
239
|
-
deprecate() {
|
|
240
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
241
|
-
args[_key4] = arguments[_key4];
|
|
242
|
-
}
|
|
227
|
+
deprecate(...args) {
|
|
243
228
|
return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
|
|
244
229
|
}
|
|
245
230
|
forward(args, lvl, prefix, debugOnly) {
|
|
@@ -283,14 +268,10 @@ class EventEmitter {
|
|
|
283
268
|
}
|
|
284
269
|
this.observers[event].delete(listener);
|
|
285
270
|
}
|
|
286
|
-
emit(event) {
|
|
287
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
288
|
-
args[_key - 1] = arguments[_key];
|
|
289
|
-
}
|
|
271
|
+
emit(event, ...args) {
|
|
290
272
|
if (this.observers[event]) {
|
|
291
273
|
const cloned = Array.from(this.observers[event].entries());
|
|
292
|
-
cloned.forEach(
|
|
293
|
-
let [observer, numTimesAdded] = _ref;
|
|
274
|
+
cloned.forEach(([observer, numTimesAdded]) => {
|
|
294
275
|
for (let i = 0; i < numTimesAdded; i++) {
|
|
295
276
|
observer(...args);
|
|
296
277
|
}
|
|
@@ -298,8 +279,7 @@ class EventEmitter {
|
|
|
298
279
|
}
|
|
299
280
|
if (this.observers['*']) {
|
|
300
281
|
const cloned = Array.from(this.observers['*'].entries());
|
|
301
|
-
cloned.forEach(
|
|
302
|
-
let [observer, numTimesAdded] = _ref2;
|
|
282
|
+
cloned.forEach(([observer, numTimesAdded]) => {
|
|
303
283
|
for (let i = 0; i < numTimesAdded; i++) {
|
|
304
284
|
observer.apply(observer, [event, ...args]);
|
|
305
285
|
}
|
|
@@ -309,11 +289,10 @@ class EventEmitter {
|
|
|
309
289
|
}
|
|
310
290
|
|
|
311
291
|
class ResourceStore extends EventEmitter {
|
|
312
|
-
constructor(data
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
};
|
|
292
|
+
constructor(data, options = {
|
|
293
|
+
ns: ['translation'],
|
|
294
|
+
defaultNS: 'translation'
|
|
295
|
+
}) {
|
|
317
296
|
super();
|
|
318
297
|
this.data = data || {};
|
|
319
298
|
this.options = options;
|
|
@@ -335,8 +314,7 @@ class ResourceStore extends EventEmitter {
|
|
|
335
314
|
this.options.ns.splice(index, 1);
|
|
336
315
|
}
|
|
337
316
|
}
|
|
338
|
-
getResource(lng, ns, key) {
|
|
339
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
317
|
+
getResource(lng, ns, key, options = {}) {
|
|
340
318
|
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
341
319
|
const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
|
342
320
|
let path;
|
|
@@ -363,10 +341,9 @@ class ResourceStore extends EventEmitter {
|
|
|
363
341
|
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
364
342
|
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
365
343
|
}
|
|
366
|
-
addResource(lng, ns, key, value
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
};
|
|
344
|
+
addResource(lng, ns, key, value, options = {
|
|
345
|
+
silent: false
|
|
346
|
+
}) {
|
|
370
347
|
const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
|
371
348
|
let path = [lng, ns];
|
|
372
349
|
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
|
@@ -379,10 +356,9 @@ class ResourceStore extends EventEmitter {
|
|
|
379
356
|
setPath(this.data, path, value);
|
|
380
357
|
if (!options.silent) this.emit('added', lng, ns, key, value);
|
|
381
358
|
}
|
|
382
|
-
addResources(lng, ns, resources
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
};
|
|
359
|
+
addResources(lng, ns, resources, options = {
|
|
360
|
+
silent: false
|
|
361
|
+
}) {
|
|
386
362
|
for (const m in resources) {
|
|
387
363
|
if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {
|
|
388
364
|
silent: true
|
|
@@ -390,11 +366,10 @@ class ResourceStore extends EventEmitter {
|
|
|
390
366
|
}
|
|
391
367
|
if (!options.silent) this.emit('added', lng, ns, resources);
|
|
392
368
|
}
|
|
393
|
-
addResourceBundle(lng, ns, resources, deep, overwrite
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
};
|
|
369
|
+
addResourceBundle(lng, ns, resources, deep, overwrite, options = {
|
|
370
|
+
silent: false,
|
|
371
|
+
skipCopy: false
|
|
372
|
+
}) {
|
|
398
373
|
let path = [lng, ns];
|
|
399
374
|
if (lng.indexOf('.') > -1) {
|
|
400
375
|
path = lng.split('.');
|
|
@@ -459,8 +434,7 @@ var postProcessor = {
|
|
|
459
434
|
const checkedLoadedFor = {};
|
|
460
435
|
const shouldHandleAsObject = res => !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';
|
|
461
436
|
class Translator extends EventEmitter {
|
|
462
|
-
constructor(services) {
|
|
463
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
437
|
+
constructor(services, options = {}) {
|
|
464
438
|
super();
|
|
465
439
|
copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);
|
|
466
440
|
this.options = options;
|
|
@@ -472,14 +446,14 @@ class Translator extends EventEmitter {
|
|
|
472
446
|
changeLanguage(lng) {
|
|
473
447
|
if (lng) this.language = lng;
|
|
474
448
|
}
|
|
475
|
-
exists(key
|
|
476
|
-
|
|
477
|
-
|
|
449
|
+
exists(key, o = {
|
|
450
|
+
interpolation: {}
|
|
451
|
+
}) {
|
|
452
|
+
const opt = {
|
|
453
|
+
...o
|
|
478
454
|
};
|
|
479
|
-
if (key == null)
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
const resolved = this.resolve(key, options);
|
|
455
|
+
if (key == null) return false;
|
|
456
|
+
const resolved = this.resolve(key, opt);
|
|
483
457
|
return resolved?.res !== undefined;
|
|
484
458
|
}
|
|
485
459
|
extractFromKey(key, opt) {
|
|
@@ -506,7 +480,10 @@ class Translator extends EventEmitter {
|
|
|
506
480
|
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
507
481
|
};
|
|
508
482
|
}
|
|
509
|
-
translate(keys,
|
|
483
|
+
translate(keys, o, lastKey) {
|
|
484
|
+
let opt = typeof o === 'object' ? {
|
|
485
|
+
...o
|
|
486
|
+
} : o;
|
|
510
487
|
if (typeof opt !== 'object' && this.options.overloadTranslationOptionHandler) {
|
|
511
488
|
opt = this.options.overloadTranslationOptionHandler(arguments);
|
|
512
489
|
}
|
|
@@ -523,11 +500,12 @@ class Translator extends EventEmitter {
|
|
|
523
500
|
namespaces
|
|
524
501
|
} = this.extractFromKey(keys[keys.length - 1], opt);
|
|
525
502
|
const namespace = namespaces[namespaces.length - 1];
|
|
503
|
+
let nsSeparator = opt.nsSeparator !== undefined ? opt.nsSeparator : this.options.nsSeparator;
|
|
504
|
+
if (nsSeparator === undefined) nsSeparator = ':';
|
|
526
505
|
const lng = opt.lng || this.language;
|
|
527
506
|
const appendNamespaceToCIMode = opt.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
|
528
507
|
if (lng?.toLowerCase() === 'cimode') {
|
|
529
508
|
if (appendNamespaceToCIMode) {
|
|
530
|
-
const nsSeparator = opt.nsSeparator || this.options.nsSeparator;
|
|
531
509
|
if (returnDetails) {
|
|
532
510
|
return {
|
|
533
511
|
res: `${namespace}${nsSeparator}${key}`,
|
|
@@ -682,9 +660,11 @@ class Translator extends EventEmitter {
|
|
|
682
660
|
}
|
|
683
661
|
}
|
|
684
662
|
res = this.extendTranslation(res, keys, opt, resolved, lastKey);
|
|
685
|
-
if (usedKey && res === key && this.options.appendNamespaceToMissingKey)
|
|
663
|
+
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) {
|
|
664
|
+
res = `${namespace}${nsSeparator}${key}`;
|
|
665
|
+
}
|
|
686
666
|
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {
|
|
687
|
-
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}
|
|
667
|
+
res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}${nsSeparator}${key}` : key, usedDefault ? res : undefined, opt);
|
|
688
668
|
}
|
|
689
669
|
}
|
|
690
670
|
if (returnDetails) {
|
|
@@ -695,7 +675,6 @@ class Translator extends EventEmitter {
|
|
|
695
675
|
return res;
|
|
696
676
|
}
|
|
697
677
|
extendTranslation(res, key, opt, resolved, lastKey) {
|
|
698
|
-
var _this = this;
|
|
699
678
|
if (this.i18nFormat?.parse) {
|
|
700
679
|
res = this.i18nFormat.parse(res, {
|
|
701
680
|
...this.options.interpolation.defaultVariables,
|
|
@@ -731,15 +710,12 @@ class Translator extends EventEmitter {
|
|
|
731
710
|
if (nestBef < nestAft) opt.nest = false;
|
|
732
711
|
}
|
|
733
712
|
if (!opt.lng && resolved && resolved.res) opt.lng = this.language || resolved.usedLng;
|
|
734
|
-
if (opt.nest !== false) res = this.interpolator.nest(res,
|
|
735
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
736
|
-
args[_key] = arguments[_key];
|
|
737
|
-
}
|
|
713
|
+
if (opt.nest !== false) res = this.interpolator.nest(res, (...args) => {
|
|
738
714
|
if (lastKey?.[0] === args[0] && !opt.context) {
|
|
739
|
-
|
|
715
|
+
this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);
|
|
740
716
|
return null;
|
|
741
717
|
}
|
|
742
|
-
return
|
|
718
|
+
return this.translate(...args, key);
|
|
743
719
|
}, opt);
|
|
744
720
|
if (opt.interpolation) this.interpolator.reset();
|
|
745
721
|
}
|
|
@@ -756,8 +732,7 @@ class Translator extends EventEmitter {
|
|
|
756
732
|
}
|
|
757
733
|
return res;
|
|
758
734
|
}
|
|
759
|
-
resolve(keys) {
|
|
760
|
-
let opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
735
|
+
resolve(keys, opt = {}) {
|
|
761
736
|
let found;
|
|
762
737
|
let usedKey;
|
|
763
738
|
let exactUsedKey;
|
|
@@ -837,13 +812,11 @@ class Translator extends EventEmitter {
|
|
|
837
812
|
isValidLookup(res) {
|
|
838
813
|
return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
|
|
839
814
|
}
|
|
840
|
-
getResource(code, ns, key) {
|
|
841
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
815
|
+
getResource(code, ns, key, options = {}) {
|
|
842
816
|
if (this.i18nFormat?.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
|
843
817
|
return this.resourceStore.getResource(code, ns, key, options);
|
|
844
818
|
}
|
|
845
|
-
getUsedParamsDetails() {
|
|
846
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
819
|
+
getUsedParamsDetails(options = {}) {
|
|
847
820
|
const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];
|
|
848
821
|
const useOptionsReplaceForData = options.replace && !isString(options.replace);
|
|
849
822
|
let data = useOptionsReplaceForData ? options.replace : options;
|
|
@@ -1000,8 +973,7 @@ const dummyRule = {
|
|
|
1000
973
|
})
|
|
1001
974
|
};
|
|
1002
975
|
class PluralResolver {
|
|
1003
|
-
constructor(languageUtils) {
|
|
1004
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
976
|
+
constructor(languageUtils, options = {}) {
|
|
1005
977
|
this.languageUtils = languageUtils;
|
|
1006
978
|
this.options = options;
|
|
1007
979
|
this.logger = baseLogger.create('pluralResolver');
|
|
@@ -1013,8 +985,7 @@ class PluralResolver {
|
|
|
1013
985
|
clearCache() {
|
|
1014
986
|
this.pluralRulesCache = {};
|
|
1015
987
|
}
|
|
1016
|
-
getRule(code) {
|
|
1017
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
988
|
+
getRule(code, options = {}) {
|
|
1018
989
|
const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);
|
|
1019
990
|
const type = options.ordinal ? 'ordinal' : 'cardinal';
|
|
1020
991
|
const cacheKey = JSON.stringify({
|
|
@@ -1041,25 +1012,21 @@ class PluralResolver {
|
|
|
1041
1012
|
this.pluralRulesCache[cacheKey] = rule;
|
|
1042
1013
|
return rule;
|
|
1043
1014
|
}
|
|
1044
|
-
needsPlural(code) {
|
|
1045
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1015
|
+
needsPlural(code, options = {}) {
|
|
1046
1016
|
let rule = this.getRule(code, options);
|
|
1047
1017
|
if (!rule) rule = this.getRule('dev', options);
|
|
1048
1018
|
return rule?.resolvedOptions().pluralCategories.length > 1;
|
|
1049
1019
|
}
|
|
1050
|
-
getPluralFormsOfKey(code, key) {
|
|
1051
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1020
|
+
getPluralFormsOfKey(code, key, options = {}) {
|
|
1052
1021
|
return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);
|
|
1053
1022
|
}
|
|
1054
|
-
getSuffixes(code) {
|
|
1055
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1023
|
+
getSuffixes(code, options = {}) {
|
|
1056
1024
|
let rule = this.getRule(code, options);
|
|
1057
1025
|
if (!rule) rule = this.getRule('dev', options);
|
|
1058
1026
|
if (!rule) return [];
|
|
1059
1027
|
return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);
|
|
1060
1028
|
}
|
|
1061
|
-
getSuffix(code, count) {
|
|
1062
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1029
|
+
getSuffix(code, count, options = {}) {
|
|
1063
1030
|
const rule = this.getRule(code, options);
|
|
1064
1031
|
if (rule) {
|
|
1065
1032
|
return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;
|
|
@@ -1069,9 +1036,7 @@ class PluralResolver {
|
|
|
1069
1036
|
}
|
|
1070
1037
|
}
|
|
1071
1038
|
|
|
1072
|
-
const deepFindWithDefaults =
|
|
1073
|
-
let keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';
|
|
1074
|
-
let ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
1039
|
+
const deepFindWithDefaults = (data, defaultData, key, keySeparator = '.', ignoreJSONStructure = true) => {
|
|
1075
1040
|
let path = getPathWithDefaults(data, defaultData, key);
|
|
1076
1041
|
if (!path && ignoreJSONStructure && isString(key)) {
|
|
1077
1042
|
path = deepFind(data, key, keySeparator);
|
|
@@ -1081,15 +1046,13 @@ const deepFindWithDefaults = function (data, defaultData, key) {
|
|
|
1081
1046
|
};
|
|
1082
1047
|
const regexSafe = val => val.replace(/\$/g, '$$$$');
|
|
1083
1048
|
class Interpolator {
|
|
1084
|
-
constructor() {
|
|
1085
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1049
|
+
constructor(options = {}) {
|
|
1086
1050
|
this.logger = baseLogger.create('interpolator');
|
|
1087
1051
|
this.options = options;
|
|
1088
1052
|
this.format = options?.interpolation?.format || (value => value);
|
|
1089
1053
|
this.init(options);
|
|
1090
1054
|
}
|
|
1091
|
-
init() {
|
|
1092
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1055
|
+
init(options = {}) {
|
|
1093
1056
|
if (!options.interpolation) options.interpolation = {
|
|
1094
1057
|
escapeValue: true
|
|
1095
1058
|
};
|
|
@@ -1212,8 +1175,7 @@ class Interpolator {
|
|
|
1212
1175
|
});
|
|
1213
1176
|
return str;
|
|
1214
1177
|
}
|
|
1215
|
-
nest(str, fc) {
|
|
1216
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1178
|
+
nest(str, fc, options = {}) {
|
|
1217
1179
|
let match;
|
|
1218
1180
|
let value;
|
|
1219
1181
|
let clonedOptions;
|
|
@@ -1310,68 +1272,68 @@ const parseFormatStr = formatStr => {
|
|
|
1310
1272
|
};
|
|
1311
1273
|
const createCachedFormatter = fn => {
|
|
1312
1274
|
const cache = {};
|
|
1313
|
-
return (
|
|
1314
|
-
let optForCache =
|
|
1315
|
-
if (
|
|
1275
|
+
return (v, l, o) => {
|
|
1276
|
+
let optForCache = o;
|
|
1277
|
+
if (o && o.interpolationkey && o.formatParams && o.formatParams[o.interpolationkey] && o[o.interpolationkey]) {
|
|
1316
1278
|
optForCache = {
|
|
1317
1279
|
...optForCache,
|
|
1318
|
-
[
|
|
1280
|
+
[o.interpolationkey]: undefined
|
|
1319
1281
|
};
|
|
1320
1282
|
}
|
|
1321
|
-
const key =
|
|
1322
|
-
let
|
|
1323
|
-
if (!
|
|
1324
|
-
|
|
1325
|
-
cache[key] =
|
|
1283
|
+
const key = l + JSON.stringify(optForCache);
|
|
1284
|
+
let frm = cache[key];
|
|
1285
|
+
if (!frm) {
|
|
1286
|
+
frm = fn(getCleanedCode(l), o);
|
|
1287
|
+
cache[key] = frm;
|
|
1326
1288
|
}
|
|
1327
|
-
return
|
|
1289
|
+
return frm(v);
|
|
1328
1290
|
};
|
|
1329
1291
|
};
|
|
1292
|
+
const createNonCachedFormatter = fn => (v, l, o) => fn(getCleanedCode(l), o)(v);
|
|
1330
1293
|
class Formatter {
|
|
1331
|
-
constructor() {
|
|
1332
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1294
|
+
constructor(options = {}) {
|
|
1333
1295
|
this.logger = baseLogger.create('formatter');
|
|
1334
1296
|
this.options = options;
|
|
1297
|
+
this.init(options);
|
|
1298
|
+
}
|
|
1299
|
+
init(services, options = {
|
|
1300
|
+
interpolation: {}
|
|
1301
|
+
}) {
|
|
1302
|
+
this.formatSeparator = options.interpolation.formatSeparator || ',';
|
|
1303
|
+
const cf = options.cacheInBuiltFormats ? createCachedFormatter : createNonCachedFormatter;
|
|
1335
1304
|
this.formats = {
|
|
1336
|
-
number:
|
|
1305
|
+
number: cf((lng, opt) => {
|
|
1337
1306
|
const formatter = new Intl.NumberFormat(lng, {
|
|
1338
1307
|
...opt
|
|
1339
1308
|
});
|
|
1340
1309
|
return val => formatter.format(val);
|
|
1341
1310
|
}),
|
|
1342
|
-
currency:
|
|
1311
|
+
currency: cf((lng, opt) => {
|
|
1343
1312
|
const formatter = new Intl.NumberFormat(lng, {
|
|
1344
1313
|
...opt,
|
|
1345
1314
|
style: 'currency'
|
|
1346
1315
|
});
|
|
1347
1316
|
return val => formatter.format(val);
|
|
1348
1317
|
}),
|
|
1349
|
-
datetime:
|
|
1318
|
+
datetime: cf((lng, opt) => {
|
|
1350
1319
|
const formatter = new Intl.DateTimeFormat(lng, {
|
|
1351
1320
|
...opt
|
|
1352
1321
|
});
|
|
1353
1322
|
return val => formatter.format(val);
|
|
1354
1323
|
}),
|
|
1355
|
-
relativetime:
|
|
1324
|
+
relativetime: cf((lng, opt) => {
|
|
1356
1325
|
const formatter = new Intl.RelativeTimeFormat(lng, {
|
|
1357
1326
|
...opt
|
|
1358
1327
|
});
|
|
1359
1328
|
return val => formatter.format(val, opt.range || 'day');
|
|
1360
1329
|
}),
|
|
1361
|
-
list:
|
|
1330
|
+
list: cf((lng, opt) => {
|
|
1362
1331
|
const formatter = new Intl.ListFormat(lng, {
|
|
1363
1332
|
...opt
|
|
1364
1333
|
});
|
|
1365
1334
|
return val => formatter.format(val);
|
|
1366
1335
|
})
|
|
1367
1336
|
};
|
|
1368
|
-
this.init(options);
|
|
1369
|
-
}
|
|
1370
|
-
init(services) {
|
|
1371
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
1372
|
-
interpolation: {}
|
|
1373
|
-
};
|
|
1374
|
-
this.formatSeparator = options.interpolation.formatSeparator || ',';
|
|
1375
1337
|
}
|
|
1376
1338
|
add(name, fc) {
|
|
1377
1339
|
this.formats[name.toLowerCase().trim()] = fc;
|
|
@@ -1379,8 +1341,7 @@ class Formatter {
|
|
|
1379
1341
|
addCached(name, fc) {
|
|
1380
1342
|
this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);
|
|
1381
1343
|
}
|
|
1382
|
-
format(value, format, lng) {
|
|
1383
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1344
|
+
format(value, format, lng, options = {}) {
|
|
1384
1345
|
const formats = format.split(this.formatSeparator);
|
|
1385
1346
|
if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {
|
|
1386
1347
|
const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);
|
|
@@ -1421,8 +1382,7 @@ const removePending = (q, name) => {
|
|
|
1421
1382
|
}
|
|
1422
1383
|
};
|
|
1423
1384
|
class Connector extends EventEmitter {
|
|
1424
|
-
constructor(backend, store, services) {
|
|
1425
|
-
let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
1385
|
+
constructor(backend, store, services, options = {}) {
|
|
1426
1386
|
super();
|
|
1427
1387
|
this.backend = backend;
|
|
1428
1388
|
this.store = store;
|
|
@@ -1516,10 +1476,7 @@ class Connector extends EventEmitter {
|
|
|
1516
1476
|
this.emit('loaded', loaded);
|
|
1517
1477
|
this.queue = this.queue.filter(q => !q.done);
|
|
1518
1478
|
}
|
|
1519
|
-
read(lng, ns, fcName) {
|
|
1520
|
-
let tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
1521
|
-
let wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;
|
|
1522
|
-
let callback = arguments.length > 5 ? arguments[5] : undefined;
|
|
1479
|
+
read(lng, ns, fcName, tried = 0, wait = this.retryTimeout, callback) {
|
|
1523
1480
|
if (!lng.length) return callback(null, {});
|
|
1524
1481
|
if (this.readingCalls >= this.maxParallelReads) {
|
|
1525
1482
|
this.waitingReads.push({
|
|
@@ -1563,9 +1520,7 @@ class Connector extends EventEmitter {
|
|
|
1563
1520
|
}
|
|
1564
1521
|
return fc(lng, ns, resolver);
|
|
1565
1522
|
}
|
|
1566
|
-
prepareLoading(languages, namespaces) {
|
|
1567
|
-
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1568
|
-
let callback = arguments.length > 3 ? arguments[3] : undefined;
|
|
1523
|
+
prepareLoading(languages, namespaces, options = {}, callback) {
|
|
1569
1524
|
if (!this.backend) {
|
|
1570
1525
|
this.logger.warn('No backend was added via i18next.use. Will not load resources.');
|
|
1571
1526
|
return callback && callback();
|
|
@@ -1589,8 +1544,7 @@ class Connector extends EventEmitter {
|
|
|
1589
1544
|
reload: true
|
|
1590
1545
|
}, callback);
|
|
1591
1546
|
}
|
|
1592
|
-
loadOne(name) {
|
|
1593
|
-
let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1547
|
+
loadOne(name, prefix = '') {
|
|
1594
1548
|
const s = name.split('|');
|
|
1595
1549
|
const lng = s[0];
|
|
1596
1550
|
const ns = s[1];
|
|
@@ -1600,9 +1554,7 @@ class Connector extends EventEmitter {
|
|
|
1600
1554
|
this.loaded(name, err, data);
|
|
1601
1555
|
});
|
|
1602
1556
|
}
|
|
1603
|
-
saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
|
1604
|
-
let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
1605
|
-
let clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => {};
|
|
1557
|
+
saveMissing(languages, namespace, key, fallbackValue, isUpdate, options = {}, clb = () => {}) {
|
|
1606
1558
|
if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(namespace)) {
|
|
1607
1559
|
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!!!');
|
|
1608
1560
|
return;
|
|
@@ -1697,7 +1649,8 @@ const get = () => ({
|
|
|
1697
1649
|
nestingOptionsSeparator: ',',
|
|
1698
1650
|
maxReplaces: 1000,
|
|
1699
1651
|
skipOnVariables: true
|
|
1700
|
-
}
|
|
1652
|
+
},
|
|
1653
|
+
cacheInBuiltFormats: true
|
|
1701
1654
|
});
|
|
1702
1655
|
const transformOptions = options => {
|
|
1703
1656
|
if (isString(options.ns)) options.ns = [options.ns];
|
|
@@ -1720,9 +1673,7 @@ const bindMemberFunctions = inst => {
|
|
|
1720
1673
|
});
|
|
1721
1674
|
};
|
|
1722
1675
|
class I18n extends EventEmitter {
|
|
1723
|
-
constructor() {
|
|
1724
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1725
|
-
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
1676
|
+
constructor(options = {}, callback) {
|
|
1726
1677
|
super();
|
|
1727
1678
|
this.options = transformOptions(options);
|
|
1728
1679
|
this.services = {};
|
|
@@ -1741,10 +1692,7 @@ class I18n extends EventEmitter {
|
|
|
1741
1692
|
}, 0);
|
|
1742
1693
|
}
|
|
1743
1694
|
}
|
|
1744
|
-
init() {
|
|
1745
|
-
var _this = this;
|
|
1746
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1747
|
-
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
1695
|
+
init(options = {}, callback) {
|
|
1748
1696
|
this.isInitializing = true;
|
|
1749
1697
|
if (typeof options === 'function') {
|
|
1750
1698
|
callback = options;
|
|
@@ -1810,11 +1758,8 @@ class I18n extends EventEmitter {
|
|
|
1810
1758
|
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
|
1811
1759
|
};
|
|
1812
1760
|
s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
|
|
1813
|
-
s.backendConnector.on('*',
|
|
1814
|
-
|
|
1815
|
-
args[_key - 1] = arguments[_key];
|
|
1816
|
-
}
|
|
1817
|
-
_this.emit(event, ...args);
|
|
1761
|
+
s.backendConnector.on('*', (event, ...args) => {
|
|
1762
|
+
this.emit(event, ...args);
|
|
1818
1763
|
});
|
|
1819
1764
|
if (this.modules.languageDetector) {
|
|
1820
1765
|
s.languageDetector = createClassOnDemand(this.modules.languageDetector);
|
|
@@ -1825,11 +1770,8 @@ class I18n extends EventEmitter {
|
|
|
1825
1770
|
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
|
1826
1771
|
}
|
|
1827
1772
|
this.translator = new Translator(this.services, this.options);
|
|
1828
|
-
this.translator.on('*',
|
|
1829
|
-
|
|
1830
|
-
args[_key2 - 1] = arguments[_key2];
|
|
1831
|
-
}
|
|
1832
|
-
_this.emit(event, ...args);
|
|
1773
|
+
this.translator.on('*', (event, ...args) => {
|
|
1774
|
+
this.emit(event, ...args);
|
|
1833
1775
|
});
|
|
1834
1776
|
this.modules.external.forEach(m => {
|
|
1835
1777
|
if (m.init) m.init(this);
|
|
@@ -1846,15 +1788,13 @@ class I18n extends EventEmitter {
|
|
|
1846
1788
|
}
|
|
1847
1789
|
const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
|
|
1848
1790
|
storeApi.forEach(fcName => {
|
|
1849
|
-
this[fcName] =
|
|
1850
|
-
return _this.store[fcName](...arguments);
|
|
1851
|
-
};
|
|
1791
|
+
this[fcName] = (...args) => this.store[fcName](...args);
|
|
1852
1792
|
});
|
|
1853
1793
|
const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
|
|
1854
1794
|
storeApiChained.forEach(fcName => {
|
|
1855
|
-
this[fcName] =
|
|
1856
|
-
|
|
1857
|
-
return
|
|
1795
|
+
this[fcName] = (...args) => {
|
|
1796
|
+
this.store[fcName](...args);
|
|
1797
|
+
return this;
|
|
1858
1798
|
};
|
|
1859
1799
|
});
|
|
1860
1800
|
const deferred = defer();
|
|
@@ -1878,8 +1818,7 @@ class I18n extends EventEmitter {
|
|
|
1878
1818
|
}
|
|
1879
1819
|
return deferred;
|
|
1880
1820
|
}
|
|
1881
|
-
loadResources(language) {
|
|
1882
|
-
let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
1821
|
+
loadResources(language, callback = noop) {
|
|
1883
1822
|
let usedCallback = callback;
|
|
1884
1823
|
const usedLng = isString(language) ? language : this.language;
|
|
1885
1824
|
if (typeof language === 'function') usedCallback = language;
|
|
@@ -1968,11 +1907,10 @@ class I18n extends EventEmitter {
|
|
|
1968
1907
|
}
|
|
1969
1908
|
if (!this.resolvedLanguage && this.languages.indexOf(l) < 0 && this.store.hasLanguageSomeTranslations(l)) {
|
|
1970
1909
|
this.resolvedLanguage = l;
|
|
1971
|
-
|
|
1910
|
+
this.languages.unshift(l);
|
|
1972
1911
|
}
|
|
1973
1912
|
}
|
|
1974
1913
|
changeLanguage(lng, callback) {
|
|
1975
|
-
var _this2 = this;
|
|
1976
1914
|
this.isLanguageChangingTo = lng;
|
|
1977
1915
|
const deferred = defer();
|
|
1978
1916
|
this.emit('languageChanging', lng);
|
|
@@ -1994,12 +1932,8 @@ class I18n extends EventEmitter {
|
|
|
1994
1932
|
} else {
|
|
1995
1933
|
this.isLanguageChangingTo = undefined;
|
|
1996
1934
|
}
|
|
1997
|
-
deferred.resolve(
|
|
1998
|
-
|
|
1999
|
-
});
|
|
2000
|
-
if (callback) callback(err, function () {
|
|
2001
|
-
return _this2.t(...arguments);
|
|
2002
|
-
});
|
|
1935
|
+
deferred.resolve((...args) => this.t(...args));
|
|
1936
|
+
if (callback) callback(err, (...args) => this.t(...args));
|
|
2003
1937
|
};
|
|
2004
1938
|
const setLng = lngs => {
|
|
2005
1939
|
if (!lng && !lngs && this.services.languageDetector) lngs = [];
|
|
@@ -2030,14 +1964,10 @@ class I18n extends EventEmitter {
|
|
|
2030
1964
|
return deferred;
|
|
2031
1965
|
}
|
|
2032
1966
|
getFixedT(lng, ns, keyPrefix) {
|
|
2033
|
-
|
|
2034
|
-
const fixedT = function (key, opts) {
|
|
1967
|
+
const fixedT = (key, opts, ...rest) => {
|
|
2035
1968
|
let o;
|
|
2036
1969
|
if (typeof opts !== 'object') {
|
|
2037
|
-
|
|
2038
|
-
rest[_key3 - 2] = arguments[_key3];
|
|
2039
|
-
}
|
|
2040
|
-
o = _this3.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
1970
|
+
o = this.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2041
1971
|
} else {
|
|
2042
1972
|
o = {
|
|
2043
1973
|
...opts
|
|
@@ -2047,14 +1977,14 @@ class I18n extends EventEmitter {
|
|
|
2047
1977
|
o.lngs = o.lngs || fixedT.lngs;
|
|
2048
1978
|
o.ns = o.ns || fixedT.ns;
|
|
2049
1979
|
if (o.keyPrefix !== '') o.keyPrefix = o.keyPrefix || keyPrefix || fixedT.keyPrefix;
|
|
2050
|
-
const keySeparator =
|
|
1980
|
+
const keySeparator = this.options.keySeparator || '.';
|
|
2051
1981
|
let resultKey;
|
|
2052
1982
|
if (o.keyPrefix && Array.isArray(key)) {
|
|
2053
1983
|
resultKey = key.map(k => `${o.keyPrefix}${keySeparator}${k}`);
|
|
2054
1984
|
} else {
|
|
2055
1985
|
resultKey = o.keyPrefix ? `${o.keyPrefix}${keySeparator}${key}` : key;
|
|
2056
1986
|
}
|
|
2057
|
-
return
|
|
1987
|
+
return this.t(resultKey, o);
|
|
2058
1988
|
};
|
|
2059
1989
|
if (isString(lng)) {
|
|
2060
1990
|
fixedT.lng = lng;
|
|
@@ -2065,23 +1995,16 @@ class I18n extends EventEmitter {
|
|
|
2065
1995
|
fixedT.keyPrefix = keyPrefix;
|
|
2066
1996
|
return fixedT;
|
|
2067
1997
|
}
|
|
2068
|
-
t() {
|
|
2069
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
2070
|
-
args[_key4] = arguments[_key4];
|
|
2071
|
-
}
|
|
1998
|
+
t(...args) {
|
|
2072
1999
|
return this.translator?.translate(...args);
|
|
2073
2000
|
}
|
|
2074
|
-
exists() {
|
|
2075
|
-
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
2076
|
-
args[_key5] = arguments[_key5];
|
|
2077
|
-
}
|
|
2001
|
+
exists(...args) {
|
|
2078
2002
|
return this.translator?.exists(...args);
|
|
2079
2003
|
}
|
|
2080
2004
|
setDefaultNamespace(ns) {
|
|
2081
2005
|
this.options.defaultNS = ns;
|
|
2082
2006
|
}
|
|
2083
|
-
hasLoadedNamespace(ns) {
|
|
2084
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2007
|
+
hasLoadedNamespace(ns, options = {}) {
|
|
2085
2008
|
if (!this.isInitialized) {
|
|
2086
2009
|
this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
|
|
2087
2010
|
return false;
|
|
@@ -2146,14 +2069,10 @@ class I18n extends EventEmitter {
|
|
|
2146
2069
|
const languageUtils = this.services?.languageUtils || new LanguageUtil(get());
|
|
2147
2070
|
return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
|
2148
2071
|
}
|
|
2149
|
-
static createInstance() {
|
|
2150
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2151
|
-
let callback = arguments.length > 1 ? arguments[1] : undefined;
|
|
2072
|
+
static createInstance(options = {}, callback) {
|
|
2152
2073
|
return new I18n(options, callback);
|
|
2153
2074
|
}
|
|
2154
|
-
cloneInstance() {
|
|
2155
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2156
|
-
let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2075
|
+
cloneInstance(options = {}, callback = noop) {
|
|
2157
2076
|
const forkResourceStore = options.forkResourceStore;
|
|
2158
2077
|
if (forkResourceStore) delete options.forkResourceStore;
|
|
2159
2078
|
const mergedOptions = {
|
|
@@ -2182,21 +2101,19 @@ class I18n extends EventEmitter {
|
|
|
2182
2101
|
prev[l] = {
|
|
2183
2102
|
...this.store.data[l]
|
|
2184
2103
|
};
|
|
2185
|
-
|
|
2104
|
+
prev[l] = Object.keys(prev[l]).reduce((acc, n) => {
|
|
2186
2105
|
acc[n] = {
|
|
2187
2106
|
...prev[l][n]
|
|
2188
2107
|
};
|
|
2189
2108
|
return acc;
|
|
2190
|
-
},
|
|
2109
|
+
}, prev[l]);
|
|
2110
|
+
return prev;
|
|
2191
2111
|
}, {});
|
|
2192
2112
|
clone.store = new ResourceStore(clonedData, mergedOptions);
|
|
2193
2113
|
clone.services.resourceStore = clone.store;
|
|
2194
2114
|
}
|
|
2195
2115
|
clone.translator = new Translator(clone.services, mergedOptions);
|
|
2196
|
-
clone.translator.on('*',
|
|
2197
|
-
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
2198
|
-
args[_key6 - 1] = arguments[_key6];
|
|
2199
|
-
}
|
|
2116
|
+
clone.translator.on('*', (event, ...args) => {
|
|
2200
2117
|
clone.emit(event, ...args);
|
|
2201
2118
|
});
|
|
2202
2119
|
clone.init(mergedOptions, callback);
|