Skip to content

Commit 7af7ae9

Browse files
committed
fix: Add missing getter methods to TranslationResult class
The ContentTranslationController was calling getSourceLanguage() and getTranslatedText() methods that didn't exist on the TranslationResult class. Added these getter methods for compatibility.
1 parent d05207c commit 7af7ae9

7 files changed

Lines changed: 30 additions & 0 deletions

File tree

cloudformation/scenarios/localgov-drupal/drupal/web/modules/custom/ndx_aws_ai/src/Result/TranslationResult.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,36 @@ public function getText(): string {
4949
return $this->translatedText;
5050
}
5151

52+
/**
53+
* Get the translated text (alias for controller compatibility).
54+
*
55+
* @return string
56+
* The translated text.
57+
*/
58+
public function getTranslatedText(): string {
59+
return $this->translatedText;
60+
}
61+
62+
/**
63+
* Get the source language code.
64+
*
65+
* @return string
66+
* The source language code.
67+
*/
68+
public function getSourceLanguage(): string {
69+
return $this->sourceLanguage;
70+
}
71+
72+
/**
73+
* Get the target language code.
74+
*
75+
* @return string
76+
* The target language code.
77+
*/
78+
public function getTargetLanguage(): string {
79+
return $this->targetLanguage;
80+
}
81+
5282
/**
5383
* Check if language was auto-detected.
5484
*
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)