//Check if not wrapped stuff has less lines than the original cells and try to fix it
if (row[3] == undefined || row[3] == "" || row[3] == null) {
let row0noemptylines = trans.project.files[file].data[k][0].replaceAll(/[\n][\n]+/gmi, "");
row0noemptylines = row0noemptylines.replaceAll(/[\n]$/gmi, "");
let row0count = row0noemptylines.split(/\r\n|\r|\n/).length;
let row0lines = row0noemptylines.split(/\r\n|\r|\n/);
//For stuff in row 2 if there is stuff in row 2
if (row[2] != undefined && row[2] != "" && row[2] != null) {
let row2count = trans.project.files[file].data[k][2].split(/\r\n|\r|\n/).length;
if (row0count > row2count) {
let wrapattempt = trans.project.files[file].data[k][2];
//command stuff at the start of lines
if (row0noemptylines.match(/^[ ]*\\/gmi) != null && row0noemptylines.match(/^[ ]*\\.*[一-龠ぁ-ゔァ-ヴー々〆〤ヶレディファイッ]+.*\\/gmi) == null && row0noemptylines.match(/^[ ]*[^ \\]/gmi) == null) {
wrapattempt = wrapattempt.replaceAll(/[\r\n]+/gm, " ");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/g, "");
if (trans.project.files[file].data[k][0].match(/^[ ]*\\[\w_]\[[\w_]+\]/gmi) != null) {
let wraplinecounter = 0;
let wraplinecounter2 = 0;
let thingcounter = 1;
let wrapprogress = "";
let regexvar = '^()(.*?)\\\\';
while (wraplinecounter2 < row0count) {
wraplinecounter2 = wraplinecounter2 + 1;
let row0thingcount = row0lines[wraplinecounter].split(/\\[\w_]\[[\w_]+\]/).length;
wraplinecounter = wraplinecounter + 1;
while (thingcounter < row0thingcount) {
thingcounter = thingcounter + 1;
regexvar = regexvar.replaceAll(/(\)\(\.\*\?\))\\\\/gi, "[ ]*\\\\+[\\w_]+\\[[\\w_]+\\][^\\w\\n\\r]*$1\\\\");
}
thingcounter = 1;
wrapattempt = wrapattempt.replaceAll(new RegExp(regexvar, "gi"), "$1$2\n\\");
regexvar = '^()(.*?)\\\\';
let wrapattemptsplit = wrapattempt.split(/\r\n|\r|\n/);
if (wrapattempt.match(/\n/gim) != null) {
wrapprogress = wrapprogress + "\n" + wrapattemptsplit[0];
wrapattempt = wrapattemptsplit[1];
}
else {
wrapprogress = wrapprogress + "\n" + wrapattempt;
}
}
wrapprogress = wrapprogress.replaceAll(/^\s+/g, "");
wrapattempt = wrapprogress;
}
else if (trans.project.files[file].data[k][0].match(/^[ ]*\\[a-z]+[ ]*[一-龠ぁ-ゔァ-ヴー々〆〤ヶレディファイッ]/gmi) != null) {
wrapattempt = wrapattempt.replaceAll(/(\\[a-z])/gi, "\n$1");
}
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
wrapattempt = wrapattempt.replaceAll(/^\n/g, "");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
}
//Single variables at the end of lines
else if (row0noemptylines.match(/\\v\[\d+\][ 回mlkgkgGGml$%$%#€]*$/gmi) != null && row0noemptylines.match(/\\v\[\d+\].*\\v\[\d+\]/gmi) == null && row0noemptylines.match(/[^v\\\[\] 回mlkgkgGGml$%$%#€]+$/gmi) == null) {
wrapattempt = wrapattempt.replaceAll(/[\r\n]+/gm, " ");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/g, "");
wrapattempt = wrapattempt.replaceAll(/((?:\\v\[\d+\][ ]*ct)|(?:\\v\[\d+\][ ]*ml)|(?:\\v\[\d+\][ ]*$)|(?:\\v\[\d+\][ ]*kg)|(?:\\v\[\d+\][ ]*g)|(?:\\v\[\d+\][ ]*G)|(?:\\v\[\d+\][ ]*$)|(?:\\v\[\d+\][ ]*€)|(?:\\v\[\d+\][ ]*%)|(?:\\v\[\d+\][ ]*回)|(?:\\v\[\d+\][ ]*%)|(?:\\v\[\d+\][ ]*G)|(?:\\v\[\d+\][ ]*ml)|(?:\\v\[\d+\][ ]*g)|(?:\\v\[\d+\][ ]*kg)|(?:\\v\[\d+\][ ]*(?=[^ 回mlkgkgGGml$%$%#€])))/gm, "\n$1");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
wrapattempt = wrapattempt.replaceAll(/^\n/g, "");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
}
if (row0count == wrapattempt.split(/\r\n|\r|\n/).length) {
trans.project.files[file].data[k][3] = wrapattempt;
}
}
}
//For stuff in row 1 if there is stuff in row 1 and nothing in row 2
else if (row[1] != undefined && row[1] != "" && row[1] != null) {
let row1count = trans.project.files[file].data[k][1].split(/\r\n|\r|\n/).length;
if (row0count > row1count) {
let wrapattempt = trans.project.files[file].data[k][1];
//command stuff at the start of lines
if (row0noemptylines.match(/^[ ]*\\/gmi) != null && row0noemptylines.match(/^[ ]*\\.*[一-龠ぁ-ゔァ-ヴー々〆〤ヶレディファイッ]+.*\\/gmi) == null && row0noemptylines.match(/^[ ]*[^ \\]/gmi) == null) {
wrapattempt = wrapattempt.replaceAll(/[\r\n]+/gm, " ");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/g, "");
if (trans.project.files[file].data[k][0].match(/^[ ]*\\[\w_]\[[\w_]+\]/gmi) != null) {
let wraplinecounter = 0;
let wraplinecounter2 = 0;
let thingcounter = 1;
let wrapprogress = "";
let regexvar = '^()(.*?)\\\\';
while (wraplinecounter2 < row0count) {
wraplinecounter2 = wraplinecounter2 + 1;
let row0thingcount = row0lines[wraplinecounter].split(/\\[\w_]\[[\w_]+\]/).length;
wraplinecounter = wraplinecounter + 1;
while (thingcounter < row0thingcount) {
thingcounter = thingcounter + 1;
regexvar = regexvar.replaceAll(/(\)\(\.\*\?\))\\\\/gi, "[ ]*\\\\+[\\w_]+\\[[\\w_]+\\][^\\w\\n\\r]*$1\\\\");
}
thingcounter = 1;
wrapattempt = wrapattempt.replaceAll(new RegExp(regexvar, "gi"), "$1$2\n\\");
regexvar = '^()(.*?)\\\\';
let wrapattemptsplit = wrapattempt.split(/\r\n|\r|\n/);
if (wrapattempt.match(/\n/gim) != null) {
wrapprogress = wrapprogress + "\n" + wrapattemptsplit[0];
wrapattempt = wrapattemptsplit[1];
}
else {
wrapprogress = wrapprogress + "\n" + wrapattempt;
}
}
wrapprogress = wrapprogress.replaceAll(/^\s+/g, "");
wrapattempt = wrapprogress;
}
else if (trans.project.files[file].data[k][0].match(/^[ ]*\\[a-z]+[ ]*[一-龠ぁ-ゔァ-ヴー々〆〤ヶレディファイッ]/gmi) != null) {
wrapattempt = wrapattempt.replaceAll(/(\\[a-z])/gi, "\n$1");
}
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
wrapattempt = wrapattempt.replaceAll(/^\n/g, "");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
}
//Single variables at the end of lines
else if (row0noemptylines.match(/\\v\[\d+\][ 回mlkgkgGGml$%$%#€]*$/gmi) != null && row0noemptylines.match(/\\v\[\d+\].*\\v\[\d+\]/gmi) == null && row0noemptylines.match(/[^v\\\[\] 回mlkgkgGGml$%$%#€]+$/gmi) == null) {
wrapattempt = wrapattempt.replaceAll(/[\r\n]+/gm, " ");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/g, "");
wrapattempt = wrapattempt.replaceAll(/((?:\\v\[\d+\][ ]*ct)|(?:\\v\[\d+\][ ]*ml)|(?:\\v\[\d+\][ ]*$)|(?:\\v\[\d+\][ ]*kg)|(?:\\v\[\d+\][ ]*g)|(?:\\v\[\d+\][ ]*G)|(?:\\v\[\d+\][ ]*$)|(?:\\v\[\d+\][ ]*€)|(?:\\v\[\d+\][ ]*%)|(?:\\v\[\d+\][ ]*回)|(?:\\v\[\d+\][ ]*%)|(?:\\v\[\d+\][ ]*G)|(?:\\v\[\d+\][ ]*ml)|(?:\\v\[\d+\][ ]*g)|(?:\\v\[\d+\][ ]*kg)|(?:\\v\[\d+\][ ]*(?=[^ 回mlkgkgGGml$%$%#€])))/gm, "\n$1");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
wrapattempt = wrapattempt.replaceAll(/^\n/g, "");
wrapattempt = wrapattempt.replaceAll(/^[ ]+/gm, "");
}
if (row0count == wrapattempt.split(/\r\n|\r|\n/).length) {
trans.project.files[file].data[k][3] = wrapattempt;
}
}
}
}
TEXTTEXT\C[12]COLOREDTEXT\C[0]TEXTTEXT
also about these indigo cells that you say we can process them independently, in what way do we process them? i don't understand"Indigo" is basically just dark purple, since this is pretty similar to the purple tagging, but you can search and process them independent from one another.
SLR Translator isn't just meant as a MTool replacement, but allow the creation of higher quality edited MTLs.I trust your idea, but if that thing doesn't work out in the end, in my opinion i wouldn't mind getting rid of the color altogether as in make the whole sentence default color, no custom colored words, as in fuck it
A small price to pay for a better translation, but that's just the opinion of one man
That is just meant for someone who wants to manually review them as to whether or not they need fixing. For a quick MTL you can completely ignore that they exist. They are much less likely to be relevant than the purple ones.also about these indigo cells that you say we can process them independently, in what way do we process them? i don't understand
like process them how or what do we do
Since it's happening during the translation it neither gets an error code nor a special color atm, I do not have tagging/inserting functionality implemented during the translation phase at the moment. (That would actually be harder to do than it sounds.)Let's say a sentence is supposed to be [You should head north through the forest to find the witch's hut].
As a player, I prefer [You should head north through the forest to find the witch's hut.] since that let's me know that something in that sentence was important (probably north, forest, witch's hut, or some combination of them) and the dev cares enough about the player experience to try to help us not spend an hour wandering aimlessly since we didn't pay attention to npcs.
As a translator, I prefer [You should head north through the forest to find the witch's hut.LOSTCOLORCODEerror.], since I certainly don't mind running a search to find all the affected cells and manually editing them. Then again, if the search returns 1013 affected cells, I also don't mind using a find-and-replace of [LOSTCOLORCODEerror.] for []. The first method is probably the best all-around since I know I'm a poor metric for what the average user wants to do. In any case, I consider both of those options (a half-colored sentence, or giving the translator the option to simply delete all color codes) preferable to something like [Let's go. North. The witch's hut is in the forest.].
The issue is that the dictionary system and the post fixes of SLR are English or designed for English, so while you could technically add any Translator++ addon to SLR Translator, it would have to use Dreamsavior's batch translator and Escaper, meaning there would not be script protection or error detection. You would likely just end up with a broken mess.Hello
Can you try to add Baidu Web addon to SLR ?
It works really well in translating game to my native language
View attachment 4298130
Do you know how to auto delete translation data in the red/blue tag rows ?The issue is that the dictionary system and the post fixes of SLR are English or designed for English, so while you could technically add any Translator++ addon to SLR Translator, it would have to use Dreamsavior's batch translator and Escaper, meaning there would not be script protection or error detection. You would likely just end up with a broken mess.
I would have to make a completely new engine wrapper and post process specifically for the new target language or there wouldn't be much difference to just using Translator++ instead, but that would take a long time and for that to actually have a decent result I would need to be fluent in that language.
I'm sorry, but I do not think that fits the current scope and (not existent) funding of the SLR project.
I'm not sure what you are talking about.Do you know how to auto delete translation data in the red/blue tag rows ?
Some games have many red tag row(almost hundreds of row) after translated so if I delete manually it will take so much time
Um wellI'm not sure what you are talking about.
If you follow the standard procedure red and blue cells will never be translated in the first place.
Using standard settings the batch translator does not translate cells tagged red, blue, dark red, cyan, yellow, gold, or gray.
Just make sure you did not remove them from the Blacklist.
I'm sorry, but like I said before, SLR Translator is not meant for translations to languages other than English, and I currently have no plans to change that. The SLR project neither has any funding, nor can I speak any other languages worth adding.Um well
I run batch translate Sword Art Online: The Trap of Breath Concealed Magic by google
The game ran well
But after plenty of playing time,i got this error
View attachment 4322255
I think somewhere in translated data conflict with the raw one
Do you know how to search for the destination of the error ?
Oh i fixed itI'm sorry, but like I said before, SLR Translator is not meant for translations to languages other than English, and I currently have no plans to change that. The SLR project neither has any funding, nor can I speak any other languages worth adding.