File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Core/Sources/PromptToCodeService Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,9 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
128128 usesTabsForIndentation: Bool ,
129129 requirement: String
130130 ) async throws -> AsyncThrowingStream < ( code: String , description: String ) , Error > {
131+ let userPreferredLanguage = UserDefaults . shared. value ( for: \. chatGPTLanguage)
132+ let textLanguage = userPreferredLanguage. isEmpty ? " " : " in \( userPreferredLanguage) "
133+
131134 let prompt = {
132135 let indentRule = usesTabsForIndentation ? " \( indentSize) tabs " : " \( indentSize) spaces "
133136 if code. isEmpty {
@@ -138,7 +141,7 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
138141 indentRule
139142 ) .
140143
141- Please reply to me start with the code block, followed by a short description in 1-3 sentences about what you did.
144+ Please reply to me start with the code block, followed by a short description in 1-3 sentences about what you did \( textLanguage ) .
142145 """
143146 } else {
144147 return """
@@ -148,7 +151,7 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
148151 indentRule
149152 ) .
150153
151- Please reply to me start with the code block followed by a short description about what you did in 1-3 sentences.
154+ Please reply to me start with the code block followed by a short description about what you did in 1-3 sentences \( textLanguage ) .
152155
153156 ```
154157 \( code)
You can’t perform that action at this time.
0 commit comments