diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-09 13:21:33 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-09 13:23:25 +0200 |
commit | c713017f3cd2d617da22c24c579342ec4121cfcd (patch) | |
tree | 4f23d24442a177f5e71e7b2c9e66b5cd5fba121c /client/src/app/+admin/plugins/shared/plugin-api.service.ts | |
parent | 32d13b203b3abf756e751994836c28ddd1f4ebd9 (diff) | |
download | PeerTube-c713017f3cd2d617da22c24c579342ec4121cfcd.tar.gz PeerTube-c713017f3cd2d617da22c24c579342ec4121cfcd.tar.zst PeerTube-c713017f3cd2d617da22c24c579342ec4121cfcd.zip |
Translate plugin options
Diffstat (limited to 'client/src/app/+admin/plugins/shared/plugin-api.service.ts')
-rw-r--r-- | client/src/app/+admin/plugins/shared/plugin-api.service.ts | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts index fad30576b..d91fccc09 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts | |||
@@ -94,7 +94,6 @@ export class PluginApiService { | |||
94 | 94 | ||
95 | return this.authHttp.get<RegisteredServerSettings>(path) | 95 | return this.authHttp.get<RegisteredServerSettings>(path) |
96 | .pipe( | 96 | .pipe( |
97 | switchMap(res => this.translateSettingsLabel(npmName, res)), | ||
98 | catchError(res => this.restExtractor.handleError(res)) | 97 | catchError(res => this.restExtractor.handleError(res)) |
99 | ) | 98 | ) |
100 | } | 99 | } |
@@ -141,19 +140,4 @@ export class PluginApiService { | |||
141 | 140 | ||
142 | return `https://www.npmjs.com/package/peertube-${typeString}-${name}` | 141 | return `https://www.npmjs.com/package/peertube-${typeString}-${name}` |
143 | } | 142 | } |
144 | |||
145 | private translateSettingsLabel (npmName: string, res: RegisteredServerSettings): Observable<RegisteredServerSettings> { | ||
146 | return this.pluginService.translationsObservable | ||
147 | .pipe( | ||
148 | map(allTranslations => allTranslations[npmName]), | ||
149 | map(translations => { | ||
150 | const registeredSettings = res.registeredSettings | ||
151 | .map(r => { | ||
152 | return Object.assign({}, r, { label: peertubeTranslate(r.label, translations) }) | ||
153 | }) | ||
154 | |||
155 | return { registeredSettings } | ||
156 | }) | ||
157 | ) | ||
158 | } | ||
159 | } | 143 | } |