Skip to content

useTranslation

Function
useTranslation(msg1?{}, msg2?{}, msg3?{}): (idstring, 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 
(idstring, values?any) => string
    function(idstring, 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.