system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Wars] If Ewoks were a primitive species on a remote world with no contact with the Empire, how did C-3PO know their language?
gpt
Assuming no contact with the Empire is a bit of a stretch given that the Empire selected that world for final construction of the second Death Star.  
More realistically, the Empire picked that world from the Republic archives, which means Republic scientists, and most likely anthropologists, had been to Endor and studies the local life forms in some depth.  
With over six million forms of communication under his belt, it's not hard to imagine that C-3P0 incorporated the data from the Republic archives concerning Ewokese.