-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved i18n typing across libraries
- Loading branch information
1 parent
b7e5b33
commit 3facd7d
Showing
9 changed files
with
44 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import { FdLanguageKeyIdentifier } from '@fundamental-ngx/i18n'; | ||
|
||
export interface TimeColumnConfig { | ||
decreaseLabel: string; | ||
increaseLabel: string; | ||
label: string; | ||
navigationInstruction: string; | ||
decreaseLabel: FdLanguageKeyIdentifier; | ||
increaseLabel: FdLanguageKeyIdentifier; | ||
label: FdLanguageKeyIdentifier; | ||
navigationInstruction: FdLanguageKeyIdentifier; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
libs/platform/src/lib/smart-filter-bar/interfaces/smart-filter-bar-visibility-category.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
import { FdLanguage } from '@fundamental-ngx/i18n'; | ||
|
||
export type SmartFilterBarVisibilityCategory = 'all' | 'visible' | 'active' | 'visibleAndActive' | 'mandatory'; | ||
export type SmartFilterBarVisibilityCategoryLabels = { [key in SmartFilterBarVisibilityCategory]: string }; | ||
|
||
type SmartFilterBarCategoryLabelI18nKey = { | ||
[Key in keyof FdLanguage['platformSmartFilterBar']]: Key extends `settingsCategory${Capitalize<SmartFilterBarVisibilityCategory>}` | ||
? Key | ||
: never; | ||
}; | ||
|
||
export type SmartFilterBarVisibilityCategoryLabels = { | ||
[key in SmartFilterBarVisibilityCategory]: SmartFilterBarCategoryLabelI18nKey[`settingsCategory${Capitalize<key>}`]; | ||
}; |
10 changes: 9 additions & 1 deletion
10
libs/platform/src/lib/smart-filter-bar/interfaces/strategy-labels.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
import { FdLanguage } from '@fundamental-ngx/i18n'; | ||
import { FILTER_STRATEGY } from '@fundamental-ngx/platform/table'; | ||
|
||
type SmartFilterBarStrategy = (typeof FILTER_STRATEGY)[keyof typeof FILTER_STRATEGY]; | ||
|
||
type SmartFilterBarStrategyLabelI18nKey = { | ||
[Key in keyof FdLanguage['platformSmartFilterBar']]: Key extends `filterCondition${Capitalize<SmartFilterBarStrategy>}` | ||
? Key | ||
: never; | ||
}; | ||
export type SmartFilterBarStrategyLabels = { | ||
[key in (typeof FILTER_STRATEGY)[keyof typeof FILTER_STRATEGY]]: string; | ||
[key in SmartFilterBarStrategy]: SmartFilterBarStrategyLabelI18nKey[`filterCondition${Capitalize<key>}`]; | ||
}; |