@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.
@@ -1279,44 +1279,43 @@ const llmService = ({ strapi: strapi2 }) => ({
1279
1279
  }
1280
1280
  });
1281
1281
  const buildPrompt = (fields, targetLanguage) => {
1282
- return `You are translating CMS content into a specified target language.
1282
+ return `
1283
+ You are a professional localization engine.
1283
1284
 
1284
- Target Language:
1285
+ TARGET LANGUAGE:
1285
1286
  ${targetLanguage}
1286
1287
 
1287
- IMPORTANT:
1288
- You MUST translate strictly into the specified target language.
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
- TRANSLATION RULES:
1297
+ ---
1298
1298
 
1299
- 1. Preserve the entire JSON structure and keys exactly as provided.
1300
- 2. Only translate string values.
1301
- 3. Do NOT modify keys, arrays, object structure, or data types.
1302
- 4. Preserve all markdown formatting inside text.
1303
- 5. Keep all HTML tags intact.
1304
- 6. Preserve placeholders like:
1305
- {{variable}}, {variable}, %s, %d
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
- Validation Step (Critical):
1313
- Before outputting, verify:
1314
- - All string values are written in ${targetLanguage}
1315
- - No mixed languages remain
1316
- - JSON structure is valid
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 JSON:
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({
@@ -1278,44 +1278,43 @@ const llmService = ({ strapi: strapi2 }) => ({
1278
1278
  }
1279
1279
  });
1280
1280
  const buildPrompt = (fields, targetLanguage) => {
1281
- return `You are translating CMS content into a specified target language.
1281
+ return `
1282
+ You are a professional localization engine.
1282
1283
 
1283
- Target Language:
1284
+ TARGET LANGUAGE:
1284
1285
  ${targetLanguage}
1285
1286
 
1286
- IMPORTANT:
1287
- You MUST translate strictly into the specified target language.
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
- TRANSLATION RULES:
1296
+ ---
1297
1297
 
1298
- 1. Preserve the entire JSON structure and keys exactly as provided.
1299
- 2. Only translate string values.
1300
- 3. Do NOT modify keys, arrays, object structure, or data types.
1301
- 4. Preserve all markdown formatting inside text.
1302
- 5. Keep all HTML tags intact.
1303
- 6. Preserve placeholders like:
1304
- {{variable}}, {variable}, %s, %d
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
- Validation Step (Critical):
1312
- Before outputting, verify:
1313
- - All string values are written in ${targetLanguage}
1314
- - No mixed languages remain
1315
- - JSON structure is valid
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 JSON:
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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.1",
2
+ "version": "1.1.2",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "plugin",