mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-24 16:39:13 +00:00
feat: add support for chinese
This commit is contained in:
committed by
Carlos Valente
parent
b489214004
commit
f3f4cdb19f
@@ -12,6 +12,7 @@ import { langNo } from './languages/no';
|
||||
import { langPl } from './languages/pl';
|
||||
import { langPt } from './languages/pt';
|
||||
import { langSv } from './languages/sv';
|
||||
import { langZhCn } from './languages/zh';
|
||||
|
||||
const translationsList = {
|
||||
en: langEn,
|
||||
@@ -24,6 +25,7 @@ const translationsList = {
|
||||
pt: langPt,
|
||||
sv: langSv,
|
||||
pl: langPl,
|
||||
zh: langZhCn,
|
||||
};
|
||||
|
||||
interface TranslationContextValue {
|
||||
@@ -37,6 +39,8 @@ export const TranslationContext = createContext<TranslationContextValue>({
|
||||
export const TranslationProvider = ({ children }: PropsWithChildren) => {
|
||||
const { data } = useSettings();
|
||||
|
||||
console.log('....', data.language)
|
||||
|
||||
const getLocalizedString = useCallback(
|
||||
(key: keyof typeof langEn, lang = data?.language || 'en'): string => {
|
||||
if (lang in translationsList) {
|
||||
|
||||
Reference in New Issue
Block a user