Skip to content

Commit a6c0ac8

Browse files
committed
comment(console): 把注释国际化
1 parent a1a4552 commit a6c0ac8

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

kernel/src/output/console/console_bitfont.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,10 @@ impl crate::output::console::Console for BitfontConsole {
310310
}
311311

312312
fn put_char(&mut self, ch: char) {
313-
// 将 char 转换为 u8,如果是 ASCII 范围内的字符
314313
if ch.is_ascii() {
315314
self.print_char(ch as u8);
316315
} else {
317-
// 对于非 ASCII 字符,打印替换字符 '?'
316+
// For non-ASCII characters, use "?" to replace.
318317
self.print_char(b'?');
319318
}
320319
}

kernel/src/output/console/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,48 @@ pub use console_bitfont::BitfontConsole;
1414
#[cfg(ENABLE_TTF_CONSOLE)]
1515
pub use console_ttf::TtfConsole;
1616

17-
/// 统一的 Console trait,定义所有 console 实现的通用接口
17+
/// General [`Console`] trait, which defined generic APIs.
1818
pub trait Console: Write {
19-
/// 清除屏幕
19+
/// Clean screen
2020
fn clear(&mut self);
2121

22-
/// 设置前景色
22+
/// Set up foreground color
2323
fn set_fg_color(&mut self, color: Color);
2424

25-
/// 设置背景色
25+
/// Set up background color
2626
fn set_bg_color(&mut self, color: Color);
2727

28-
/// 获取当前前景色
28+
/// Get current foreground color
2929
fn get_fg_color(&self) -> Color;
3030

31-
/// 获取当前背景色
31+
/// Get current background color
3232
fn get_bg_color(&self) -> Color;
3333

34-
/// 打印单个字符
34+
/// Print single char
3535
fn put_char(&mut self, ch: char);
3636

37-
/// 光标上移
37+
/// Move cursor up
3838
fn cursor_up(&mut self, lines: u32);
3939

40-
/// 光标下移
40+
/// Move cursor down
4141
fn cursor_down(&mut self, lines: u32);
4242

43-
/// 光标左移
43+
/// Move cursor left
4444
fn cursor_left(&mut self, cols: u32);
4545

46-
/// 光标右移
46+
/// Move cursor right
4747
fn cursor_right(&mut self, cols: u32);
4848

49-
/// 设置光标位置
49+
/// Set up cursor position
5050
fn set_cursor_pos(&mut self, x: u32, y: u32);
5151

52-
/// 获取光标位置
52+
/// Get current cursor posision
5353
fn get_cursor_pos(&self) -> (u32, u32);
5454

55-
/// 隐藏光标
55+
/// Hide cursor
5656
fn cursor_hide(&mut self);
5757

58-
/// 显示光标
58+
/// Show cursor
5959
fn cursor_show(&mut self);
6060
}
6161

0 commit comments

Comments
 (0)