diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-06 16:46:42 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-06 16:48:41 +0200 |
commit | 7ce44a74a3b052190cfacd4bd5ee6b92cfc620ac (patch) | |
tree | 6f178426c165f9136eb08354efa4a06c24725f87 /client/src/app/shared/video/video.model.ts | |
parent | f07d6385b4b46c3254898292a8a53ed415b8d49b (diff) | |
download | PeerTube-7ce44a74a3b052190cfacd4bd5ee6b92cfc620ac.tar.gz PeerTube-7ce44a74a3b052190cfacd4bd5ee6b92cfc620ac.tar.zst PeerTube-7ce44a74a3b052190cfacd4bd5ee6b92cfc620ac.zip |
Add server localization
Diffstat (limited to 'client/src/app/shared/video/video.model.ts')
-rw-r--r-- | client/src/app/shared/video/video.model.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index 48d562f9c..d37dc2c3e 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts | |||
@@ -5,6 +5,7 @@ import { VideoConstant } from '../../../../../shared/models/videos/video.model' | |||
5 | import { getAbsoluteAPIUrl } from '../misc/utils' | 5 | import { getAbsoluteAPIUrl } from '../misc/utils' |
6 | import { ServerConfig } from '../../../../../shared/models' | 6 | import { ServerConfig } from '../../../../../shared/models' |
7 | import { Actor } from '@app/shared/actor/actor.model' | 7 | import { Actor } from '@app/shared/actor/actor.model' |
8 | import { peertubeTranslate } from '@app/shared/i18n/i18n-utils' | ||
8 | 9 | ||
9 | export class Video implements VideoServerModel { | 10 | export class Video implements VideoServerModel { |
10 | by: string | 11 | by: string |
@@ -68,7 +69,7 @@ export class Video implements VideoServerModel { | |||
68 | minutes.toString() + ':' + secondsPadding + seconds.toString() | 69 | minutes.toString() + ':' + secondsPadding + seconds.toString() |
69 | } | 70 | } |
70 | 71 | ||
71 | constructor (hash: VideoServerModel) { | 72 | constructor (hash: VideoServerModel, translations = {}) { |
72 | const absoluteAPIUrl = getAbsoluteAPIUrl() | 73 | const absoluteAPIUrl = getAbsoluteAPIUrl() |
73 | 74 | ||
74 | this.createdAt = new Date(hash.createdAt.toString()) | 75 | this.createdAt = new Date(hash.createdAt.toString()) |
@@ -98,6 +99,11 @@ export class Video implements VideoServerModel { | |||
98 | 99 | ||
99 | this.by = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host) | 100 | this.by = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host) |
100 | this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) | 101 | this.accountAvatarUrl = Actor.GET_ACTOR_AVATAR_URL(this.account) |
102 | |||
103 | this.category.label = peertubeTranslate(this.category.label, translations) | ||
104 | this.licence.label = peertubeTranslate(this.licence.label, translations) | ||
105 | this.language.label = peertubeTranslate(this.language.label, translations) | ||
106 | this.privacy.label = peertubeTranslate(this.privacy.label, translations) | ||
101 | } | 107 | } |
102 | 108 | ||
103 | isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { | 109 | isVideoNSFWForUser (user: User, serverConfig: ServerConfig) { |