Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

translate_selection

1.0.0 • Public • Published

translate_selection

translate and replace the selection words

Start

import TranslateSelection from "translate_selection";
const ts = new TranslateSelection();
ts.start();

You can also overwrite the getWords and getTranslate methods for your project

/**
 *
 * @param clonedFragment return from Range.cloneContents
 * @param textArr = [] the words get from the clonedFragment
 * @returns textArr
 */
function getWords(clonedFragment, textArr) : array
 
/**
 * 
 * @param arr this.selectedWords
 * @returns translatedWordArr
 */
function getTranslate(arr: array) : array

Keywords

Install

npm i translate_selection

DownloadsWeekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

10.9 kB

Total Files

4

Last publish

Collaborators

  • avatar