"May God enlarge Japheth" (Genesis 9:27) — He enlarges his land for him. Another interpretation: the comeliness of Japheth — this refers to the Greek language. "And let him dwell in the tents of Shem" — that a Torah scroll is permitted to be written in Greek. Another interpretation: "May God enlarge Japheth" — this is Cyrus, who ruled over the whole world. And why so? Because he built the house of Shem, which is the Temple — to teach you that the Shekhinah dwells only in the portion of Shem. And because Cyrus, that is to say, was the one who commanded that it — the Temple — be built, and Darius built it, therefore the Shekhinah did not dwell in it. Another interpretation: "And let him dwell in the tents of Shem" — that he made it [his dwelling], as it is said, "And Melchizedek king of Salem, etc." (Genesis 14:18).
Why God Enlarged Japheth and Cyrus Built the Tents of Shem
Midrash Aggadah, Genesis 9:27
יפת אלהים ליפת. יפת לו ארצו: ד"א יפיותו של יפת, והוא לשון יוני, והוא ישכון באהלי שספר תורה מותרת לכתבה יוונית: ד"א יפת אלהים ליפת. זה כורש שמלך על כל העולם, ולמה כך, לפי שהוא בנה ביתו של שם והוא בית המקדש, ללמדך שאין השכינה שורה אלא בחלקו של שם, ולפי שכורש שצוה לבנותו ר"ל בית המקדש ודריוש בנאו, לפיכך לא שרתה בו שכינה: ד"א וישכון באהלי שם. שעשהו בהו, שנאמר ומלכי צדק מלך שלם וגו' (בראשי' יד יח):