]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/translations-manager.ts
Styling
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / translations-manager.ts
index d5a09a31a71bfc71ee8c4088533a0d66a27e7220..bf9c2d471a41e6273b00f4d59a82278619578134 100644 (file)
@@ -1,3 +1,4 @@
+import { logger } from '@root-helpers/logger'
 import { getCompleteLocale, getShortLocale, is18nLocale, isDefaultLocale } from '@shared/core-utils/i18n'
 
 export class TranslationsManager {
@@ -11,7 +12,7 @@ export class TranslationsManager {
     return fetch(path + '/server.json')
       .then(res => res.json())
       .catch(err => {
-        console.error('Cannot get server translations', err)
+        logger.error('Cannot get server translations', err)
         return undefined
       })
   }
@@ -23,17 +24,17 @@ export class TranslationsManager {
 
     let p: Promise<any>
 
-    if (TranslationsManager.videojsLocaleCache[ path ]) {
-      p = Promise.resolve(TranslationsManager.videojsLocaleCache[ path ])
+    if (TranslationsManager.videojsLocaleCache[path]) {
+      p = Promise.resolve(TranslationsManager.videojsLocaleCache[path])
     } else {
       p = fetch(path + '/player.json')
         .then(res => res.json())
         .then(json => {
-          TranslationsManager.videojsLocaleCache[ path ] = json
+          TranslationsManager.videojsLocaleCache[path] = json
           return json
         })
         .catch(err => {
-          console.error('Cannot get player translations', err)
+          logger.error('Cannot get player translations', err)
           return undefined
         })
     }