The origin of the Jews of Lithuania has been a subject of much speculation. The first reliable document attesting the presence of Jews in the Grand Duchy of Lithuania is the charter of 1388 granting privileges to the Jews in Trakai. The gathering together of the scattered Jewish settlers in sufficient numbers and with enough power to form communities and to obtain privileges from their Lithuanian rulers implies the lapse of considerable time from the first migrations. Therefore, various historians attempted to claim that Jews migrated to Lithuania earlier. For example, Abraham Harkavy (1835–1919) claimed that the first Jews migrated in the 10th century from the Khazar Khaganate (see also Khazar hypothesis of Ashkenazi ancestry). Other historians claim that Jews migrated from Germany in the 12th century. German Jews were persecuted during the era of crusades. The traditional language of the vast majority of Jews of Lithuania, Yiddish, is based largely upon the Medieval German spoken by the western Germanic Jewish immigrants. Another theory is that Jews migrated during the reign of Grand Duke Gediminas (reigned 1316–1341) attracted by his invitation of merchants and craftspeople in 1323–1324 and economic opportunities – at the time, Lithuania had no cities in the western sense of the word, no Magdeburg Rights or closed guilds. In the 14th century, the Grand Duchy of Lithuania expanded into Galicia–Volhynia (see Galicia–Volhynia Wars) and the Principality of Kiev (see Battle on the Irpin River and Battle of Blue Waters), territories already inhabited by Jews. After the death of Casimir III (1370), the condition of the Polish Jews changed for the worse. The influence of the Roman Catholic clergy at the Polish court grew; Louis of Anjou was indifferent to the welfare of his subjects, and his eagerness to convert the Jews to Christianity, together with the increased Jewish immigration from Germany, caused the Polish Jews to become apprehensive for their future.