feat: i18n support - auto-detect system language for zh/en prompts
This commit is contained in:
5
ga.py
5
ga.py
@@ -566,9 +566,10 @@ def get_global_memory():
|
||||
prompt = "\n"
|
||||
try:
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
suffix = '_en' if os.environ.get('GA_LANG', '') == 'en' else ''
|
||||
with open(os.path.join(script_dir, 'memory/global_mem_insight.txt'), 'r', encoding='utf-8', errors='replace') as f: insight = f.read()
|
||||
with open(os.path.join(script_dir, 'assets/insight_fixed_structure.txt'), 'r', encoding='utf-8') as f: structure = f.read()
|
||||
prompt += f'cwd = {os.path.join(script_dir, "temp")} (用./引用)\n'
|
||||
with open(os.path.join(script_dir, f'assets/insight_fixed_structure{suffix}.txt'), 'r', encoding='utf-8') as f: structure = f.read()
|
||||
prompt += f'cwd = {os.path.join(script_dir, "temp")} (./)\n'
|
||||
prompt += f"\n[Memory] (../memory)\n"
|
||||
prompt += structure + '\n../memory/global_mem_insight.txt:\n'
|
||||
prompt += insight + "\n"
|
||||
|
||||
Reference in New Issue
Block a user