I decided to ignore `file://localhost` support because either both `valid()` and `translate()` need to check for it, or the interplay between the function needs to change or merge.  I couldn't come up with something clean enough to support it in the few minutes I tried.  I'm willing to try again if you think it's worth it.