MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / setSrc

Method setSrc

src/main/translate-controller.ts:236–255  ·  view source on GitHub ↗
(append: string)

Source from the content-addressed store, hash-verified

234 }
235
236 setSrc(append: string) {
237 this.lastAppend = append;
238 const incremental = this.isIncremental;
239 if (incremental) {
240 eventBus.at("dispatch", "toast", "增量复制");
241 }
242 if (incremental && this.text != "") {
243 //TODO 这里需要做特殊处理,中文不需要加空格
244 if (isChinese(append)) {
245 this.text = this.text + append;
246 } else {
247 this.text = this.text + " " + append;
248 }
249 } else {
250 this.text = append;
251 }
252 if (this.incrementCounter > 0) {
253 this.handle("incrementCounter", this.incrementCounter - 1);
254 }
255 }
256
257 get source() {
258 return this.get<Language>("sourceLanguage");

Callers 1

preTranslateMethod · 0.95

Calls 2

handleMethod · 0.95
isChineseFunction · 0.90

Tested by

no test coverage detected