Skip to content

Commit

Permalink
Only translate the disclaimer if translate postfix setting is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Dec 10, 2024
1 parent 322612a commit 2b23b94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ public function build_full_ai_prompt($response, $aiprompt, $defaultmark, $marksc
$prompt .= ' translate the feedback to the language '.current_language();
};


return $prompt;

}

/**
Expand Down Expand Up @@ -337,6 +335,10 @@ protected function llm_translate(string $text): string {
if (current_language() == 'en') {
return $text;
}
if (get_config('qtype_aitext', 'translatepostfix') == 0) {
return $text;
}

$cache = cache::make('qtype_aitext', 'stringdata');
if (($translation = $cache->get(current_language().'_'.$text)) === false) {
$prompt = 'translate "'.$text .'" into '.current_language();
Expand Down

0 comments on commit 2b23b94

Please sign in to comment.