在猫头鹰日期时间选取器中,From和To标签以及Set和Cancel按钮未本地化。我用于指定区域设置的代码是:
constructor(
private dateTimeAdapter: DateTimeAdapter<any>
) {
dateTimeAdapter.setLocale(localStorage.getItem('localeId'));
}已尝试使用de、fr、zh

"ng-pick-datetime":"^7.0.0“
可能的问题是什么?
编辑:
为了进行测试,我尝试了:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SampleTableComponent } from './sample-table/sample-table.component';
import { MaterialModule } from './material.module';
import { MatFormComponent } from './mat-form/mat-form.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { OwlDateTimeModule, OwlNativeDateTimeModule, OwlDateTimeIntl } from 'ng-pick-datetime';
export class DefaultIntl extends OwlDateTimeIntl {
cancelBtnLabel: 'C';
setBtnLabel: 'S';
rangeFromLabel: 'F';
rangeToLabel: 'T';
}
@NgModule({
declarations: [
AppComponent,
SampleTableComponent,
MatFormComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MaterialModule,
OwlDateTimeModule,
OwlNativeDateTimeModule,
],
providers: [{provide: OwlDateTimeIntl, useClass: DefaultIntl}],
bootstrap: [AppComponent]
})
export class AppModule { }但我仍然在看从,到,设置,取消
发布于 2020-02-25 20:22:41
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
import { OWL_DATE_TIME_LOCALE } from 'ng-pick-datetime';
@NgModule({
imports: [ BrowserModule, BrowserAnimationsModule, FormsModule, OwlDateTimeModule, OwlNativeDateTimeModule ],
declarations: [ AppComponent, HelloComponent ],
bootstrap: [ AppComponent ],
providers: [
// use french locale
{provide: OWL_DATE_TIME_LOCALE, useValue: 'fr'},
]`enter code here`
})
export class AppModule { }
enter code herehttps://stackoverflow.com/questions/58320916
复制相似问题