Skip to content

Commit 26acfe6

Browse files
committed
LocaleHelper changes
1 parent afcfa1d commit 26acfe6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/common/utilities/LocalesHelper.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class LocalesHelper {
5353
10266: 'sr-Cyrl-RS',
5454
};
5555
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);
5757
if (pos > -1) {
5858
return parseInt(Object.keys(this.locales)[pos]);
5959
}
@@ -63,13 +63,7 @@ export class LocalesHelper {
6363
}
6464

6565
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] || '';
7367
}
7468

7569

0 commit comments

Comments
 (0)