In alliance with Japan during World War II , Thailand became a US treaty ally in 1954 after sending troops to Korea and fighting alongside the US in Vietnam .