More and more programming tools have been created to help people to learn new programming languages. Although the number of tools to support beginning learners has increased, none directly compare different languages. This paper proposes a translation-based programming learning method that supports programming language learning for beginners of a new language who are familiar with a different language. Comparing the same code written in the two languages allows learners to discover commonalities and differences between the two languages, understand grammar rules, and successfully write programs in the new language. Our method is demonstrated using a web-based educational environment that translates Java into Swift. An experiment to evaluate the educational effectiveness confirms that using a programming language educational environment with translation support can aid beginning learners in learning a new programming language.