Skip to content

Commit 248ca39

Browse files
Asnowwwchaokunyang
authored andcommitted
chore: translate Chinese comments into English (#2503)
<!-- **Thanks for contributing to Fory.** **If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fory** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md). - Fory has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## What does this PR do? <!-- Describe the purpose of this PR. --> chore: translate Chinese comments into English ## Related issues <!-- Is there any related issue? Please attach here. - #xxxx0 - #xxxx1 - #xxxx2 --> ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark <!-- When the PR has an impact on performance (if you don't know whether the PR will have an impact on performance, you can submit the PR first, and if it will have impact on performance, the code reviewer will explain it), be sure to attach a benchmark data here. -->
1 parent eab2953 commit 248ca39

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

java/benchmark/src/main/proto/bench.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ message Bar {
3737
optional int64 f6 = 6;
3838
optional float f7 = 7;
3939
optional double f8 = 8;
40-
repeated int32 f9 = 9; // proto不支持int16
40+
repeated int32 f9 = 9; // proto does not support int16
4141
repeated int64 f10 = 10;
4242
}
4343

java/fory-core/src/main/java/org/apache/fory/codegen/Expression.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,8 +2432,7 @@ public ExprCode doGenCode(CodegenContext ctx) {
24322432
action.apply(
24332433
new Reference(i),
24342434
new Reference(leftElemValue, leftElemType, true),
2435-
// elemValue nullability check uses isNullAt inside action, so elemValueRef's nullable is
2436-
// false.
2435+
// elemValue nullability check uses isNullAt inside action, so elemValueRef's nullable is false.
24372436
new Reference(rightElemValue, rightElemType, false));
24382437
ExprCode elementExprCode = elemExpr.genCode(ctx);
24392438

javascript/packages/fory/lib/meta/MetaString.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class MetaStringDecoder {
201201

202202
capitalize(str: string) {
203203
if (typeof str !== "string" || str.length === 0) {
204-
return str; // 如果不是字符串或为空,直接返回原值
204+
return str; // If not a string or empty, return the original value
205205
}
206206
return str.charAt(0).toUpperCase() + str.slice(1);
207207
}
@@ -366,22 +366,22 @@ export class MetaStringEncoder {
366366
}
367367

368368
isUpperCase(str: string) {
369-
// 检查字符串是否为空
369+
// Check whether the string is empty
370370
if (typeof str !== "string" || str.length === 0) {
371-
return false; // 如果不是字符串或为空,返回 false
371+
return false; // If not a string or empty, return false
372372
}
373373

374-
// 使用正则表达式检查是否所有字母字符都是大写的
374+
// Use a regular expression to check whether all alphabetic characters are uppercase
375375
return /^[^a-z]*$/.test(str);
376376
}
377377

378378
isDigit(str: string) {
379-
// 检查字符串是否为空
379+
// Check whether the string is empty
380380
if (typeof str !== "string" || str.length === 0) {
381-
return false; // 如果不是字符串或为空,返回 false
381+
return false; // If not a string or empty, return false
382382
}
383383

384-
// 使用正则表达式检查是否所有字母字符都是大写的
384+
// Use a regular expression to check whether all alphabetic characters are uppercase
385385
return /^[^0-9]*$/.test(str);
386386
}
387387

0 commit comments

Comments
 (0)