import { BytesPipe } from 'ngx-pipes'
import { SortMeta } from 'primeng/components/common/sortmeta'
import { Observable } from 'rxjs'
-import { ResultList, UserCreate, UserUpdate, User } from '../../../../../../shared'
+import { ResultList, UserCreate, UserUpdate, User, UserRole } from '../../../../../../shared'
import { environment } from '../../../../environments/environment'
import { RestExtractor, RestPagination, RestService } from '../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0)
+ const roleLabels: { [ id in UserRole ]: string } = {
+ [UserRole.USER]: this.i18n('User'),
+ [UserRole.ADMINISTRATOR]: this.i18n('Administrator'),
+ [UserRole.MODERATOR]: this.i18n('Moderator')
+ }
+
return Object.assign(user, {
+ roleLabel: roleLabels[user.role],
videoQuota,
videoQuotaUsed
})
<div class="delete-me">
- <p>Once you delete your account, there is no going back. Please be certain.</p>
+ <p i18n>Once you delete your account, there is no going back. Please be certain.</p>
- <button (click)="deleteMe()">Delete your account</button>
+ <button (click)="deleteMe()" i18n>Delete your account</button>
</div>
\ No newline at end of file
<my-edit-button [routerLink]="[ '/videos', 'update', video.uuid ]"></my-edit-button>
- <my-button i18n label="Change ownership"
+ <my-button i18n-label label="Change ownership"
className="action-button-change-ownership"
icon="icon-im-with-her"
(click)="changeOwnership($event, video)"
<my-help i18n-preHtml preHtml="Tags could be used to suggest relevant recommendations.</br>Press Enter to add a new tag."></my-help>
<tag-input
[validators]="tagValidators" [errorMessages]="tagValidatorsMessages"
+ i18n-placeholder placeholder="+ Tag" i18n-secondaryPlaceholder secondaryPlaceholder="Enter a new tag"
formControlName="tags" maxItems="5" modelAsStrings="true"
></tag-input>
</div>
</div>
<span class="button-file-extension">(.torrent)</span>
- <div class="torrent-or-magnet">Or</div>
+ <div class="torrent-or-magnet" i18n>Or</div>
<div class="form-group form-group-magnet-uri">
<label i18n for="magnetUri">Paste magnet URI</label>