I do not know about the standard as such.
However, the algorithm used is a trivial consequence of the fact that locales are hierarchical. There is a (conditional) root locale with no name. Under this are only local languages ββ(en, fr, etc.). Below them are the national locales (en_GB, en_US, etc.). Below them are possibly locale options (en_GB_Yorkshire, en_GB_cockney, etc.) For realistic examples, look at Norway).
The natural way to find a suitable resource is to start from the lowest, most specific locale that you can, and go to the tree until you find something. So, starting with en_US_TX, you go to en_US, then en, then to the root.
source share