There is a body of law governing the international aspects of contracts. First, the courts look to whether there is a clause in the contract that names a jurisdiction as the proper law of the contract and the place in which litigation will take place. If there is such a clause, often called a "Forum" clause or a "Jurisdiction" clause, then the courts will allow the contract to be litigated in that forum - even if the parties are from another jurisdiction or the contract is executed or performed in another jurisdiction.
If there is no such clause, then the courts look to the jurisdiction that has the closest and substantial connection to the contract. They will look at factors such as the residency of the parties to the contract, where the contract is performed, where the benefits of the contract are realized, where the contract was executed, where the resources to execute the contract are located, and other such factors. After weighing all of these factors, the courts will choose the best law of the contract and the forum.