File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/components/common/i18n Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import {
22 getCurrentI18n ,
3+ getDisplayNamesFormatter ,
34 getI18nManager ,
45 type IResourceChangeEventArgs ,
56 type IResourceStrings ,
@@ -123,7 +124,10 @@ export class I18nController<T> implements ReactiveController {
123124 this . _defaultEN [ igcKey as keyof T ] ;
124125 }
125126 } else if ( coreKey ?. includes ( 'getWeekLabel' ) ) {
126- // Call core week label?
127+ const weekLabel = getDisplayNamesFormatter ( ) . getWeekLabel ( this . locale , {
128+ style : 'short' ,
129+ } ) ;
130+ normalizedResourceStrings [ igcKey as keyof T ] = weekLabel as T [ keyof T ] ;
127131 } else {
128132 // No mapped keys, no need to convert the resources then.
129133 return resourceStrings as T ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export function convertToIgcResource<T extends IResourceStrings>(inObject: T) {
6565 }
6666
6767 for ( const [ key , value ] of resourceMap ) {
68- if ( value && ! value . includes ( 'i18n/' ) ) {
68+ if ( value ) {
6969 result [ key ] = inObject [ value as keyof IResourceStrings ] ;
7070 }
7171 }
@@ -86,7 +86,7 @@ export function convertToCoreResource<T>(inObject: T): IResourceStrings {
8686
8787 if ( resourceMap ) {
8888 for ( const [ key , value ] of resourceMap ) {
89- if ( value && ! value . includes ( 'i18n/' ) ) {
89+ if ( value ) {
9090 result [ value as keyof IResourceStrings ] = inObject [
9191 key as keyof T
9292 ] as string ;
You can’t perform that action at this time.
0 commit comments