This is a post recommending utilizing Moodle menus as opposed to writing your own code. If you prefer to customize your site in a manner that upgrading becomes nigh on impossible, please, do so without leaving a comment or reading further.
I had an amusing time reading the posts of folks who have hacked the PHP code, and brilliantly, they really can code elegantly, in various places to modify the sign in screen to replace “Surname” which is English (think across the water in either direction) with “Last Name” which is the US English version of what is required in that field. Some of these hacks were worth seeing just to learn how simply one can change a great deal of code. In addition, they were accurate and changed with various versions of Moodle.
HOWEVER, for all of the versions I read there was also an answer in the Moodle documentation. Maybe it is that the answer references Language Packs and that deters folks. I will argue that making a change that uses Moodle in a standard format does make updating much easier and straightforward, and well, as you might imagine, also fixes other language issues.
If you are running a US site, in version 3.1.1+ (the documentation references v2.7 on) one simply goes to Site Administration –> Language –> Language packs and installs the EN_US version of English and then sets it as the site default …