Bring locale improvments to 3.5.x

Improvements were made to the locales in https://github.com/ivaynberg/select2/pull/2285 that allowed them to be dynamically set.  The original pull request was aimed at 4.x, and this pull request brings them back to the 3.5.x cycle as well.

This will close #2278 after it has been reviewed and merged.