mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Compare commits
2 Commits
d9c62b3678
...
c8fbef03c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8fbef03c9 | ||
|
|
183a426efa |
@@ -37,6 +37,9 @@ Next
|
|||||||
output. Thanks @zozowell in #1064.
|
output. Thanks @zozowell in #1064.
|
||||||
- Fix vertical `ftxui::Slider`. The "up" key was previously decreasing the
|
- Fix vertical `ftxui::Slider`. The "up" key was previously decreasing the
|
||||||
value. Thanks @its-pablo in #1093 for reporting the issue.
|
value. Thanks @its-pablo in #1093 for reporting the issue.
|
||||||
|
- Fix Windows UTF-16 key input handling. Emoji and other code points outside the
|
||||||
|
Basic Multilingual Plane (BMP) are now correctly processed. Thanks @739C1AE2
|
||||||
|
in #1160 for fixing the issue.
|
||||||
|
|
||||||
### Dom
|
### Dom
|
||||||
- Fix integer overflow in `ComputeShrinkHard`. Thanks @its-pablo in #1137 for
|
- Fix integer overflow in `ComputeShrinkHard`. Thanks @its-pablo in #1137 for
|
||||||
|
|||||||
@@ -1098,6 +1098,7 @@ void ScreenInteractive::FetchTerminalEvents() {
|
|||||||
// Convert the input events to FTXUI events.
|
// Convert the input events to FTXUI events.
|
||||||
// For each event, we call the terminal input parser to convert it to
|
// For each event, we call the terminal input parser to convert it to
|
||||||
// Event.
|
// Event.
|
||||||
|
std::wstring wstring;
|
||||||
for (const auto& r : records) {
|
for (const auto& r : records) {
|
||||||
switch (r.EventType) {
|
switch (r.EventType) {
|
||||||
case KEY_EVENT: {
|
case KEY_EVENT: {
|
||||||
@@ -1106,11 +1107,16 @@ void ScreenInteractive::FetchTerminalEvents() {
|
|||||||
if (key_event.bKeyDown == FALSE) {
|
if (key_event.bKeyDown == FALSE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::wstring wstring;
|
const wchar_t wc = key_event.uChar.UnicodeChar;
|
||||||
wstring += key_event.uChar.UnicodeChar;
|
wstring += wc;
|
||||||
|
if (wc >= 0xd800 && wc <= 0xdbff) {
|
||||||
|
// Wait for the Low Surrogate to arrive in the next record.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (auto it : to_string(wstring)) {
|
for (auto it : to_string(wstring)) {
|
||||||
internal_->terminal_input_parser.Add(it);
|
internal_->terminal_input_parser.Add(it);
|
||||||
}
|
}
|
||||||
|
wstring.clear();
|
||||||
} break;
|
} break;
|
||||||
case WINDOW_BUFFER_SIZE_EVENT:
|
case WINDOW_BUFFER_SIZE_EVENT:
|
||||||
Post(Event::Special({0}));
|
Post(Event::Special({0}));
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ limiter = RateLimiter(LIMIT_RPM, LIMIT_TPM)
|
|||||||
# Prompts
|
# Prompts
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
AGENT_NEW_FILE_PROMPT = """\
|
AGENT_NEW_FILE_PROMPT = """\
|
||||||
You are an autonomous documentation translator.
|
You are an autonomous documentation translator. You are translating the FTXUI
|
||||||
|
C++ library from English into {lang_name} ("{lang_code}").
|
||||||
|
|
||||||
GOAL
|
GOAL
|
||||||
- Translate a single, NEW file to {lang_name} ("{lang_code}").
|
- Translate a single, NEW file to {lang_name} ("{lang_code}").
|
||||||
@@ -173,7 +174,8 @@ TOOLS: {allowed_tools}.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
AGENT_DIFF_FILE_PROMPT = """\
|
AGENT_DIFF_FILE_PROMPT = """\
|
||||||
You are an autonomous documentation translator.
|
You are an autonomous documentation translator. You are translating the FTXUI
|
||||||
|
C++ library from English into {lang_name} ("{lang_code}").
|
||||||
|
|
||||||
GOAL
|
GOAL
|
||||||
- Update existing translation: {tx_root}/{rel_path}
|
- Update existing translation: {tx_root}/{rel_path}
|
||||||
@@ -195,6 +197,16 @@ WORKFLOW
|
|||||||
4. ONLY update text where the source changed.
|
4. ONLY update text where the source changed.
|
||||||
5. DO NOT translate code.
|
5. DO NOT translate code.
|
||||||
|
|
||||||
|
RULES:
|
||||||
|
1. Translate ONLY documentation:
|
||||||
|
* C++ comments (//, /* ... */)
|
||||||
|
* Doxygen comments (///, /** ... */).
|
||||||
|
* Prose in Markdown.
|
||||||
|
2. DO NOT translate/modify:
|
||||||
|
* C/C++ code, identifiers, includes, macros.
|
||||||
|
* Doxygen commands/params.
|
||||||
|
* Markdown code fences/URLs.
|
||||||
|
|
||||||
TOOLS: {allowed_tools}.
|
TOOLS: {allowed_tools}.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -404,8 +416,14 @@ def main() -> None:
|
|||||||
all_files.sort()
|
all_files.sort()
|
||||||
|
|
||||||
for lang_code in args.langs:
|
for lang_code in args.langs:
|
||||||
lang_name = LANG_NAMES.get(lang_code, lang_code)
|
lang_name = LANG_NAMES.get(lang_code, "")
|
||||||
print_step(f"Processing Language: {lang_name} ({lang_code})")
|
print_step(f"Processing Language: {lang_name} ({lang_code})")
|
||||||
|
|
||||||
|
if not lang_name:
|
||||||
|
exit_msg = f"Unknown language code: {lang_code}. Please update LANG_NAMES dictionary."
|
||||||
|
print_err(exit_msg)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
checkout_or_create_branch(tx_dir, lang_code)
|
checkout_or_create_branch(tx_dir, lang_code)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user