Spaces:
Paused
Paused
P01yH3dr0n
commited on
Commit
•
1bdaaf0
1
Parent(s):
1f2d4f1
translation tags
Browse files
tagcomplete/javascript/ext_chants.js
CHANGED
@@ -33,7 +33,7 @@ class ChantParser extends BaseTagParser {
|
|
33 |
async function load() {
|
34 |
if (TAC_CFG.chantFile && TAC_CFG.chantFile !== "None") {
|
35 |
try {
|
36 |
-
chants = await readFile(`${tagBasePath}/${TAC_CFG.chantFile}
|
37 |
} catch (e) {
|
38 |
console.error("Error loading chants.json: " + e);
|
39 |
}
|
|
|
33 |
async function load() {
|
34 |
if (TAC_CFG.chantFile && TAC_CFG.chantFile !== "None") {
|
35 |
try {
|
36 |
+
chants = await readFile(`${tagBasePath}/${TAC_CFG.chantFile}`, true);
|
37 |
} catch (e) {
|
38 |
console.error("Error loading chants.json: " + e);
|
39 |
}
|
tagcomplete/javascript/tagAutocomplete.js
CHANGED
@@ -156,6 +156,25 @@ async function loadExtraTags(c) {
|
|
156 |
}
|
157 |
}
|
158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
// Create the result list div and necessary styling
|
160 |
function createResultsDiv(textArea) {
|
161 |
let parentDiv = document.createElement("div");
|
@@ -1030,6 +1049,7 @@ async function run() {
|
|
1030 |
// Get our tag base path from the temp file
|
1031 |
// Rest of setup
|
1032 |
await loadTags(TAC_CFG);
|
|
|
1033 |
setup();
|
1034 |
tacLoading = false;
|
1035 |
-
}
|
|
|
156 |
}
|
157 |
}
|
158 |
|
159 |
+
async function loadTranslations(c) {
|
160 |
+
if (c.translation.translationFile && c.translation.translationFile !== "None") {
|
161 |
+
try {
|
162 |
+
let tArray = await loadCSV(`${tagBasePath}/${c.translation.translationFile}`);
|
163 |
+
tArray.forEach(t => {
|
164 |
+
if (c.translation.oldFormat && t[2]) // if 2 doesn't exist, it's probably a new format file and the setting is on by mistake
|
165 |
+
translations.set(t[0], t[2]);
|
166 |
+
else if (t[1])
|
167 |
+
translations.set(t[0], t[1]);
|
168 |
+
else
|
169 |
+
translations.set(t[0], "Not found");
|
170 |
+
});
|
171 |
+
} catch (e) {
|
172 |
+
console.error("Error loading translations file: " + e);
|
173 |
+
return;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
// Create the result list div and necessary styling
|
179 |
function createResultsDiv(textArea) {
|
180 |
let parentDiv = document.createElement("div");
|
|
|
1049 |
// Get our tag base path from the temp file
|
1050 |
// Rest of setup
|
1051 |
await loadTags(TAC_CFG);
|
1052 |
+
await loadTranslations(TAC_CFG);
|
1053 |
setup();
|
1054 |
tacLoading = false;
|
1055 |
+
}
|
tagcomplete/tags/demo-chants.json
CHANGED
@@ -28,11 +28,5 @@
|
|
28 |
"terms": "Water, Magic, Fancy",
|
29 |
"content": "(extremely detailed CG unity 8k wallpaper), (masterpiece), (best quality), (ultra-detailed), (best illustration),(best shadow), (an extremely delicate and beautiful), classic, dynamic angle, floating, fine detail, Depth of field, classic, (painting), (sketch), (bloom), (shine), glinting stars,\n\na girl, solo, bare shoulders, flat chest, diamond and glaring eyes, beautiful detailed cold face, very long blue and sliver hair, floating black feathers, wavy hair, extremely delicate and beautiful girls, beautiful detailed eyes, glowing eyes,\n\nriver, (forest),palace, (fairyland,feather,flowers, nature),(sunlight),Hazy fog, mist",
|
30 |
"color": 5
|
31 |
-
},
|
32 |
-
{
|
33 |
-
"name": "fangdongye cute",
|
34 |
-
"terms": "fangdongye, loli style",
|
35 |
-
"content": "[suimya, muririn], artist:ciloranko, [artist:sho_(sho_lwlw)], [[tianliang duohe fangdongye]], [eip (pepai)], [rukako], year 2023,",
|
36 |
-
"color": 5
|
37 |
}
|
38 |
]
|
|
|
28 |
"terms": "Water, Magic, Fancy",
|
29 |
"content": "(extremely detailed CG unity 8k wallpaper), (masterpiece), (best quality), (ultra-detailed), (best illustration),(best shadow), (an extremely delicate and beautiful), classic, dynamic angle, floating, fine detail, Depth of field, classic, (painting), (sketch), (bloom), (shine), glinting stars,\n\na girl, solo, bare shoulders, flat chest, diamond and glaring eyes, beautiful detailed cold face, very long blue and sliver hair, floating black feathers, wavy hair, extremely delicate and beautiful girls, beautiful detailed eyes, glowing eyes,\n\nriver, (forest),palace, (fairyland,feather,flowers, nature),(sunlight),Hazy fog, mist",
|
30 |
"color": 5
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
]
|