I'm not a programmer but to me it seems perfectly logical that as already stated, versions of a program would be developed for each locale, so there will subtle changes in coding for say the USA, to the UK and both could well be different to say Spain and then again all be different to the requirements for China and Africa. I'm not talking about the various national languages, but different in the respect that each country might phrase certain things, such as the date format, post codes for instance vary greatly in both structures and length between countries.
Generally speaking data is inputted manually in the first instance, either by the person who owns the data / information that is being inputted or by an operator, say a shop assistant entering a customers order etc, so it becomes their responsibility to input the data correctly. Secondly the software being used should be error trapped to flag up an unexpected format being entered in a data field that expects a certain style of input and flag up the error to the inputter.
Surely these blocks of code do this sort of thing are as has been mentioned jelly bean blocks of code, or as I remember them from my early attempts at programming many years ago for a personal use, sub routines, that the main code can call up as required.
It surely is not an impossible task either for when huge blocks of data from many locales have to be brought together, in something like law enforcement databases that many countries share, the software on the main database, can instantly recognise data from China or France etc and instantly seek out the locale formats and rearrange it into a format suitable to be merged and when data flows back in the reverse direction, the software in that country does the same thing in reverse to suit the locale.??
I always thought that computers were meant to make life easier for us, not to make us all think alike and format everything in the same fashion a computer wants it to be?
This is why skilled programmers can earn such huge amounts, because they can develop the code and to test rigorously to make things happen seamlessly in the background, bad programmers will take shortcuts and hence why we have so many glitches happen because they don't take the care that they should do.
As I said, I'm not a coder/programmer, and I'm not taking sides here but commenting as I see things as a bystander, in much the same way as, wouldn't it be far better to make everyone in the world all speak the same language so there are no communication barriers? That would make coding far simpler, wouldn't it?