@goenhance/strapi-plugins-translate 1.1.0 → 1.1.1

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,18 +1279,41 @@ const llmService = ({ strapi: strapi2 }) => ({
1279
1279
  }
1280
1280
  });
1281
1281
  const buildPrompt = (fields, targetLanguage) => {
1282
- return `You are translating content from a CMS. Please translate the following JSON data to ${targetLanguage}.
1282
+ return `You are translating CMS content into a specified target language.
1283
1283
 
1284
- IMPORTANT RULES:
1285
- 1. Preserve all JSON structure and keys exactly as provided
1286
- 2. Only translate string values
1287
- 3. Maintain any markdown formatting within the text
1288
- 4. Keep HTML tags intact if present
1289
- 5. Preserve any special characters or placeholders
1290
- 6. Return ONLY the translated JSON object
1291
- 7. Ensure the JSON is valid and well-formed. Keep arrays and nested objects intact
1292
- 8. Do not add any explanations or comments
1293
- 9. Ensure professional and culturally appropriate translations
1284
+ Target Language:
1285
+ ${targetLanguage}
1286
+
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.
1294
+
1295
+ ---
1296
+
1297
+ TRANSLATION RULES:
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.
1309
+
1310
+ ---
1311
+
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
1294
1317
 
1295
1318
  SOURCE JSON:
1296
1319
  ${JSON.stringify(fields, null, 2)}`;
@@ -1278,18 +1278,41 @@ const llmService = ({ strapi: strapi2 }) => ({
1278
1278
  }
1279
1279
  });
1280
1280
  const buildPrompt = (fields, targetLanguage) => {
1281
- return `You are translating content from a CMS. Please translate the following JSON data to ${targetLanguage}.
1281
+ return `You are translating CMS content into a specified target language.
1282
1282
 
1283
- IMPORTANT RULES:
1284
- 1. Preserve all JSON structure and keys exactly as provided
1285
- 2. Only translate string values
1286
- 3. Maintain any markdown formatting within the text
1287
- 4. Keep HTML tags intact if present
1288
- 5. Preserve any special characters or placeholders
1289
- 6. Return ONLY the translated JSON object
1290
- 7. Ensure the JSON is valid and well-formed. Keep arrays and nested objects intact
1291
- 8. Do not add any explanations or comments
1292
- 9. Ensure professional and culturally appropriate translations
1283
+ Target Language:
1284
+ ${targetLanguage}
1285
+
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.
1293
+
1294
+ ---
1295
+
1296
+ TRANSLATION RULES:
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.
1308
+
1309
+ ---
1310
+
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
1293
1316
 
1294
1317
  SOURCE JSON:
1295
1318
  ${JSON.stringify(fields, null, 2)}`;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0",
2
+ "version": "1.1.1",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "plugin",