mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 18:33:53 +00:00
feat: add support for chinese
This commit is contained in:
committed by
Carlos Valente
parent
b489214004
commit
f3f4cdb19f
@@ -155,6 +155,7 @@ export default function GeneralPanelForm() {
|
||||
<option value='es'>Spanish</option>
|
||||
<option value='sv'>Swedish</option>
|
||||
<option value='pl'>Polish</option>
|
||||
<option value='zh'>Chinese (Simplified)</option>
|
||||
</Select>
|
||||
</Panel.ListItem>
|
||||
</Panel.ListGroup>
|
||||
|
||||
@@ -114,6 +114,7 @@ export default function QuickStart(props: QuickStartProps) {
|
||||
<option value='es'>Spanish</option>
|
||||
<option value='sv'>Swedish</option>
|
||||
<option value='pl'>Polish</option>
|
||||
<option value='zh'>Chinese (Simplified)</option>
|
||||
</Select>
|
||||
</Panel.ListItem>
|
||||
</Panel.ListGroup>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { TranslationObject } from './en';
|
||||
|
||||
export const langZhCn: TranslationObject = {
|
||||
'common.expected_finish': '预计完成',
|
||||
'common.minutes': '分钟',
|
||||
'common.now': '现在',
|
||||
'common.next': '接下来',
|
||||
'common.public_message': '公众消息',
|
||||
'common.scheduled_start': '计划开始',
|
||||
'common.scheduled_end': '计划结束',
|
||||
'common.projected_start': '预计开始',
|
||||
'common.projected_end': '预计结束',
|
||||
'common.stage_timer': '舞台计时器',
|
||||
'common.started_at': '开始于',
|
||||
'common.time_now': '当前时间',
|
||||
'countdown.ended': '事件结束于',
|
||||
'countdown.running': '事件进行中',
|
||||
'countdown.select_event': '选择要关注的事件',
|
||||
'countdown.to_start': '到开始时间',
|
||||
'countdown.waiting': '等待事件开始',
|
||||
'countdown.overtime': '超时了',
|
||||
'timeline.live': '当前进行',
|
||||
'timeline.done': '已结束',
|
||||
'timeline.due': '即将开始',
|
||||
'timeline.followedby': '随后是',
|
||||
};
|
||||
Reference in New Issue
Block a user