Created
October 20, 2023 19:23
-
-
Save Hobart2967/c96135684dedb61ae49183508b594eb2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import { MyState } from 'my-state.enum'; | |
| import { translations } from 'translations.de'; | |
| const state: MyState = getState(); | |
| assert(translations[state]); | |
| console.log(`Status: ${translations[state]}`); |
This file contains hidden or 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
| export enum MyState { | |
| Active, | |
| Inactive, | |
| Deleted | |
| } |
This file contains hidden or 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
| export translations = { | |
| [MyState.Active]: 'Aktiv', | |
| [MyState.Active]: 'Deaktiviert', | |
| [MyState.Active]: 'Entfernt', | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment