(self.webpackChunk_JUPYTERLAB_CORE_OUTPUT=self.webpackChunk_JUPYTERLAB_CORE_OUTPUT||[]).push([[6815],{56815:(t,e,a)=>{"use strict";a.r(e),a.d(e,{CommandIDs:()=>n,default:()=>g});var n,o=a(12908),l=a(56901),s=a(96731),i=a(50748),r=a(20850);!function(t){t.installAdditionalLanguages="jupyterlab-translation:install-additional-languages"}(n||(n={}));const c="@jupyterlab/translation-extension:plugin",u={id:"@jupyterlab/translation:translator",autoStart:!0,requires:[o.JupyterFrontEnd.IPaths,i.ISettingRegistry],provides:r.ITranslator,activate:async(t,e,a)=>{const n=await a.load(c),o=n.get("locale").composite;let l=n.get("stringsPrefix").composite;l=n.get("displayStringsPrefix").composite?l:"";const s=new r.TranslationManager(e.urls.translations,l);return await s.fetch(o),s}},d={id:c,requires:[s.IMainMenu,i.ISettingRegistry,r.ITranslator],autoStart:!0,activate:(t,e,a,n)=>{const o=n.load("jupyterlab"),{commands:s}=t;let i;function u(t){i=t.get("locale").composite}a.load(c).then((t=>{var a;u(t),document.documentElement.lang=i,t.changed.connect(u);const n=null===(a=e.settingsMenu.items.find((t=>{var e;return"submenu"===t.type&&"jp-mainmenu-settings-language"===(null===(e=t.submenu)||void 0===e?void 0:e.id)})))||void 0===a?void 0:a.submenu;let c;(0,r.requestTranslationsAPI)("").then((e=>{for(const a in e.data){const i=e.data[a],r=i.displayName,u=i.nativeName,d=r===u,g=d?`${r}`:`${r} - ${u}`;c=`jupyterlab-translation:${a}`,s.addCommand(c,{label:g,caption:g,isEnabled:()=>!d,isVisible:()=>!0,isToggled:()=>d,execute:()=>(0,l.showDialog)({title:o.__("Change interface language?"),body:o.__("After changing the interface language to %1, you will need to reload JupyterLab to see the changes.",g),buttons:[l.Dialog.cancelButton({label:o.__("Cancel")}),l.Dialog.okButton({label:o.__("Change and reload")})]}).then((e=>{e.button.accept&&t.set("locale",a).then((()=>{window.location.reload()})).catch((t=>{console.error(t)}))}))}),n&&n.addItem({command:c,args:{}})}})).catch((t=>{console.error(`Available locales errored!\n${t}`)}))})).catch((t=>{console.error(`The jupyterlab translation extension appears to be missing.\n${t}`)}))}},g=[u,d]}}]);