Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n support #214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/gpt_review/_ask.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Ask GPT a question."""
import os
import logging
from typing import Dict, List, Optional

Expand Down Expand Up @@ -103,6 +104,10 @@ def _ask(

prompt = "".join(question)

response_lang = os.getenv("RESPONSE_LANG")
if response_lang:
prompt = "Please reply in " + response_lang + prompt
Copy link

@amul047 amul047 Mar 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prompt = "Please reply in " + response_lang + prompt
prompt = "Please reply in " + response_lang + ": " + prompt


if files or directory or repository:
response = _query_index(
prompt,
Expand Down
2 changes: 2 additions & 0 deletions src/gpt_review/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@
BUG_PROMPT_YAML = "prompt_bug.yaml"
COVERAGE_PROMPT_YAML = "prompt_coverage.yaml"
SUMMARY_PROMPT_YAML = "prompt_summary.yaml"

RESPONSE_LANG = None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably default to an actual language?