When using the Owl Date Time Picker, I noticed that the From and To labels, as well as the Set and Cancel buttons are not being localized. Here is the code snippet I am using to specify the locale:
constructor(
private dateTimeAdapter: DateTimeAdapter<any>
) {
dateTimeAdapter.setLocale(localStorage.getItem('localeId'));
}
I have tried with locales such as de, fr, and zh.
https://i.sstatic.net/ffCTC.png
The version of "ng-pick-datetime" I am using is "^7.0.0"
Any idea what could be causing this issue?
Edit:
In an attempt to troubleshoot, I experimented with the following code:
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 { }
However, even after implementing this code, I am still encountering the issue where the labels remain as From, To, Set, and Cancel.