mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2026-04-18 14:20:13 +00:00
cookie translate
This commit is contained in:
@@ -34,7 +34,7 @@ export const DEFAULT_LOCALE = DEFAULT_LOCALE_SETTING as Lang;
|
||||
* @example
|
||||
* { en: "Hello", ja: "こんにちは", ... }
|
||||
*/
|
||||
export type Multilingual = { [key in Lang]?: string };
|
||||
export type Multilingual = { [key in Lang]?: string | React.ReactNode };
|
||||
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ export type Multilingual = { [key in Lang]?: string };
|
||||
* @returns - The translation function
|
||||
*/
|
||||
export function useTranslations(lang: Lang) {
|
||||
return function t(multilingual: Multilingual | string): string {
|
||||
return function t(multilingual: Multilingual | string): string | React.ReactNode {
|
||||
if (typeof multilingual === "string") {
|
||||
return multilingual;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user