1
0
Fork 0

Fix some i18n tags

This commit is contained in:
Chocobozzz 2018-09-28 15:13:01 +02:00
parent 01fe5bd721
commit baf0a8c98e
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
6 changed files with 14 additions and 6 deletions

View File

@ -4,7 +4,7 @@ import { Injectable } from '@angular/core'
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'
@ -81,7 +81,14 @@ export class UserService {
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
})

View File

@ -1,5 +1,5 @@
<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>

View File

@ -43,7 +43,7 @@
<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)"

View File

@ -48,7 +48,7 @@
</div>
</div>
<input type="submit" value="Login" [disabled]="!form.valid">
<input type="submit" i18n-value value="Login" [disabled]="!form.valid">
</form>
</div>

View File

@ -18,6 +18,7 @@
<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>

View File

@ -8,7 +8,7 @@
</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>