diff --git a/compiler/erg_common/deserialize.rs b/compiler/erg_common/deserialize.rs index e0f8212e..7a1ce93f 100644 --- a/compiler/erg_common/deserialize.rs +++ b/compiler/erg_common/deserialize.rs @@ -59,6 +59,8 @@ impl DeserializeError { fn_name!(), switch_lang!( "japanese" => "読み込んだ.pycファイルは破損しています", + "simplified_chinese" => "加载的.pyc文件已损坏", + "traditional_chinese" => "加載的.pyc文件已損壞", "english" => "the loaded .pyc file is broken", ), ) @@ -73,6 +75,14 @@ impl DeserializeError { "{}型オブジェクトを予期しましたが、 読み込んだオブジェクトは{}型です", expect, found ), + "simplified_chinese" => format!( + "期望一个{}对象,但反序列化的对象是{}", + expect, found + ), + "traditional_chinese" => format!( + "期望一個{}對象,但反序列化的對像是{}", + expect, found + ), "english" => format!( "expect a {} object, but the deserialized object is {}", expect, found @@ -229,6 +239,8 @@ impl Deserializer { fn_name!(), switch_lang!( "japanese" => format!("このオブジェクトは復元できません: {}", other), + "simplified_chinese" => format!("无法反序列化此对象:{}", other), + "traditional_chinese" => format!("無法反序列化此對象:{}", other), "english" => format!("cannot deserialize this object: {}", other), ), )), @@ -302,6 +314,8 @@ impl Deserializer { fn_name!(), switch_lang!( "japanese" => "バイト列の読み込みに失敗しました", + "simplified_chinese" => "未能加载字节", + "traditional_chinese" => "未能加載字節", "english" => "failed to load bytes", ), )); diff --git a/compiler/erg_common/error.rs b/compiler/erg_common/error.rs index 4b17510e..9ff9ff04 100644 --- a/compiler/erg_common/error.rs +++ b/compiler/erg_common/error.rs @@ -327,6 +327,8 @@ impl ErrorCore { loc, switch_lang!( "japanese" => format!("これはErgのバグです、開発者に報告して下さい (https://github.com/...)\n{fn_name}:{line}より発生"), + "simplified_chinese" => format!("这是Erg的bug,请报告给https://github.com/...\n原因来自:{fn_name}:{line}"), + "traditional_chinese" => format!("这是Erg的bug,请报告给https://github.com/...\n原因来自:{fn_name}:{line}"), "english" => format!("this is a bug of Erg, please report it to https://github.com/...\ncaused from: {fn_name}:{line}"), ), None, diff --git a/compiler/erg_common/value.rs b/compiler/erg_common/value.rs index d4c7ac2a..1a3824cf 100644 --- a/compiler/erg_common/value.rs +++ b/compiler/erg_common/value.rs @@ -327,6 +327,8 @@ impl ValueObj { "{}", switch_lang!( "japanese" => format!("このオブジェクトはシリアライズできません: {other}"), + "simplified_chinese" => format!("此对象无法序列化:{other}"), + "traditional_chinese" => format!("此對象無法序列化:{other}"), "english" => format!("this object cannot be serialized: {other}"), ) ) diff --git a/compiler/erg_compiler/error.rs b/compiler/erg_compiler/error.rs index f04be8e6..cb499f6e 100644 --- a/compiler/erg_compiler/error.rs +++ b/compiler/erg_compiler/error.rs @@ -145,6 +145,8 @@ impl CompileError { loc, switch_lang!( "japanese" => format!("これはErg compilerのバグです、開発者に報告して下さい (https://github.com/...)\n{fn_name}:{line}より発生"), + "simplified_chinese" => format!("这是Erg编译器的错误,请报告给https://github.com/...\n原因来自:{fn_name}:{line}"), + "traditional_chinese" => format!("這是Erg編譯器的錯誤,請報告給https://github.com/...\n原因來自:{fn_name}:{line}"), "english" => format!("this is a bug of the Erg compiler, please report it to https://github.com/...\ncaused from: {fn_name}:{line}"), ), None, @@ -170,6 +172,12 @@ impl CompileError { "japanese" => format!("スタックの要素数が異常です (要素数: {stack_len}, ブロックID: {block_id})\n\ これはコンパイラのバグです、開発者に報告して下さい (https://github.com/...)\n\ {fn_name}より発生"), + "simplified_chinese" => format!("堆栈中的元素数无效(元素数:{stack_len},块id:{block_id})\n\ + 这是 Erg 编译器的一个错误,请报告它 (https://github.com/...)\n\ + 起因于:{fn_name}"), + "traditional_chinese" => format!("堆棧中的元素數無效(元素數:{stack_len},塊id:{block_id})\n\ + 這是 Erg 編譯器的一個錯誤,請報告它 (https://github.com/...)\n\ + 起因於:{fn_name}"), "english" => format!("the number of elements in the stack is invalid (num of elems: {stack_len}, block id: {block_id})\n\ this is a bug of the Erg compiler, please report it (https://github.com/...)\n\ caused from: {fn_name}"), @@ -189,7 +197,8 @@ impl CompileError { loc, switch_lang!( "japanese" => format!("この機能({name})はまだ正式に提供されていません"), - "simplified_chinese" => format!("该功能({name})还没有正式提供"), + "simplified_chinese" => format!("此功能({name})尚未实现"), + "traditional_chinese" => format!("此功能({name})尚未實現"), "english" => format!("this feature({name}) is not implemented yet"), ), None, @@ -206,8 +215,10 @@ impl CompileError { SystemExit, Location::Unknown, switch_lang!( - "japanese" => format!("システムを終了します"), - "english" => format!("system is exiting"), + "japanese" => "システムを終了します", + "simplified_chinese" => "系统正在退出", + "traditional_chinese" => "系統正在退出", + "english" => "system is exiting", ), None, ), @@ -240,6 +251,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("これはErg compilerのバグです、開発者に報告して下さい (https://github.com/...)\n{fn_name}:{line}より発生"), + "simplified_chinese" => format!("这是Erg编译器的错误,请报告给https://github.com/...\n原因来自:{fn_name}:{line}"), + "traditional_chinese" => format!("這是Erg編譯器的錯誤,請報告給https://github.com/...\n原因來自:{fn_name}:{line}"), "english" => format!("this is a bug of the Erg compiler, please report it to https://github.com/...\ncaused from: {fn_name}:{line}"), ), None, @@ -256,6 +269,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("この機能({name})はまだ正式に提供されていません"), + "simplified_chinese" => format!("此功能({name})尚未实现"), + "traditional_chinese" => format!("此功能({name})尚未實現"), "english" => format!("this feature({name}) is not implemented yet"), ), None, @@ -286,6 +301,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{name}は既に宣言されています"), + "simplified_chinese" => format!("{name}已声明"), + "traditional_chinese" => format!("{name}已聲明"), "english" => format!("{name} is already declared"), ), Option::::None, @@ -310,6 +327,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{name}は{GREEN}{spec_t}{RESET}型として宣言されましたが、{RED}{found_t}{RESET}型のオブジェクトが代入されています"), + "simplified_chinese" => format!("{name}被声明为{GREEN}{spec_t}{RESET},但分配了一个{RED}{found_t}{RESET}对象"), + "traditional_chinese" => format!("{name}被聲明為{GREEN}{spec_t}{RESET},但分配了一個{RED}{found_t}{RESET}對象"), "english" => format!("{name} was declared as {GREEN}{spec_t}{RESET}, but an {RED}{found_t}{RESET} object is assigned"), ), Option::::None, @@ -327,6 +346,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{name}の型が指定されていません"), + "simplified_chinese" => format!("{name}的类型未指定"), + "traditional_chinese" => format!("{name}的類型未指定"), "english" => format!("the type of {name} is not specified"), ), None, @@ -347,6 +368,8 @@ impl TyCheckError { let n = readable_name(n); switch_lang!( "japanese" => format!("似た名前の変数があります: {n}"), + "simplified_chinese" => format!("存在相同名称变量:{n}"), + "traditional_chinese" => format!("存在相同名稱變量:{n}"), "english" => format!("exists a similar name variable: {n}"), ) .into() @@ -358,6 +381,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{RED}{name}{RESET}という変数は定義されていません"), + "simplified_chinese" => format!("{RED}{name}{RESET}未定义"), + "traditional_chinese" => format!("{RED}{name}{RESET}未定義"), "english" => format!("{RED}{name}{RESET} is not defined"), ), hint, @@ -378,6 +403,8 @@ impl TyCheckError { let n = readable_name(n); switch_lang!( "japanese" => format!("似た名前の属性があります: {n}"), + "simplified_chinese" => format!("具有相同名称的属性:{n}"), + "traditional_chinese" => format!("具有相同名稱的屬性:{n}"), "english" => format!("has a similar name attribute: {n}"), ) .into() @@ -389,6 +416,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{obj_t}型オブジェクトに{RED}{name}{RESET}という属性はありません"), + "simplified_chinese" => format!("{obj_t}对象没有属性{RED}{name}{RESET}"), + "traditional_chinese" => format!("{obj_t}對像沒有屬性{RED}{name}{RESET}"), "english" => format!("{obj_t} object has no attribute {RED}{name}{RESET}"), ), hint, @@ -413,6 +442,8 @@ impl TyCheckError { "japanese" => format!( "{callee}は{param_ts}を引数に取る呼び出し可能オブジェクトではありません" ), + "simplified_chinese" => format!("{callee}不是以{param_ts}作为参数的可调用对象"), + "traditional_chinese" => format!("{callee}不是以{param_ts}作為參數的可調用對象"), "english" => format!( "{callee} is not a Callable object that takes {param_ts} as an argument" ), @@ -438,6 +469,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{name}の型が違います。\n予期した型: {GREEN}{expect}{RESET}\n与えられた型: {RED}{found}{RESET}"), + "simplified_chinese" => format!("{name}的类型不匹配:\n预期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"), + "traditional_chinese" => format!("{name}的類型不匹配:\n預期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"), "english" => format!("the type of {name} is mismatched:\nexpected: {GREEN}{expect}{RESET}\nbut found: {RED}{found}{RESET}"), ), None, @@ -461,6 +494,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{name}の戻り値の型が違います。\n予期した型: {GREEN}{expect}{RESET}\n与えられた型: {RED}{found}{RESET}"), + "simplified_chinese" => format!("{name}的返回类型不匹配:\n预期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"), + "traditional_chinese" => format!("{name}的返回類型不匹配:\n預期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"), "english" => format!("the return type of {name} is mismatched:\nexpected: {GREEN}{expect}{RESET}\nbut found: {RED}{found}{RESET}"), ), None, @@ -483,6 +518,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{name}: {t}は初期化されていません"), + "simplified_chinese" => format!("{name}:{t}未初始化"), + "traditional_chinese" => format!("{name}:{t}未初始化"), "english" => format!("{name}: {t} is not initialized"), ), None, @@ -505,6 +542,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("ポジショナル引数の数が違います。\n予期した個数: {GREEN}{expect}{RESET}\n与えられた個数: {RED}{found}{RESET}"), + "simplified_chinese" => format!("正则参数的数量不匹配:\n预期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"), + "traditional_chinese" => format!("正則參數的數量不匹配:\n預期:{GREEN}{expect}{RESET}\n但找到:{RED}{found}{RESET}"), "english" => format!("the number of positional arguments is mismatched:\nexpected: {GREEN}{expect}{RESET}\nbut found: {RED}{found}{RESET}"), ), None, @@ -521,6 +560,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{expr_t}型の全パターンを網羅していません"), + "simplified_chinese" => format!("并非所有{expr_t}类型的模式都被涵盖"), + "traditional_chinese" => format!("並非所有{expr_t}類型的模式都被涵蓋"), "english" => format!("not all patterns of type {expr_t} are covered"), ), None, @@ -537,6 +578,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("{expr}の型が推論できません"), + "simplified_chinese" => format!("无法推断{expr}的类型"), + "traditional_chinese" => format!("無法推斷{expr}的類型"), "english" => format!("failed to infer the type of {expr}"), ), None, @@ -562,6 +605,8 @@ impl TyCheckError { loc, switch_lang!( "japanese" => format!("定数{name}には再代入できません"), + "simplified_chinese" => format!("不能为不可变变量{name}分配两次"), + "traditional_chinese" => format!("不能為不可變變量{name}分配兩次"), "english" => format!("cannot assign twice to the immutable variable {name}"), ), None, @@ -591,6 +636,18 @@ impl TyCheckError { 必要な引数の合計数: {GREEN}{params_len}{RESET}個 渡された引数の数: {RED}{pos_args_len}{RESET}個 キーワード引数の数: {RED}{kw_args_len}{RESET}個" + ), + "simplified_chinese" => format!("传递给{name}的参数过多。 + 所需参数总数:{GREEN}{params_len}{RESET} + 传递的参数数量:{RED}{pos_args_len}{RESET} + 关键字参数的数量:{RED}{kw_args_len}{RESET} + " + ), + "traditional_chinese" => format!("傳遞給{name}的參數過多。 + 所需參數總數:{GREEN}{params_len}{RESET} + 傳遞的參數數量:{RED}{pos_args_len}{RESET} + 關鍵字參數的數量:{RED}{kw_args_len}{RESET} + " ), "english" => format!( "too many arguments for {name}: @@ -620,6 +677,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" loc, switch_lang!( "japanese" => format!("{name}の引数{RED}{arg_name}{RESET}が複数回渡されています"), + "simplified_chinese" => format!("{name}的参数{RED}{arg_name}{RESET}被多次传递"), + "traditional_chinese" => format!("{name}的參數{RED}{arg_name}{RESET}被多次傳遞"), "english" => format!("{name}'s argument {RED}{arg_name}{RESET} is passed multiple times"), ), None, @@ -643,6 +702,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" loc, switch_lang!( "japanese" => format!("{name}には予期しないキーワード引数{RED}{param_name}{RESET}が渡されています"), + "simplified_chinese" => format!("{name}得到了意外的关键字参数{RED}{param_name}{RESET}"), + "traditional_chinese" => format!("{name}得到了意外的關鍵字參數{RED}{param_name}{RESET}"), "english" => format!("{name} got unexpected keyword argument {RED}{param_name}{RESET}"), ), None, @@ -660,6 +721,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" loc, switch_lang!( "japanese" => format!("{YELLOW}{name}{RESET}は使用されていません"), + "simplified_chinese" => format!("{YELLOW}{name}{RESET}未使用"), + "traditional_chinese" => format!("{YELLOW}{name}{RESET}未使用"), "english" => format!("{YELLOW}{name}{RESET} is not used"), ), None, @@ -689,6 +752,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" loc, switch_lang!( "japanese" => format!("型の単一化に失敗しました:\n左辺: {YELLOW}{lhs_t}{RESET}\n右辺: {YELLOW}{rhs_t}{RESET}"), + "simplified_chinese" => format!("类型统一失败:\n左边:{YELLOW}{lhs_t}{RESET}\n右边:{YELLOW}{rhs_t}{RESET}"), + "traditional_chinese" => format!("類型統一失敗:\n左邊:{YELLOW}{lhs_t}{RESET}\n右邊:{YELLOW}{rhs_t}{RESET}"), "english" => format!("unification failed:\nlhs: {YELLOW}{lhs_t}{RESET}\nrhs: {YELLOW}{rhs_t}{RESET}"), ), None, @@ -718,6 +783,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" loc, switch_lang!( "japanese" => format!("型の再単一化に失敗しました:\n左辺: {YELLOW}{lhs_t}{RESET}\n右辺: {YELLOW}{rhs_t}{RESET}"), + "simplified_chinese" => format!("重新统一类型失败:\n左边:{YELLOW}{lhs_t}{RESET}\n右边:{YELLOW}{rhs_t}{RESET}"), + "traditional_chinese" => format!("重新統一類型失敗:\n左邊:{YELLOW}{lhs_t}{RESET}\n右邊:{YELLOW}{rhs_t}{RESET}"), "english" => format!("re-unification failed:\nlhs: {YELLOW}{lhs_t}{RESET}\nrhs: {YELLOW}{rhs_t}{RESET}"), ), None, @@ -747,6 +814,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" loc, switch_lang!( "japanese" => format!("部分型制約を満たせません:\nサブタイプ: {YELLOW}{sub_t}{RESET}\nスーパータイプ: {YELLOW}{sup_t}{RESET}"), + "simplified_chinese" => format!("无法满足子类型约束:\n子类型:{YELLOW}{sub_t}{RESET}\n超类型:{YELLOW}{sup_t}{RESET}"), + "traditional_chinese" => format!("無法滿足子類型約束:\n子類型:{YELLOW}{sub_t}{RESET}\n超類型:{YELLOW}{sup_t}{RESET}"), "english" => format!("subtype constraints cannot be satisfied:\nsubtype: {YELLOW}{sub_t}{RESET}\nsupertype: {YELLOW}{sup_t}{RESET}"), ), None, @@ -768,6 +837,8 @@ passed keyword args: {RED}{kw_args_len}{RESET}" Location::Unknown, switch_lang!( "japanese" => format!("述語式の単一化に失敗しました:\n左辺: {YELLOW}{lhs}{RESET}\n右辺: {YELLOW}{rhs}{RESET}"), + "simplified_chinese" => format!("无法统一谓词表达式:\n左边:{YELLOW}{lhs}{RESET}\n左边:{YELLOW}{rhs}{RESET}"), + "traditional_chinese" => format!("無法統一謂詞表達式:\n左邊:{YELLOW}{lhs}{RESET}\n左邊:{YELLOW}{rhs}{RESET}"), "english" => format!("predicate unification failed:\nlhs: {YELLOW}{lhs}{RESET}\nrhs: {YELLOW}{rhs}{RESET}"), ), None, @@ -783,8 +854,10 @@ passed keyword args: {RED}{kw_args_len}{RESET}" HasEffect, expr.loc(), switch_lang!( - "japanese" => format!("この式には副作用があります"), - "english" => format!("this expression causes a side-effect"), + "japanese" => "この式には副作用があります", + "simplified_chinese" => "此表达式会产生副作用", + "traditional_chinese" => "此表達式會產生副作用", + "english" => "this expression causes a side-effect", ), None, ), @@ -809,6 +882,14 @@ passed keyword args: {RED}{kw_args_len}{RESET}" "{RED}{name}{RESET}は{}行目ですでに移動されています", moved_loc.ln_begin().unwrap() ), + "simplified_chinese" => format!( + "{RED}{name}{RESET}已移至第{}行", + moved_loc.ln_begin().unwrap() + ), + "traditional_chinese" => format!( + "{RED}{name}{RESET}已移至第{}行", + moved_loc.ln_begin().unwrap() + ), "english" => format!( "{RED}{name}{RESET} was moved in line {}", moved_loc.ln_begin().unwrap() diff --git a/compiler/erg_compiler/lower.rs b/compiler/erg_compiler/lower.rs index c60eca9d..60b2d311 100644 --- a/compiler/erg_compiler/lower.rs +++ b/compiler/erg_compiler/lower.rs @@ -70,12 +70,16 @@ impl ASTLowerer { self.ctx.name.clone(), switch_lang!( "japanese" => "式の評価結果が使われていません", + "simplified_chinese" => "表达式评估结果未使用", + "traditional_chinese" => "表達式評估結果未使用", "english" => "the evaluation result of the expression is not used", ), Some( switch_lang!( "japanese" => "値を使わない場合は、discard関数を使用してください", - "english" => "if you don't use the value, use `discard` function", + "simplified_chinese" => "如果您不想使用该值,请使用discard函数", + "traditional_chinese" => "如果您不想使用該值,請使用discard函數", + "english" => "if you don't use the value, use discard function", ) .into(), ), diff --git a/compiler/erg_parser/error.rs b/compiler/erg_parser/error.rs index a7874e48..b51ed6a6 100644 --- a/compiler/erg_parser/error.rs +++ b/compiler/erg_parser/error.rs @@ -27,6 +27,8 @@ impl LexError { loc, switch_lang!( "japanese" => format!("これはErg compilerのバグです、開発者に報告して下さい (https://github.com/mtshiba/erg)\n{fn_name}:{line}より発生"), + "simplified_chinese" => format!("这是Erg编译器的一个错误,请报告给https://github.com/mtshiba/erg\n原因来自:{fn_name}:{line}"), + "traditional_chinese" => format!("這是Erg編譯器的一個錯誤,請報告給https://github.com/mtshiba/erg\n原因來自:{fn_name}:{line}"), "english" => format!("this is a bug of the Erg compiler, please report it to https://github.com/mtshiba/erg\ncaused from: {fn_name}:{line}"), ), None, @@ -40,7 +42,8 @@ impl LexError { loc, switch_lang!( "japanese" => format!("この機能({name})はまだ正式に提供されていません"), - "simplified_chinese" => format!("该功能({name})还没有正式提供"), + "simplified_chinese" => format!("此功能({name})尚未实现"), + "traditional_chinese" => format!("此功能({name})尚未實現"), "english" => format!("this feature({name}) is not implemented yet"), ), None, @@ -55,6 +58,7 @@ impl LexError { switch_lang!( "japanese" => "不正な構文です", "simplified_chinese" => "无效的语法", + "traditional_chinese" => "無效的語法", "english" => "invalid syntax", ), None, diff --git a/compiler/erg_parser/lex.rs b/compiler/erg_parser/lex.rs index 77f88835..eceadaa9 100644 --- a/compiler/erg_parser/lex.rs +++ b/compiler/erg_parser/lex.rs @@ -268,6 +268,8 @@ impl Lexer /*<'a>*/ { comment.loc(), switch_lang!( "japanese" => "不正なユニコード文字(双方向オーバーライド)がコメント中に使用されています", + "simplified_chinese" => "注释中使用了非法的unicode字符(双向覆盖)", + "traditional_chinese" => "註釋中使用了非法的unicode字符(雙向覆蓋)", "english" => "invalid unicode character (bi-directional override) in comments", ), None, @@ -301,6 +303,8 @@ impl Lexer /*<'a>*/ { space.loc(), switch_lang!( "japanese" => "インデントが不正です", + "simplified_chinese" => "无效缩进", + "traditional_chinese" => "無效縮進", "english" => "invalid indent", ), None, @@ -323,11 +327,15 @@ impl Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => "インデントが深すぎます", + "simplified_chinese" => "缩进太深", + "traditional_chinese" => "縮進太深", "english" => "indentation is too deep", ), Some( switch_lang!( "japanese" => "コードが複雑すぎます。処理を分割してください", + "simplified_chinese" => "代码过于复杂,请拆分过程", + "traditional_chinese" => "代碼過於復雜,請拆分過程", "english" => "The code is too complicated. Please split the process", ) .into(), @@ -368,6 +376,8 @@ impl Lexer /*<'a>*/ { invalid_dedent.loc(), switch_lang!( "japanese" => "インデントが不正です", + "simplified_chinese" => "无效缩进", + "traditional_chinese" => "無效縮進", "english" => "invalid indent", ), None, @@ -540,6 +550,8 @@ impl Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => "不正なユニコード文字(双方向オーバーライド)が文字列中に使用されています", + "simplified_chinese" => "注释中使用了非法的unicode字符(双向覆盖)", + "traditional_chinese" => "註釋中使用了非法的unicode字符(雙向覆蓋)", "english" => "invalid unicode character (bi-directional override) in string literal", ), None, @@ -553,6 +565,8 @@ impl Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => "文字列が\"によって閉じられていません", + "simplified_chinese" => "字符串没有被\"关闭", + "traditional_chinese" => "字符串没有被\"关闭", "english" => "the string is not closed by \"", ), None, @@ -602,6 +616,8 @@ impl Iterator for Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => "<.という演算子はありません", + "simplified_chinese" => "没有这样的运算符:<.", + "traditional_chinese" => "沒有這樣的運算符:<.", "english" => "no such operator: <.", ), None, @@ -789,11 +805,15 @@ impl Iterator for Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => "タブ文字は使用できません", + "simplified_chinese" => "不能将制表符用作空格", + "traditional_chinese" => "不能將製表符用作空格", "english" => "cannot use a tab as a space", ), Some( switch_lang!( "japanese" => "スペース( )を使用してください", + "simplified_chinese" => "使用空格( )", + "traditional_chinese" => "使用空格( )", "english" => "use spaces ( )", ) .into(), @@ -821,6 +841,8 @@ impl Iterator for Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => format!("`{}`はユーザー定義できません", &token.content), + "simplified_chinese" => format!("`{}`不能由用户定义", &token.content), + "traditional_chinese" => format!("`{}`不能由用戶定義", &token.content), "english" => format!("`{}` cannot be defined by user", &token.content), ), None, @@ -835,6 +857,8 @@ impl Iterator for Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => format!("バッククォート(`)が閉じられていません"), + "simplified_chinese" => format!("反引号(`)未关闭"), + "traditional_chinese" => format!("反引號(`)未關閉"), "english" => format!("back quotes (`) not closed"), ), None, @@ -852,6 +876,8 @@ impl Iterator for Lexer /*<'a>*/ { token.loc(), switch_lang!( "japanese" => format!("この文字は使用できません: '{invalid}'"), + "simplified_chinese" => format!("无效字符:'{invalid}'"), + "traditional_chinese" => format!("無效字符:'{invalid}'"), "english" => format!("invalid character: '{invalid}'"), ), None, diff --git a/compiler/erg_parser/parse.rs b/compiler/erg_parser/parse.rs index a084f5dd..2782392d 100644 --- a/compiler/erg_parser/parse.rs +++ b/compiler/erg_parser/parse.rs @@ -453,6 +453,8 @@ impl Parser { loc, switch_lang!( "japanese" => "ブロックの解析に失敗しました", + "simplified_chinese" => "无法解析块", + "traditional_chinese" => "無法解析塊", "english" => "failed to parse a block", ), None, @@ -529,6 +531,8 @@ impl Parser { self.peek().unwrap().loc(), switch_lang!( "japanese" => "変数宣言で型制約は使えません", + "simplified_chinese" => "变量声明中不允许类型约束", + "traditional_chinese" => "變量聲明中不允許類型約束", "english" => "Cannot use type bounds in a declaration of a variable", ), None, @@ -711,6 +715,8 @@ impl Parser { t.loc(), switch_lang!( "japanese" => "左辺値の中で中置演算子は使えません", + "simplified_chinese" => "二元运算符不能用于左值", + "traditional_chinese" => "二元運算符不能用於左值", "english" => "Binary operators cannot be used in left-values", ), None, @@ -825,6 +831,8 @@ impl Parser { t.loc(), switch_lang!( "japanese" => "仮引数の中で中置演算子は使えません", + "simplified_chinese" => "参数中不能使用二元运算符", + "traditional_chinese" => "參數中不能使用二元運算符", "english" => "Binary operators cannot be used in parameters", ), None, @@ -1162,6 +1170,8 @@ impl Parser { other.loc(), switch_lang!( "japanese" => "この式はコンパイル時計算できないため、型引数には使用できません", + "simplified_chinese" => "此表达式在编译时不可计算,因此不能用作类型参数", + "traditional_chinese" => "此表達式在編譯時不可計算,因此不能用作類型參數", "english" => "this expression is not computable at the compile-time, so cannot used as a type-argument", ), None,