Resolve #3457200 "Ai translations submodule"
Closes #3457200
Merge request reports
Activity
added 1 commit
- 6914f1f4 - 3457200: Remove mentions of node as hard-coded entity type
- Resolved by Marcus Johansson
- Resolved by Marcus Johansson
- Resolved by Marcus Johansson
214 * Adding the translation in database and linking it to the original entity. 215 * 216 * @param \Drupal\Core\Entity\ContentEntityInterface $entity 217 * The entity object. 218 * @param string $target_language 219 * The target language. 220 * @param array $bundleFields 221 * An array of field name and their translation. 222 */ 223 public function insertTranslation( 224 ContentEntityInterface $entity, 225 string $target_language, 226 array $bundleFields, 227 ) { 228 if ($entity->hasTranslation($target_language)) { 229 return; - Resolved by Marcus Johansson
- Resolved by Marcus Johansson
- Resolved by Marcus Johansson
I checked the code and gave some suggestions - the thing that should change is that the formatted text can't have upcasted text format, that could lead to security issues.
The rest are recommendations, but the current prompt does not give me good results, I got this as title for instance: Sure! The translation of "test" to Swedish is "test"
The prompt should also be base prompt injection proofed.
1 ai_translate.translate_content: 2 path: '/ai_translate/translate/{entity_type}/{entity_id}/{lang_from}/{lang_to}' 3 defaults: 4 _controller: '\Drupal\ai_translate\Controller\AiTranslateController::translate' 5 _title: 'AI powered Translation' 6 requirements: 7 _permission: 'create ai content translation' - Resolved by Marcus Johansson
added 1 commit
- 83c73ce5 - 3457200: Change the prompt, do not use referrer URL for redirect
Please register or sign in to reply