mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-12 20:43:08 +00:00
Move increment/decrement to i18n. Update to use "name".
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
(click)="toggleUp()">
|
(click)="toggleUp()">
|
||||||
<span class="chevron"></span>
|
<span class="chevron"></span>
|
||||||
<span class="sr-only">Increment {{placeholder}}</span>
|
<span class="sr-only">{{'form.number-picker.increment' | translate: {field: name} }}</span>
|
||||||
</button>
|
</button>
|
||||||
<input
|
<input
|
||||||
id="{{id}}"
|
id="{{id}}"
|
||||||
@@ -33,6 +33,6 @@
|
|||||||
[disabled]="disabled"
|
[disabled]="disabled"
|
||||||
(click)="toggleDown()">
|
(click)="toggleDown()">
|
||||||
<span class="chevron bottom"></span>
|
<span class="chevron bottom"></span>
|
||||||
<span class="sr-only">Decrement {{placeholder}}</span>
|
<span class="sr-only">{{'form.number-picker.decrement' | translate: {field: name} }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -7,6 +7,7 @@ import { By } from '@angular/platform-browser';
|
|||||||
import { NumberPickerComponent } from './number-picker.component';
|
import { NumberPickerComponent } from './number-picker.component';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { createTestComponent } from '../../testing/utils.test';
|
import { createTestComponent } from '../../testing/utils.test';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
|
||||||
describe('NumberPickerComponent test suite', () => {
|
describe('NumberPickerComponent test suite', () => {
|
||||||
|
|
||||||
@@ -23,7 +24,8 @@ describe('NumberPickerComponent test suite', () => {
|
|||||||
imports: [
|
imports: [
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
NgbModule
|
NgbModule,
|
||||||
|
TranslateModule.forRoot()
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
NumberPickerComponent,
|
NumberPickerComponent,
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core';
|
import { ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, SimpleChanges, } from '@angular/core';
|
||||||
import { ControlValueAccessor, UntypedFormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
import { ControlValueAccessor, UntypedFormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { isEmpty } from '../../empty.util';
|
import { isEmpty } from '../../empty.util';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -31,7 +32,9 @@ export class NumberPickerComponent implements OnInit, ControlValueAccessor {
|
|||||||
|
|
||||||
startValue: number;
|
startValue: number;
|
||||||
|
|
||||||
constructor(private fb: UntypedFormBuilder, private cd: ChangeDetectorRef) {
|
constructor(private fb: UntypedFormBuilder,
|
||||||
|
private cd: ChangeDetectorRef,
|
||||||
|
private translate: TranslateService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@@ -1770,6 +1770,10 @@
|
|||||||
|
|
||||||
"form.repeatable.sort.tip": "Drop the item in the new position",
|
"form.repeatable.sort.tip": "Drop the item in the new position",
|
||||||
|
|
||||||
|
"form.number-picker.decrement": "Decrement {{field}}",
|
||||||
|
|
||||||
|
"form.number-picker.increment": "Increment {{field}}",
|
||||||
|
|
||||||
"grant-deny-request-copy.deny": "Don't send copy",
|
"grant-deny-request-copy.deny": "Don't send copy",
|
||||||
|
|
||||||
"grant-deny-request-copy.email.back": "Back",
|
"grant-deny-request-copy.email.back": "Back",
|
||||||
|
Reference in New Issue
Block a user