useTranslation

Function
useTranslation(msg1?: {}, msg2?: {}, msg3?: {}): (id: string, values?: any) => string

Returns a function to use Intl translation. If no message is passed in, the default message of jimu-core will be used

example:

Use dark colors for code blocksCopy
1
2
const translate = useTranslate(jimucoreMessages, widgetMessages)
translate('ok')

Parameters

ParameterType
msg1{}
msg2{}
msg3{}

Returns 

(id: string, values?: any) => string
  • function(id: string, values?: any): string
  • Parameters

    ParameterType
    idstring
    valuesany

    Returns 

    string

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.