your application.
On the fronted they can be used with useTranslation hook. On the backend they are injected to any AdminJS instance and ActionContext.
Members
TranslateFunction
# translateAction
By default, it looks for a translation key in
resource.{resourceId}.actions.{actionName}
, when it doesn't find
that, the lookup is moved to actions.{actionName}
.
Finally, when that also fails, it returns startCase of the action name.
TranslateFunction
# translateButton
By default, it looks for a translation key in
resource.{resourceId}.buttons.{actionName}
, when it doesn't find
that, the lookup is moved to buttons.{actionName}
.
Finally, when that also fails, it returns startCase of the given button name.
TranslateFunction
# translateLabel
Also, labels are texts in the user interface which cannot be recognized
as any other type.
By default, it looks for a translation key in
resource.{resourceId}.labels.{actionName}
, when it doesn't find
that, the lookup is moved to labels.{actionName}
.
Finally, when that also fails, it returns startCase of the given label.
TranslateFunction
# translateMessage
By default, it looks for a translation key in
resource.{resourceId}.messages.{messageName}
, when it doesn't find
that, the lookup is moved to messages.{messageName}
.
Finally, when that also fails, it returns startCase of the given message name.
TranslateFunction
# translateProperty
By default, it looks for a translation key in
resource.{resourceId}.properties.{propertyPath}
, when it doesn't find
that, the lookup is moved to properties.{propertyPath}
. When that fails,
it returns startCase of the given property name.
What is important here is that you can put nested property as well, In that case you have to pass dotted path:
{
properties: {
parent: 'parent property',
'parent.nested': 'nested property'
}
}
Type Definitions
# TranslateFunction(key, resourceIdopt, optionsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string
|
kwy which should be translated in a given namespace |
|
resourceId |
string
|
TOptions
|
<optional> |
Optional resourceId or [Translate options]://www.i18next.com/overview/configuration-options |
options |
TOptions
|
<optional> |