Having to do localization throughout the entire project. I have to change every text in the project from
<p> Home </p>
to
<p> {t("Home")} </p>
Is there a way to bind a shortcut, such that on the selection of Home
text and pressing the key binding with converting it to the required format.
Define the following keybinding:
{
"key": "ctrl+i l", // or other combo
"command": "editor.action.insertSnippet",
"when": "editorTextFocus",
"args": {
"snippet": "{t(\"$TM_SELECTED_TEXT\")}"
}
}