From b1d40cff89f7cff565a98cdbcea9a624196a169a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 4 Jun 2018 16:21:17 +0200 Subject: Add i18n attributes --- client/src/app/+admin/admin.component.html | 12 +- .../edit-custom-config.component.html | 140 ++++++++++++--------- .../edit-custom-config.component.ts | 28 +++-- .../followers-list/followers-list.component.html | 12 +- .../followers-list/followers-list.component.ts | 6 +- .../following-add/following-add.component.html | 6 +- .../following-add/following-add.component.ts | 22 ++-- .../following-list/following-list.component.html | 8 +- .../following-list/following-list.component.ts | 18 ++- .../src/app/+admin/follows/follows.component.html | 2 +- client/src/app/+admin/jobs/index.ts | 5 +- .../+admin/jobs/jobs-list/jobs-list.component.html | 12 +- .../+admin/jobs/jobs-list/jobs-list.component.ts | 6 +- client/src/app/+admin/users/shared/user.service.ts | 7 +- .../users/user-edit/user-create.component.ts | 21 ++-- .../users/user-edit/user-edit.component.html | 20 +-- .../users/user-edit/user-update.component.ts | 11 +- .../users/user-list/user-list.component.html | 14 +-- .../+admin/users/user-list/user-list.component.ts | 19 +-- .../video-abuse-list.component.html | 14 +-- .../video-abuse-list/video-abuse-list.component.ts | 6 +- .../video-blacklist-list.component.html | 16 +-- .../video-blacklist-list.component.ts | 23 ++-- 23 files changed, 240 insertions(+), 188 deletions(-) (limited to 'client/src/app/+admin') diff --git a/client/src/app/+admin/admin.component.html b/client/src/app/+admin/admin.component.html index e4644498b..1b2b89c3a 100644 --- a/client/src/app/+admin/admin.component.html +++ b/client/src/app/+admin/admin.component.html @@ -1,26 +1,26 @@
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 8a1e33c56..4263b7b5f 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html @@ -4,13 +4,13 @@ -
Instance
+
Instance
- +
{{ formErrors.instanceName }} @@ -18,10 +18,10 @@
- +
{{ formErrors.instanceShortDescription }} @@ -29,10 +29,10 @@
- +
{{ formErrors.instanceDescription }} @@ -40,10 +40,10 @@
- +
{{ formErrors.instanceTerms }} @@ -51,12 +51,12 @@
- +
@@ -65,14 +65,17 @@
- - + +
@@ -80,43 +83,43 @@
-
Signup
+
Signup
- +
- +
{{ formErrors.signupLimit }}
-
Administrator
+
Administrator
- +
{{ formErrors.adminEmail }}
-
Users
+
Users
- +
{{ formErrors.servicesTwitterUsername }} @@ -150,29 +156,32 @@ - - Instance whitelisted by Twitter + +Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on https://cards-dev.twitter.com/validator to see if you instance is whitelisted." + >
-
Transcoding
+
Transcoding
- +
- +
{{ formErrors.cachePreviewsSize }}
-
Customizations
+
Customizations
- - + +
{{ formErrors.customizationJavascript }} @@ -228,25 +243,26 @@ Check this checkbox, save the configuration and test with a video URL of your in
{{ formErrors.customizationCSS }} @@ -255,5 +271,5 @@ Check this checkbox, save the configuration and test with a video URL of your in - + diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index a1e334a74..3f9205460 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -8,12 +8,15 @@ import { FormReactive, USER_VIDEO_QUOTA } from '@app/shared' import { ADMIN_EMAIL, CACHE_PREVIEWS_SIZE, - INSTANCE_NAME, INSTANCE_SHORT_DESCRIPTION, SERVICES_TWITTER_USERNAME, + INSTANCE_NAME, + INSTANCE_SHORT_DESCRIPTION, + SERVICES_TWITTER_USERNAME, SIGNUP_LIMIT, TRANSCODING_THREADS } from '@app/shared/forms/form-validators/custom-config' import { NotificationsService } from 'angular2-notifications' import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-edit-custom-config', @@ -77,7 +80,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { private notificationsService: NotificationsService, private configService: ConfigService, private serverService: ServerService, - private confirmService: ConfirmService + private confirmService: ConfirmService, + private i18n: I18n ) { super() } @@ -133,7 +137,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { this.forceCheck() }, - err => this.notificationsService.error('Error', err.message) + err => this.notificationsService.error(this.i18n('Error'), err.message) ) } @@ -156,11 +160,15 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { if (customizations.length !== 0) { const customizationsText = customizations.join('/') - const message = `You set custom ${customizationsText}. ` + - 'This could lead to security issues or bugs if you do not understand it. ' + - 'Are you sure you want to update the configuration?' - const label = `Please type "I understand the ${customizationsText} I set" to confirm.` - const expectedInputValue = `I understand the ${customizationsText} I set` + // FIXME: i18n service does not support string concatenation + const message = this.i18n('You set custom {{ customizationsText }}. ', { customizationsText }) + + this.i18n('This could lead to security issues or bugs if you do not understand it. ') + + this.i18n('Are you sure you want to update the configuration?') + const label = this.i18n( + 'Please type "I understand the {{ customizationsText }} I set" to confirm.', + { customizationsText } + ) + const expectedInputValue = this.i18n('I understand the {{ customizationsText }} I set', { customizationsText}) const confirmRes = await this.confirmService.confirmWithInput(message, label, expectedInputValue) if (confirmRes === false) return @@ -223,10 +231,10 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { this.updateForm() - this.notificationsService.success('Success', 'Configuration updated.') + this.notificationsService.success(this.i18n('Success'), this.i18n('Configuration updated.')) }, - err => this.notificationsService.error('Error', err.message) + err => this.notificationsService.error(this.i18n('Error'), err.message) ) } diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.html b/client/src/app/+admin/follows/followers-list/followers-list.component.html index 85d2a2cf6..1a6ed616a 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.html +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.html @@ -4,12 +4,12 @@ > - ID - Score - Name - Host - State - Created + ID + Score + Name + Host + State + Created diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 69b3e5e58..96fb67588 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts @@ -5,6 +5,7 @@ import { SortMeta } from 'primeng/primeng' import { AccountFollow } from '../../../../../../shared/models/actors/follow.model' import { RestPagination, RestTable } from '../../../shared' import { FollowService } from '../shared' +import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ selector: 'my-followers-list', @@ -20,7 +21,8 @@ export class FollowersListComponent extends RestTable implements OnInit { constructor ( private notificationsService: NotificationsService, - private followService: FollowService + private followService: FollowService, + private i18n: I18n ) { super() } @@ -37,7 +39,7 @@ export class FollowersListComponent extends RestTable implements OnInit { this.totalRecords = resultList.total }, - err => this.notificationsService.error('Error', err.message) + err => this.notificationsService.error(this.i18n('Error'), err.message) ) } } diff --git a/client/src/app/+admin/follows/following-add/following-add.component.html b/client/src/app/+admin/follows/following-add/following-add.component.html index 25bab9d0d..72635048c 100644 --- a/client/src/app/+admin/follows/following-add/following-add.component.html +++ b/client/src/app/+admin/follows/following-add/following-add.component.html @@ -2,7 +2,7 @@
- +