Support non-duplicative sublocales (pt_BR, en_GB, etc.)

Two parts:
 (1) Read support
 (2) Write support

Write support relies on rewriting pt-br to pt_BR and sorting it to the
top of the switch (as it is intended to be more specific than pt).

Read support is simply a case of rewriting pt_BR to pt-br.

Broken if a manual edit has introduced pt_PT, en_US system languages --
because Translate doesn't understand that "en-us" and "en" are synonymous.

Change-Id: Ic274351887bd0f72b33a9437e2b23ffae4ce3fb9
Merge "Support non-duplicative sublocales (pt_BR, en_GB, etc.)"