@goenhance/strapi-plugins-translate 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/index.js +27 -28
- package/dist/server/index.mjs +27 -28
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -1279,44 +1279,43 @@ const llmService = ({ strapi: strapi2 }) => ({
|
|
|
1279
1279
|
}
|
|
1280
1280
|
});
|
|
1281
1281
|
const buildPrompt = (fields, targetLanguage) => {
|
|
1282
|
-
return `
|
|
1282
|
+
return `
|
|
1283
|
+
You are a professional localization engine.
|
|
1283
1284
|
|
|
1284
|
-
|
|
1285
|
+
TARGET LANGUAGE:
|
|
1285
1286
|
${targetLanguage}
|
|
1286
1287
|
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
Do NOT auto-detect language.
|
|
1290
|
-
Do NOT change the target language.
|
|
1291
|
-
If the target language is Italian, output must be Italian.
|
|
1292
|
-
If it is French, output must be French.
|
|
1293
|
-
Follow exactly the language provided.
|
|
1288
|
+
MANDATORY RULE:
|
|
1289
|
+
ALL translated string values MUST be written strictly in ${targetLanguage}.
|
|
1294
1290
|
|
|
1295
|
-
|
|
1291
|
+
Mixed languages are NOT allowed.
|
|
1292
|
+
Partial translation is NOT allowed.
|
|
1293
|
+
Do NOT preserve source language fragments.
|
|
1294
|
+
|
|
1295
|
+
If any string is not fully in ${targetLanguage}, correct it before output.
|
|
1296
1296
|
|
|
1297
|
-
|
|
1297
|
+
---
|
|
1298
1298
|
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
7. Preserve URLs, code blocks, technical tokens, and system identifiers.
|
|
1307
|
-
8. Return ONLY valid JSON.
|
|
1308
|
-
9. Do NOT add explanations, comments, or extra text.
|
|
1299
|
+
STRUCTURE RULES:
|
|
1300
|
+
- Preserve JSON structure.
|
|
1301
|
+
- Only translate string values.
|
|
1302
|
+
- Do not modify keys.
|
|
1303
|
+
- Do not add or remove fields.
|
|
1304
|
+
- Preserve placeholders, html, markdown, urls.
|
|
1305
|
+
- Return valid JSON only.
|
|
1309
1306
|
|
|
1310
1307
|
---
|
|
1311
1308
|
|
|
1312
|
-
|
|
1313
|
-
Before
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1309
|
+
LANGUAGE VALIDATION CHECK:
|
|
1310
|
+
Before output:
|
|
1311
|
+
1. Scan all translated strings.
|
|
1312
|
+
2. Verify language consistency.
|
|
1313
|
+
3. Remove foreign-language fragments.
|
|
1314
|
+
4. Fix any untranslated content.
|
|
1317
1315
|
|
|
1318
|
-
SOURCE
|
|
1319
|
-
${JSON.stringify(fields, null, 2)}
|
|
1316
|
+
SOURCE:
|
|
1317
|
+
${JSON.stringify(fields, null, 2)}
|
|
1318
|
+
`;
|
|
1320
1319
|
};
|
|
1321
1320
|
const getUserConfig = async () => {
|
|
1322
1321
|
const pluginStore = strapi.store({
|
package/dist/server/index.mjs
CHANGED
|
@@ -1278,44 +1278,43 @@ const llmService = ({ strapi: strapi2 }) => ({
|
|
|
1278
1278
|
}
|
|
1279
1279
|
});
|
|
1280
1280
|
const buildPrompt = (fields, targetLanguage) => {
|
|
1281
|
-
return `
|
|
1281
|
+
return `
|
|
1282
|
+
You are a professional localization engine.
|
|
1282
1283
|
|
|
1283
|
-
|
|
1284
|
+
TARGET LANGUAGE:
|
|
1284
1285
|
${targetLanguage}
|
|
1285
1286
|
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
Do NOT auto-detect language.
|
|
1289
|
-
Do NOT change the target language.
|
|
1290
|
-
If the target language is Italian, output must be Italian.
|
|
1291
|
-
If it is French, output must be French.
|
|
1292
|
-
Follow exactly the language provided.
|
|
1287
|
+
MANDATORY RULE:
|
|
1288
|
+
ALL translated string values MUST be written strictly in ${targetLanguage}.
|
|
1293
1289
|
|
|
1294
|
-
|
|
1290
|
+
Mixed languages are NOT allowed.
|
|
1291
|
+
Partial translation is NOT allowed.
|
|
1292
|
+
Do NOT preserve source language fragments.
|
|
1293
|
+
|
|
1294
|
+
If any string is not fully in ${targetLanguage}, correct it before output.
|
|
1295
1295
|
|
|
1296
|
-
|
|
1296
|
+
---
|
|
1297
1297
|
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
7. Preserve URLs, code blocks, technical tokens, and system identifiers.
|
|
1306
|
-
8. Return ONLY valid JSON.
|
|
1307
|
-
9. Do NOT add explanations, comments, or extra text.
|
|
1298
|
+
STRUCTURE RULES:
|
|
1299
|
+
- Preserve JSON structure.
|
|
1300
|
+
- Only translate string values.
|
|
1301
|
+
- Do not modify keys.
|
|
1302
|
+
- Do not add or remove fields.
|
|
1303
|
+
- Preserve placeholders, html, markdown, urls.
|
|
1304
|
+
- Return valid JSON only.
|
|
1308
1305
|
|
|
1309
1306
|
---
|
|
1310
1307
|
|
|
1311
|
-
|
|
1312
|
-
Before
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1308
|
+
LANGUAGE VALIDATION CHECK:
|
|
1309
|
+
Before output:
|
|
1310
|
+
1. Scan all translated strings.
|
|
1311
|
+
2. Verify language consistency.
|
|
1312
|
+
3. Remove foreign-language fragments.
|
|
1313
|
+
4. Fix any untranslated content.
|
|
1316
1314
|
|
|
1317
|
-
SOURCE
|
|
1318
|
-
${JSON.stringify(fields, null, 2)}
|
|
1315
|
+
SOURCE:
|
|
1316
|
+
${JSON.stringify(fields, null, 2)}
|
|
1317
|
+
`;
|
|
1319
1318
|
};
|
|
1320
1319
|
const getUserConfig = async () => {
|
|
1321
1320
|
const pluginStore = strapi.store({
|
package/package.json
CHANGED