]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/core/plugins/plugin.service.ts
Update translations
[github/Chocobozzz/PeerTube.git] / client / src / app / core / plugins / plugin.service.ts
index bb9125fe1ff2abfc107deaa511c99aff2c49e02f..bd8c61d9aa5135b0e38dfd3d646ebe0c728eeb5a 100644 (file)
@@ -11,6 +11,7 @@ import { ServerService } from '@app/core/server/server.service'
 import { getDevLocale, isOnDevLocale } from '@app/helpers'
 import { CustomModalComponent } from '@app/modal/custom-modal.component'
 import { PluginInfo, PluginsManager } from '@root-helpers/plugins-manager'
+import { getKeys } from '@shared/core-utils'
 import { getCompleteLocale, isDefaultLocale, peertubeTranslate } from '@shared/core-utils/i18n'
 import {
   ClientHook,
@@ -134,7 +135,7 @@ export class PluginService implements ClientHook {
   }
 
   async translateSetting (npmName: string, setting: RegisterClientFormFieldOptions) {
-    for (const key of [ 'label', 'html', 'descriptionHTML' ]) {
+    for (const key of getKeys(setting, [ 'label', 'html', 'descriptionHTML' ])) {
       if (setting[key]) setting[key] = await this.translateBy(npmName, setting[key])
     }
 
@@ -201,6 +202,11 @@ export class PluginService implements ClientHook {
         return environment.apiUrl + `${pathPrefix}/${plugin.name}/${plugin.version}/router`
       },
 
+      getBaseWebSocketRoute: () => {
+        const pathPrefix = PluginsManager.getPluginPathPrefix(pluginInfo.isTheme)
+        return environment.apiUrl + `${pathPrefix}/${plugin.name}/${plugin.version}/ws`
+      },
+
       getBasePluginClientPath: () => {
         return '/p'
       },
@@ -253,11 +259,11 @@ export class PluginService implements ClientHook {
 
       markdownRenderer: {
         textMarkdownToHTML: (textMarkdown: string) => {
-          return this.markdownRenderer.textMarkdownToHTML(textMarkdown)
+          return this.markdownRenderer.textMarkdownToHTML({ markdown: textMarkdown })
         },
 
         enhancedMarkdownToHTML: (enhancedMarkdown: string) => {
-          return this.markdownRenderer.enhancedMarkdownToHTML(enhancedMarkdown)
+          return this.markdownRenderer.enhancedMarkdownToHTML({ markdown: enhancedMarkdown })
         }
       },