Fix some i18n tags
authorChocobozzz <me@florianbigard.com>
Fri, 28 Sep 2018 13:13:01 +0000 (15:13 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 28 Sep 2018 13:13:01 +0000 (15:13 +0200)
client/src/app/+admin/users/shared/user.service.ts
client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.html
client/src/app/+my-account/my-account-videos/my-account-videos.component.html
client/src/app/login/login.component.html
client/src/app/videos/+video-edit/shared/video-edit.component.html
client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.html

index a0e2f666d32a4891046cd6028e171f7d784ea4f9..470beef08cbfe42d1b9ff39b917db253ddb2c822 100644 (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
     })
index 8caff972f747b2370b2fce2fc4040ecab68a06b8..c542cc6759b34a020373952251955eea051f21e3 100644 (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>
\ No newline at end of file
index 276d01408f97d18a694d59eb936d73521314be81..a6911e4bf888fb8434ffd84d637e187b63a6e692 100644 (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)"
index 9105831933168528c34a88935d556a5afa11f189..93dbed525e22ac7cd3b0f340dfbb0afc852ac235 100644 (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>
 
index 46869268c28bfa20fed5cd46c1f264bd3da880de..33c766d87ca09852e69d138244dab4fe4cf74085 100644 (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>
index 2f0c9abb58933272d2eeaca05b5903a25b0d024f..a933a64f0df25c08a2312b345560a0a24fc8c2f5 100644 (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>