Skip to content

Instantly share code, notes, and snippets.

@Hobart2967
Created October 20, 2023 19:23
Show Gist options
  • Select an option

  • Save Hobart2967/c96135684dedb61ae49183508b594eb2 to your computer and use it in GitHub Desktop.

Select an option

Save Hobart2967/c96135684dedb61ae49183508b594eb2 to your computer and use it in GitHub Desktop.
import { MyState } from 'my-state.enum';
import { translations } from 'translations.de';
const state: MyState = getState();
assert(translations[state]);
console.log(`Status: ${translations[state]}`);
export enum MyState {
Active,
Inactive,
Deleted
}
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