diff options
Diffstat (limited to 'client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts')
-rw-r--r-- | client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts index af31f1144..1ffd001c6 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts | |||
@@ -4,7 +4,6 @@ import { ActivatedRoute, Router } from '@angular/router' | |||
4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | 4 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' |
5 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' | 5 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' |
6 | import { PluginService } from '@app/core/plugins/plugin.service' | 6 | import { PluginService } from '@app/core/plugins/plugin.service' |
7 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
8 | import { compareSemVer } from '@shared/core-utils/miscs/miscs' | 7 | import { compareSemVer } from '@shared/core-utils/miscs/miscs' |
9 | import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' | 8 | import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model' |
10 | import { PluginType } from '@shared/models/plugins/plugin.type' | 9 | import { PluginType } from '@shared/models/plugins/plugin.type' |
@@ -37,7 +36,6 @@ export class PluginListInstalledComponent implements OnInit { | |||
37 | onDataSubject = new Subject<any[]>() | 36 | onDataSubject = new Subject<any[]>() |
38 | 37 | ||
39 | constructor ( | 38 | constructor ( |
40 | private i18n: I18n, | ||
41 | private pluginService: PluginService, | 39 | private pluginService: PluginService, |
42 | private pluginApiService: PluginApiService, | 40 | private pluginApiService: PluginApiService, |
43 | private notifier: Notifier, | 41 | private notifier: Notifier, |
@@ -88,10 +86,10 @@ export class PluginListInstalledComponent implements OnInit { | |||
88 | 86 | ||
89 | getNoResultMessage () { | 87 | getNoResultMessage () { |
90 | if (this.pluginType === PluginType.PLUGIN) { | 88 | if (this.pluginType === PluginType.PLUGIN) { |
91 | return this.i18n("You don't have plugins installed yet.") | 89 | return $localize`You don't have plugins installed yet.` |
92 | } | 90 | } |
93 | 91 | ||
94 | return this.i18n("You don't have themes installed yet.") | 92 | return $localize`You don't have themes installed yet.` |
95 | } | 93 | } |
96 | 94 | ||
97 | isUpdateAvailable (plugin: PeerTubePlugin) { | 95 | isUpdateAvailable (plugin: PeerTubePlugin) { |
@@ -99,7 +97,7 @@ export class PluginListInstalledComponent implements OnInit { | |||
99 | } | 97 | } |
100 | 98 | ||
101 | getUpdateLabel (plugin: PeerTubePlugin) { | 99 | getUpdateLabel (plugin: PeerTubePlugin) { |
102 | return this.i18n('Update to {{version}}', { version: plugin.latestVersion }) | 100 | return $localize`Update to ${plugin.latestVersion}` |
103 | } | 101 | } |
104 | 102 | ||
105 | isUpdating (plugin: PeerTubePlugin) { | 103 | isUpdating (plugin: PeerTubePlugin) { |
@@ -108,15 +106,15 @@ export class PluginListInstalledComponent implements OnInit { | |||
108 | 106 | ||
109 | async uninstall (plugin: PeerTubePlugin) { | 107 | async uninstall (plugin: PeerTubePlugin) { |
110 | const res = await this.confirmService.confirm( | 108 | const res = await this.confirmService.confirm( |
111 | this.i18n('Do you really want to uninstall {{pluginName}}?', { pluginName: plugin.name }), | 109 | $localize`Do you really want to uninstall ${plugin.name}?`, |
112 | this.i18n('Uninstall') | 110 | $localize`Uninstall` |
113 | ) | 111 | ) |
114 | if (res === false) return | 112 | if (res === false) return |
115 | 113 | ||
116 | this.pluginApiService.uninstall(plugin.name, plugin.type) | 114 | this.pluginApiService.uninstall(plugin.name, plugin.type) |
117 | .subscribe( | 115 | .subscribe( |
118 | () => { | 116 | () => { |
119 | this.notifier.success(this.i18n('{{pluginName}} uninstalled.', { pluginName: plugin.name })) | 117 | this.notifier.success($localize`${plugin.name} uninstalled.`) |
120 | 118 | ||
121 | this.plugins = this.plugins.filter(p => p.name !== plugin.name) | 119 | this.plugins = this.plugins.filter(p => p.name !== plugin.name) |
122 | this.pagination.totalItems-- | 120 | this.pagination.totalItems-- |
@@ -138,7 +136,7 @@ export class PluginListInstalledComponent implements OnInit { | |||
138 | res => { | 136 | res => { |
139 | this.updating[updatingKey] = false | 137 | this.updating[updatingKey] = false |
140 | 138 | ||
141 | this.notifier.success(this.i18n('{{pluginName}} updated.', { pluginName: plugin.name })) | 139 | this.notifier.success($localize`${plugin.name} updated.`) |
142 | 140 | ||
143 | Object.assign(plugin, res) | 141 | Object.assign(plugin, res) |
144 | }, | 142 | }, |