Cerys on the Mabinogion

“Sindarin”, the usual form of Elvish in the books is based on Welsh in sound of the words. The patterns of consonants and vowels are based on Welsh, producing words which -well, sound like Welsh! Quite purposefully by Tolkien, who was struck by the beauty of Welsh words.

To some extent the grammar of the language is also influenced by Welsh, and to a lesser extent the actual vocabulary. For example, the writing on the doors of Moria is-

“Ennyn Durin Aran Moria. Pedo Mellon a Minno. Im Narvi hain echant. Celebrimbor o Eregion teithant i thiw hin.”

“Doors of Durin, Lord of Moria.” The Welsh way of forming a genetic construction, a Welsh way of pluralising “annon”, door.
“Speak friend, and enter”. “A” for and, but similarish to Welsh in the rest of it.
“Celebrimbor of Eregion made these things”- the other form of the Welsh genetic construction, an existing Welsh verbal ending (if not first person singular), a Welsh way of bracketing a word with “y…hyn” to mean “these”.

You even get trilingual puns which cross the fantasy and real world- “iar” in Sindarin means “old”.
Because, of course, “iâr” in Welsh means “hen”, and the Welsh word “hen” means “old”. Geddit? I assure you it is very, very funny.

“Quenya”, a form of Elvish which appears less in the books, was apparently based (to some degree, I know not how much!) on Finnish.