Skip to content

fix(Languages/pt-br/10_InsertionSort): restore ifElseTest, remove JS tool residue - #913

Open
xuyua9 wants to merge 1 commit into
AmazingAng:mainfrom
xuyua9:fix/pt-br-10-insertionsort-js-residue
Open

xuyua9 wants to merge 1 commit into
AmazingAng:mainfrom
xuyua9:fix/pt-br-10-insertionsort-js-residue

Conversation

@xuyua9

@xuyua9 xuyua9 commented Jul 21, 2026

Copy link
Copy Markdown

What & Why

The pt-br localization of Languages/pt-br/10_InsertionSort/InsertionSort.sol contains a JavaScript translation-tool fragment where the ifElseTest function body should be. The stray lines are not valid Solidity, and the contract does not compile in its current form:

contract InsertionSort {
    // if else

        if (text.includes('zh')) {
            text = translate(text, 'zh', 'pt-br');
        } else {
            text = text;
        }
    }

This almost certainly came from an automated translation pass that did not skip code blocks.

This PR restores the ifElseTest(uint256 _number) function, matching the root 10_InsertionSort/InsertionSort.sol and the code block already documented in Languages/pt-br/10_InsertionSort/readme.md:

function ifElseTest(uint256 _number) public pure returns(bool){
    if(_number == 0){
        return(true);
    }else{
        return(false);
    }
}

After the fix, the diff (ignoring comments) between the root and pt-br InsertionSort.sol is empty, so the localized contract is functionally identical to the canonical one.

Scope

  • Single file: Languages/pt-br/10_InsertionSort/InsertionSort.sol
  • +5 / -5 lines (the JS fragment was 5 non-comment lines; the ifElseTest body is also 5 lines plus closing braces).

Type of PR

  • Typo(勘误)
  • BUG(程序错误)
  • Improvement(提升)
  • Feature(新特性)

How to verify

solc Languages/pt-br/10_InsertionSort/InsertionSort.sol

should succeed (it currently fails with ParserError on the text.includes('zh') line).

…tool residue

The pt-br localization of 10_InsertionSort/InsertionSort.sol had a JavaScript
translation-tool fragment in place of the ifElseTest function body:

        if (text.includes('zh')) {
            text = translate(text, 'zh', 'pt-br');
        } else {
            text = text;
        }

This is not valid Solidity and prevented the contract from compiling. Replace
it with the correct ifElseTest(uint256 _number) function, matching the root
10_InsertionSort/InsertionSort.sol and the pt-br readme code block.

Diff (ignoring comments) between root and pt-br InsertionSort.sol is now empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant