I know that it will probably not be possible to localize every single error message (especially the very low-level ones at the beginning of the script).

So where I can start translating depends heavily on where I will get the language from. We can either use the default board language or, since we now have a user ID provided (except for SQLite, which will again be difficult), just use the executing admin's language.