Skip to content

Type Editor


Type Editor / @type-editor/menu / util/translate / translate

Function: translate()

ts
function translate(view, text): string;

Defined in: packages/menu/src/util/translate.ts:10

Translates a text string using the view's translation function if available.

Parameters

ParameterTypeDescription
viewPmEditorViewThe editor view that may contain a translate function
textstringThe text to translate

Returns

string

The translated text, or the original text if no translation function is available