Skip to content

Modify explain code AI prompt due to i18n issue

What does this MR do and why?

This MR try to modify Explain Code Prompt a little bit, due to avoid i18n issue #417130 (closed)

Screenshots or screen recordings

according to #417128, we may need avoid using " in i18n template to use `, so below template string(contains " )

EXPLAIN_CODE_PROMPT: s__(
    'AI|Explain the code from %{filePath} in human understandable language presented in Markdown format. In the response add neither original code snippet nor any title. `%{text}`. If it is not programming code, say "The selected text is not code. I am afraid this feature is for explaining code only. Would you like to ask a different question about the selected text?" and wait for another question.',
  ),

should be ( contains ` )

EXPLAIN_CODE_PROMPT: s__(
    'AI|Explain the code from %{filePath} in human understandable language presented in Markdown format. In the response add neither original code snippet nor any title. `%{text}`. If it is not programming code, say `The selected text is not code. I am afraid this feature is for explaining code only. Would you like to ask a different question about the selected text?` and wait for another question.',
  ),

I try the two prompt in chatgpt and found nothing change.

use " in prompt use ` in prompt
image.png image.png

Merge request reports