Auto-generated admin panel for node.js with react TranslateFunctions

Interface

TranslateFunctions

Members

TranslateFunction

# translateLabel

Translates all labels. Most of all all resource names are treated as labels.

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.

View Source adminjs/src/utils/translate-functions.factory.ts, line 101

TranslateFunction

# translateProperty

Translates all the property names.

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'
  }
}

View Source adminjs/src/utils/translate-functions.factory.ts, line 117

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>

View Source adminjs/src/utils/translate-functions.factory.ts, line 40