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
| Parameter | Type | Description |
|---|---|---|
view | PmEditorView | The editor view that may contain a translate function |
text | string | The text to translate |
Returns
string
The translated text, or the original text if no translation function is available