File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export class LocalesHelper {
53
53
10266 : 'sr-Cyrl-RS' ,
54
54
} ;
55
55
public static getLocaleId ( localeName : string ) : number {
56
- const pos : number = ( Object as any ) . values ( this . locales ) . indexOf ( localeName ) ;
56
+ const pos : number = Object . keys ( this . locales ) . findIndex ( locKey => this . locales [ locKey ] === localeName ) ;
57
57
if ( pos > - 1 ) {
58
58
return parseInt ( Object . keys ( this . locales ) [ pos ] ) ;
59
59
}
@@ -63,13 +63,7 @@ export class LocalesHelper {
63
63
}
64
64
65
65
public static getLocaleName ( localeId : number ) : string {
66
- const pos : number = Object . keys ( this . locales ) . indexOf ( localeId . toString ( ) ) ;
67
- if ( pos > - 1 ) {
68
- return ( Object as any ) . values ( this . locales ) [ pos ] ;
69
- }
70
- else {
71
- return '' ;
72
- }
66
+ return this . locales [ localeId ] || '' ;
73
67
}
74
68
75
69
You can’t perform that action at this time.
0 commit comments