@@ -61,7 +61,8 @@ ColumnLayout {
6161 NHeader {
6262 label: pluginApi? .tr (" panel.uninstall-dialog-title" )
6363 description: {
64- var base = pluginApi? .tr (" panel.uninstall-dialog-description" ) ?? " "
64+ if (! pluginApi) return " "
65+ var base = pluginApi .tr (" panel.uninstall-dialog-description" )
6566 return base .replace (" {plugin}" , uninstallDialog .pluginToUninstall ? .name || " " )
6667 }
6768 }
@@ -107,19 +108,21 @@ ColumnLayout {
107108
108109 BarService .widgetsRevision ++ ;
109110
110- var title = pluginApi? .tr (" panel.title" ) ?? " "
111- var msg = pluginApi? .tr (" panel.uninstalling" ) ?? " "
111+ if (! pluginApi) return ;
112+ var title = pluginApi .tr (" panel.title" )
113+ var msg = pluginApi .tr (" panel.uninstalling" )
112114 msg = msg .replace (" {plugin}" , pluginName)
113115 ToastService .showNotice (title, msg);
114116
115117 PluginService .uninstallPlugin (pluginId, function (success , error ) {
118+ if (! pluginApi) return ;
116119 if (success) {
117- var successMsg = pluginApi? .tr (" panel.uninstall-success" ) ?? " "
120+ var successMsg = pluginApi .tr (" panel.uninstall-success" )
118121 successMsg = successMsg .replace (" {plugin}" , pluginName)
119122 ToastService .showNotice (title, successMsg);
120123 } else {
121- var errorMsg = pluginApi? .tr (" panel.uninstall-error" ) ?? " "
122- errorMsg = errorMsg .replace (" {error}" , error || ( pluginApi? .tr (" panel.unknown-error" ) ?? " " ))
124+ var errorMsg = pluginApi .tr (" panel.uninstall-error" )
125+ errorMsg = errorMsg .replace (" {error}" , error || pluginApi .tr (" panel.unknown-error" ))
123126 ToastService .showError (title, errorMsg);
124127 }
125128 });
@@ -380,15 +383,16 @@ ColumnLayout {
380383 updates2[pid] = false ;
381384 rootRef .updatingPlugins = updates2;
382385
386+ if (! pluginApi) return ;
383387 if (success) {
384- var title = pluginApi? .tr (" panel.title" ) ?? " "
385- var msg = pluginApi? .tr (" panel.install-success" ) ?? " "
388+ var title = pluginApi .tr (" panel.title" )
389+ var msg = pluginApi .tr (" panel.install-success" )
386390 msg = msg .replace (" {plugin}" , pname)
387391 ToastService .showNotice (title, msg);
388392 } else {
389- var title2 = pluginApi? .tr (" panel.title" ) ?? " "
390- var errMsg = pluginApi? .tr (" panel.install-error" ) ?? " "
391- errMsg = errMsg .replace (" {error}" , error || ( pluginApi? .tr (" panel.unknown-error" ) ?? " " ))
393+ var title2 = pluginApi .tr (" panel.title" )
394+ var errMsg = pluginApi .tr (" panel.install-error" )
395+ errMsg = errMsg .replace (" {error}" , error || pluginApi .tr (" panel.unknown-error" ))
392396 ToastService .showError (title2, errMsg);
393397 }
394398 });
@@ -429,17 +433,17 @@ ColumnLayout {
429433 NText {
430434 text: {
431435 if (modelData .updateInfo ) {
432- return " v " + modelData .version + " -> v " + modelData .updateInfo .availableVersion
436+ return pluginApi ? . tr ( " panel.version-prefix " ) + modelData .version + " → " + pluginApi ? . tr ( " panel.version-prefix " ) + modelData .updateInfo .availableVersion
433437 }
434- return " v " + modelData .version ;
438+ return pluginApi ? . tr ( " panel.version-prefix " ) + modelData .version ;
435439 }
436440 font .pointSize : Style .fontSizeXS
437441 color: modelData .updateInfo ? Color .mPrimary : Color .mOnSurfaceVariant
438442 font .weight : modelData .updateInfo ? Style .fontWeightMedium : Style .fontWeightRegular
439443 }
440444
441445 NText {
442- text: " \u2022 "
446+ text: pluginApi ? . tr ( " panel.separator " )
443447 font .pointSize : Style .fontSizeXS
444448 color: Color .mOnSurfaceVariant
445449 }
0 commit comments