diff --git a/en/application-dev/ui/ts-syntactic-sugar.md b/en/application-dev/ui/ts-syntactic-sugar.md index 4f367db9ee810ccd016780c68e37078b82d8d522..cd3a8020706be0ab9d4bfd99ba6aabb74de704bc 100644 --- a/en/application-dev/ui/ts-syntactic-sugar.md +++ b/en/application-dev/ui/ts-syntactic-sugar.md @@ -130,7 +130,7 @@ build() { let a: number = 1 // invalid: variable declaration not allowed Column() { Text('Hello ${this.myName.toUpperCase()}') // ok. - ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array varible in place + ForEach(this.arr.reverse(), ..., ...) // invalid: Array.reverse modifies the @State array variable in place } buildSpecial() // invalid: no function calls Text(this.calcTextValue()) // this function call is ok. diff --git a/en/contribute/OpenHarmony-c-coding-style-guide.md b/en/contribute/OpenHarmony-c-coding-style-guide.md index 47fd708789cf484d3899632f3f6391ed120ed755..c63b38e5e982dd0c148bb771a617e1fb7eeb6ae6 100755 --- a/en/contribute/OpenHarmony-c-coding-style-guide.md +++ b/en/contribute/OpenHarmony-c-coding-style-guide.md @@ -577,11 +577,11 @@ int result = reallyReallyLongVariableName1 + // Good: The plus sign is placed After an expression is wrapped, ensure that the lines are properly aligned or indented by 4 spaces. Example: ```c -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: indented with 4 spaces +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: indented with 4 spaces -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: aligned +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: aligned ``` ## Variable Assignment diff --git a/en/contribute/OpenHarmony-cpp-coding-style-guide.md b/en/contribute/OpenHarmony-cpp-coding-style-guide.md index e599a3d5d16cf6dd9bc6784dbe2db069d188cd65..ee0dc819756fa670c0e01104ab64e50a8c25bd6e 100755 --- a/en/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/en/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good After an expression is wrapped, ensure that the lines are aligned appropriately or indented with 4 spaces. See the following example. ```cpp -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: indented with 4 spaces +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: indented with 4 spaces -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: The lines are aligned. +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: The lines are aligned. ``` ## Variable Assignment diff --git a/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md b/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md index bd1e50054a320d1079afb57f38ffc7154153649f..87a81c38be398ce9c60fe2a92a367c165007f005 100755 --- a/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md +++ b/zh-cn/contribute/OpenHarmony-c-coding-style-guide.md @@ -540,11 +540,11 @@ int result = reallyReallyLongVariableName1 + // Good: 加号留在行末 表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子 ```c -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: 4空格缩进 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: 4空格缩进 -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // OK: 保持对齐 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // OK: 保持对齐 ``` ## 变量赋值 diff --git a/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md b/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md index 06cae9de859ea1d4e33b2ba203c8250be9ad43df..8f56e3cf7d8299fece26c53a2fc317a5287aea49 100755 --- a/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -428,11 +428,11 @@ int result = reallyReallyLongVariableName1 + // Good 表达式换行后,注意保持合理对齐,或者4空格缩进。参考下面例子 ```cpp -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: 4空格缩进 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: 4空格缩进 -int sum = longVaribleName1 + longVaribleName2 + longVaribleName3 + - longVaribleName4 + longVaribleName5 + longVaribleName6; // Good: 保持对齐 +int sum = longVariableName1 + longVariableName2 + longVariableName3 + + longVariableName4 + longVariableName5 + longVariableName6; // Good: 保持对齐 ``` ## 变量赋值