mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 22:24:11 +00:00
refactor: countdown view redesign
- allow selecting multiple events - follow selected - remove past events
This commit is contained in:
committed by
Carlos Valente
parent
93977ebc48
commit
b2b115c329
@@ -28,8 +28,10 @@ const translationsList = {
|
||||
zh: langZhCn,
|
||||
};
|
||||
|
||||
export type TranslationKey = keyof typeof langEn;
|
||||
|
||||
interface TranslationContextValue {
|
||||
getLocalizedString: (key: keyof typeof langEn, lang?: string) => string;
|
||||
getLocalizedString: (key: TranslationKey, lang?: string) => string;
|
||||
}
|
||||
|
||||
const TranslationContext = createContext<TranslationContextValue>({
|
||||
@@ -40,7 +42,7 @@ export const TranslationProvider = ({ children }: PropsWithChildren) => {
|
||||
const { data } = useSettings();
|
||||
|
||||
const getLocalizedString = useCallback(
|
||||
(key: keyof typeof langEn, lang = data?.language || 'en'): string => {
|
||||
(key: TranslationKey, lang = data?.language || 'en'): string => {
|
||||
if (lang in translationsList) {
|
||||
if (key in translationsList[lang as keyof typeof translationsList]) {
|
||||
return translationsList[lang as keyof typeof translationsList][key];
|
||||
|
||||
Reference in New Issue
Block a user