Skip to content

Commit 32b316e

Browse files
authored
Merge pull request IgniteUI#26 from IgniteUI/params-hint-localize
feat(params): allow params hint localization
2 parents ef1c43e + 978e76d commit 32b316e

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

components/render-component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { AttributeType } from '../utils/enums/json-keys';
77
import { Constants } from '../utils/constants';
88
import { RendererEvent } from 'typedoc/dist/lib/output/events';
99
import { Parser } from '../utils/parser';
10-
import { GlobalFuncs } from '../utils/global-funcs';
11-
import { HardcodedStrings } from '../utils/template-strings';
1210

1311
@Component({ name: 'render-component'})
1412
export class RenderComponenet extends RendererComponent {

components/theme-component.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ export class ThemeComponent extends RendererComponent {
4444
}
4545

4646
this.updateReflectionAbbreviation(reflection);
47-
}
47+
}
48+
49+
if (reflection.parameters && reflection.parameters.length) {
50+
reflection.parameters.forEach(e => {
51+
this.replaceParameterFlags(e);
52+
});
53+
}
4854
}
4955

5056
/**
@@ -65,6 +71,14 @@ export class ThemeComponent extends RendererComponent {
6571
});
6672
}
6773

74+
private replaceParameterFlags(param) {
75+
if (param.flags && param.flags.length) {
76+
param.flags.forEach((f, idx) => {
77+
param.flags[idx] = this.getLocaleValue(f);
78+
});
79+
}
80+
}
81+
6882
/**
6983
* Get template localized string from cached translations.
7084
* @param value

utils/global-funcs.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ export class GlobalFuncs {
99
}
1010

1111
public static getKeyValuePairRes(data, key, value) {
12-
if (!data) {
13-
return value;
14-
}
15-
16-
if (!data[key]) {
12+
if (!data && !data[key]) {
1713
return value;
1814
}
1915

0 commit comments

Comments
 (0)