From bba3d617d2e348133d45ebc6641ef50bf8817d07 Mon Sep 17 00:00:00 2001 From: ReNeeter <69535871+reneeter123@users.noreply.github.com> Date: Wed, 12 May 2021 22:51:54 +0900 Subject: [PATCH] Fix translator script --- app/src/main/assets/translator.js | 19 ++++++++++--------- app/src/main/script/src/translator.ts | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/app/src/main/assets/translator.js b/app/src/main/assets/translator.js index cff6c3c..96ff28c 100644 --- a/app/src/main/assets/translator.js +++ b/app/src/main/assets/translator.js @@ -116,11 +116,11 @@ var HtmlToDatTranslator = /** @class */ (function (_super) { .replace(//g, 'sssp$1'); if (title !== null) { this.openDat(); - this.writeDat(mail + "<>" + name_1 + "<>" + date + "<>" + message + "<>" + title + "\n"); + this.writeDat(name_1 + "<>" + mail + "<>" + date + "<>" + message + "<>" + title + "\n"); title = null; } else { - this.writeDat(mail + "<>" + name_1 + "<>" + date + "<>" + message + "<>\n"); + this.writeDat(name_1 + "<>" + mail + "<>" + date + "<>" + message + "<>\n"); } } } @@ -147,11 +147,11 @@ var HtmlToDatTranslator = /** @class */ (function (_super) { .replace(//g, 'sssp:$1'); if (title !== null) { this.openDat(); - this.writeDat(mail + "<>" + name_2 + "<>" + date + "<>" + message + "<>" + title + "\n"); + this.writeDat(name_2 + "<>" + mail + "<>" + date + "<>" + message + "<>" + title + "\n"); title = null; } else { - this.writeDat(mail + "<>" + name_2 + "<>" + date + "<>" + message + "<>\n"); + this.writeDat(name_2 + "<>" + mail + "<>" + date + "<>" + message + "<>\n"); } } } @@ -178,11 +178,11 @@ var HtmlToDatTranslator = /** @class */ (function (_super) { .replace(//g, 'sssp:$1'); if (title !== null) { this.openDat(); - this.writeDat(mail + "<>" + name_3 + "<>" + date + "<>" + message + "<>" + title + "\n"); + this.writeDat(name_3 + "<>" + mail + "<>" + date + "<>" + message + "<>" + title + "\n"); title = null; } else { - this.writeDat(mail + "<>" + name_3 + "<>" + date + "<>" + message + "<>\n"); + this.writeDat(name_3 + "<>" + mail + "<>" + date + "<>" + message + "<>\n"); } } } @@ -209,11 +209,11 @@ var HtmlToDatTranslator = /** @class */ (function (_super) { .replace(//g, 'sssp$1'); if (title !== null) { this.openDat(); - this.writeDat(mail + "<>" + name_4 + "<>" + date + "<>" + message + "<>" + title + "\n"); + this.writeDat(name_4 + "<>" + mail + "<>" + date + "<>" + message + "<>" + title + "\n"); title = null; } else { - this.writeDat(mail + "<>" + name_4 + "<>" + date + "<>" + message + "<>\n"); + this.writeDat(name_4 + "<>" + mail + "<>" + date + "<>" + message + "<>\n"); } } } @@ -269,7 +269,8 @@ var ScToNetTranslator = /** @class */ (function (_super) { if (res.length < 4) break; res[0] = res[0] - .replace(/@\(^o^)//g, '@無断転載禁止'); + .replace(/アフィサイトへの\\(\^o\^\)/です/g, 'アフィサイトへの転載は禁止です') + .replace(/@\\(\^o\^\)//g, '@無断転載禁止'); res[2] = res[2] .replace(/]*>\?([^<]+)<\/a>/g, 'BE:$1-$2') .replace(/( ID:[^ .]+)($| )/g, '$1.sc$2') diff --git a/app/src/main/script/src/translator.ts b/app/src/main/script/src/translator.ts index 89e40cc..7cd2d92 100644 --- a/app/src/main/script/src/translator.ts +++ b/app/src/main/script/src/translator.ts @@ -109,11 +109,11 @@ class HtmlToDatTranslator extends Translator { .replace(//g, 'sssp$1'); if (title !== null) { this.openDat(); - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>${title}\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>${title}\n`); title = null; } else { - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>\n`); } } } @@ -140,11 +140,11 @@ class HtmlToDatTranslator extends Translator { .replace(//g, 'sssp:$1'); if (title !== null) { this.openDat(); - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>${title}\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>${title}\n`); title = null; } else { - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>\n`); } } } @@ -171,11 +171,11 @@ class HtmlToDatTranslator extends Translator { .replace(//g, 'sssp:$1'); if (title !== null) { this.openDat(); - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>${title}\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>${title}\n`); title = null; } else { - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>\n`); } } } @@ -202,11 +202,11 @@ class HtmlToDatTranslator extends Translator { .replace(//g, 'sssp$1'); if (title !== null) { this.openDat(); - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>${title}\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>${title}\n`); title = null; } else { - this.writeDat(`${mail}<>${name}<>${date}<>${message}<>\n`); + this.writeDat(`${name}<>${mail}<>${date}<>${message}<>\n`); } } } @@ -258,7 +258,8 @@ class ScToNetTranslator extends Translator { if (res.length < 4) break res[0] = res[0] - .replace(/@\(^o^)//g, '@無断転載禁止'); + .replace(/アフィサイトへの\\(\^o\^\)/です/g, 'アフィサイトへの転載は禁止です') + .replace(/@\\(\^o\^\)//g, '@無断転載禁止'); res[2] = res[2] .replace(/]*>\?([^<]+)<\/a>/g, 'BE:$1-$2') .replace(/( ID:[^ .]+)($| )/g, '$1.sc$2')