diff options
author | Chocobozzz <me@florianbigard.com> | 2020-08-12 10:40:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-08-14 10:28:30 +0200 |
commit | 66357162f8e1227495f09bd4f68446aad7071c6d (patch) | |
tree | 7d4429506deb512b2fe1d0267f38a28cda20af55 /client/src/app/shared/shared-forms/select | |
parent | 8c360747995e17eb5520e22fc3d7bd4c3d26eeee (diff) | |
download | PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.gz PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.tar.zst PeerTube-66357162f8e1227495f09bd4f68446aad7071c6d.zip |
Migrate to $localize
* Remove i18n polyfill to translate things in components
* Reduce bundle sizes
* Improve runtime perf
* Reduce a lot the time to make a full client build
* Reduce client build complexity
* We don't need a service to translate things anymore (so we will be able to translate title pages etc)
Unfortunately we may loose some translations in the migration process.
I'll put a message on weblate to notify translators
Diffstat (limited to 'client/src/app/shared/shared-forms/select')
-rw-r--r-- | client/src/app/shared/shared-forms/select/select-checkbox.component.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/client/src/app/shared/shared-forms/select/select-checkbox.component.ts b/client/src/app/shared/shared-forms/select/select-checkbox.component.ts index fd683ae5d..eb0c49034 100644 --- a/client/src/app/shared/shared-forms/select/select-checkbox.component.ts +++ b/client/src/app/shared/shared-forms/select/select-checkbox.component.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import { Component, Input, forwardRef, OnInit } from '@angular/core' | 1 | import { Component, forwardRef, Input, OnInit } from '@angular/core' |
2 | import { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms' | 2 | import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' |
3 | import { SelectOptionsItem } from './select-options.component' | 3 | import { SelectOptionsItem } from './select-options.component' |
4 | import { I18n } from '@ngx-translate/i18n-polyfill' | ||
5 | 4 | ||
6 | export type ItemSelectCheckboxValue = { id?: string | number, group?: string } | string | 5 | export type ItemSelectCheckboxValue = { id?: string | number, group?: string } | string |
7 | 6 | ||
@@ -25,12 +24,8 @@ export class SelectCheckboxComponent implements OnInit, ControlValueAccessor { | |||
25 | @Input() maxSelectedItems: number | 24 | @Input() maxSelectedItems: number |
26 | @Input() placeholder: string | 25 | @Input() placeholder: string |
27 | 26 | ||
28 | constructor ( | ||
29 | private i18n: I18n | ||
30 | ) {} | ||
31 | |||
32 | ngOnInit () { | 27 | ngOnInit () { |
33 | if (!this.placeholder) this.placeholder = this.i18n('Add a new option') | 28 | if (!this.placeholder) this.placeholder = $localize`Add a new option` |
34 | } | 29 | } |
35 | 30 | ||
36 | propagateChange = (_: any) => { /* empty */ } | 31 | propagateChange = (_: any) => { /* empty */ } |