File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,9 @@ export class Overridable {
135135/**
136136 * An object of strings, should follow the same format as src/i18n/en.json
137137 */
138- export type TranslationStrings = { [ key : string ] : string } ;
138+ export type TranslationStrings = {
139+ [ key : string ] : string | TranslationStrings ;
140+ } ;
139141
140142
141143/**
@@ -148,7 +150,7 @@ export type TranslationStrings = { [key: string]: string };
148150 */
149151@Injectable ( )
150152export class I18n {
151- protected translationStrings = EN ;
153+ protected translationStrings : TranslationStrings = EN ;
152154
153155 protected translations = new Map ( ) ;
154156
@@ -264,8 +266,8 @@ export class I18n {
264266 *
265267 * @param path looks like `"NOTIFICATION.CLOSE_BUTTON"`
266268 */
267- public getValueFromPath ( path ) : string | { [ key : string ] : string } {
268- let value = this . translationStrings ;
269+ public getValueFromPath ( path : string ) : string | TranslationStrings {
270+ let value : string | TranslationStrings = this . translationStrings ;
269271 for ( const segment of path . split ( "." ) ) {
270272 if ( value [ segment ] !== undefined && value [ segment ] !== null ) {
271273 value = value [ segment ] ;
You can’t perform that action at this time.
0 commit comments