Przeglądaj źródła

Improve translation workflow to avoid unnecessary file reads (#5126)

* dotroo: improve translation workflow to reduce unnecessary file reads

Update translation workflow guidelines to use search_files instead of reading
each translation file individually. This approach is more efficient and
reduces context token usage while maintaining translation accuracy.

The improved workflow:
- Uses search_files to find JSON structure in translation files
- Creates proper context for apply_diff without reading every file
- Only reads specific files when their structure differs
- Validates changes with the missing translations script

Fixes: #5125
Signed-off-by: Eric Wheeler <[email protected]>

* Update 001-general-rules.md

---------

Signed-off-by: Eric Wheeler <[email protected]>
Co-authored-by: Eric Wheeler <[email protected]>
Co-authored-by: Daniel <[email protected]>
KJ7LNW 6 miesięcy temu
rodzic
commit
d1ab71c60e
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      .roo/rules-translate/001-general-rules.md

+ 4 - 2
.roo/rules-translate/001-general-rules.md

@@ -64,8 +64,10 @@
     1. Identify where the string appears in the UI/codebase
     1. Identify where the string appears in the UI/codebase
     2. Understand the context and purpose of the string
     2. Understand the context and purpose of the string
     3. Update English translation first
     3. Update English translation first
-    4. Create appropriate translations for all other supported languages
-    5. Validate your changes with the missing translations script
+    4. Use the `<search_files>` tool to find JSON keys that are near new keys in English translations but do not yet exist in the other language files for `<apply_diff>` SEARCH context
+    5. Create appropriate translations for all other supported languages utilizing the `search_files` result using `<apply_diff>` without reading every file.
+    6. Do not output the translated text into the chat, just modify the files.
+    7. Validate your changes with the missing translations script
 - Flag or comment if an English source string is incomplete ("please see this...") to avoid truncated or unclear translations
 - Flag or comment if an English source string is incomplete ("please see this...") to avoid truncated or unclear translations
 - For UI elements, distinguish between:
 - For UI elements, distinguish between:
     - Button labels: Use short imperative commands ("Save", "Cancel")
     - Button labels: Use short imperative commands ("Save", "Cancel")