def square(x: Int): Int = x * x
should get hashed (and if it has dependencies, they should get hashed in there, too), and your programming language should track the unique identity of this function, and keep a list of names separately from the hashes.
This totally solves the localization problem: you can just write localizations in one place, and whenever you need to represent them, use the hash to look up your representation. This lets everyone (compatibly) name their functions/variables whatever they want.
Less intuitively, it also basically removes the need for builds. Every function has a verifiable unique identity, so your compiler can tell with 100% certainty whether or not something needs to be rebuilt. When you modify a function, it changes the hash, so you end up with both the old and the new function. Any code which requires the old function can still access it.
This has been implemented in the Unison programming language (https://unisonweb.org/) which is very much in alpha. I don't know if there are other platforms implementing it.
It is so elegant and freeing. I am really stoked for the future of programming languages, when localization is just a matter of translating some words.