I have studied 19th century Japan in a great deal of detail, further than a few books. Most of my material is ten years rusty but my shelves are full of out-of-print books that helped me out. I can look up some names of early diplomats that wrote books published in English when I get a little more free time at home. But I love this era so I want to throw you additional detail into what was happening initially.
When the Americans arrived with Commodore Perry's Black Ships a treaty was signed that started relations. In the treaty the Japanese had to provide an American diplomat with accommodation and a tutor so he could become familiar with some of the Japanese language and forms and negotiate the finer points of a treaty and expanded treaties. The Japanese sent young men to learn some of his ways to help get a better read on Americans. (Read 'Shimodo Story' by that diplomat, Oliver Statler. It is his journal. While he is condescending toward the inferior Japanese he would stay many years in Japan and became a great admirer of the culture and fell in love with Japan).
The Japanese stalled as much as they could for several reasons. One was while people worked to absorb as much as they could have the world outside Japan. Several Japanese secured passage on some of the first ships to go to America and Europe. Initially they were seen as a novelty by the Americans. Those silk Haori jackets over kimono and split skirt-trousers made them look effeminate next to taller men in black formal suits. They learned pretty quickly how they were received. They bought new clothes. And while the senior dignitaries continued on their journey several younger men stayed behind and studied the language and political systems.
Back home their were academics that had been wishing for connections with the world beyond Japan. They had been trading in books acquired by the Dutch for some time and Dutch had been taught to some individuals so they could deal with the limited relations outside Japan. When Japan opened up they were prepared to learn English, already knowing the Roman alphabet. Schools were opened ( I believe this study was the ground work for Tokyo University, but it's been awhile since I studied those guys).
I write about language here because that seems so much a part of learning western diplomacy. It was many years before full treaties for trade were signed and the Japanese did a great job of absorbing the knowledge and technology of the west whether they liked openness or not. (Though it was not a smooth political transition internally, and change occurred over ten years and more, not a couple of years, before German academies, French guns and British and American ships were bought and sold).
Along with regular delegations that slowly discussed relations with western diplomats many young men of lower Samurai class that lacked enthusiasm for the boring clerical work in many a back-country domain snuck off to jump a ship to America and got some schooling. 5 years away had these fellows coming back with knowledge of Americans or French that gave their seniors the intel to negotiate through them as translators.
Some further reading: several books on Sakamoto Ryoma, the Japanese Thomas Edison. A lot to read there about learning western politics some of the diplomats. If you want some reading recommendations I can provide more later when I can look at my shelves.
edit- horrible wall of text, leaving the bad grammar mistakes.
Sakoku and the idea of Japan being completely isolated is rather incorrect. While international trade was strictly regulated and controlled by the shogunate, there were several key ports that goods were permitted to flow in and out of. In specific trade ports, vassal daimyo were authorized to conduct trade with Chinese, Korean, or Ainu vessels.
For your question, the most notable of these trade ports is the island of Dejima in the port of Nagasaki. The Dutch were the only European traders permitted to access Japan, and they had sustained tentative relations with the Tokugawa shogunate for hundreds of years.
The Tokugawa court understood the Western world through their Dutch contacts - the study of Rangaku included the Dutch language, so there were scholars and translators fluent in Dutch at the time of the Meiji Restoration.
The historian Michael Auslin has an excellent book on 19th century Japanese diplomacy. In Negotiating with Imperialism, Auslin asserts that the Tokugawa shogunate did not actually understand how widespread and important the English language was in global trade. Their corpus of knowledge was tainted by a Dutch perspective and their willful ignorance of the rest of the world led to early Meiji scholars scrambling to learn English. On top of that, they had to process the many foreign ideas that the world intended to introduce to Japan - concepts such as extraterritoriality, or the complexity of nation state diplomacy.
In essence, translators already existed for Chinese, Korean, and Dutch, though limited in number and scope. Ambassadors often shared a dual role as scholars gathering information for the court/government post restoration.