[locale] Prefer non-empty country matches
Prefer "en_US" over "en" even when asking for "en".
This commit is contained in:
parent
a422fd80d9
commit
3540121449
@ -84,7 +84,7 @@ LocaleNameParts::similarity( const LocaleNameParts& other ) const
|
||||
return 0;
|
||||
}
|
||||
const auto matched_region = ( region == other.region ? 30 : 0 );
|
||||
const auto matched_country = ( country == other.country ? 20 : 0 );
|
||||
const auto matched_country = ( country == other.country ? ( country.isEmpty() ? 10 : 20 ) : 0 );
|
||||
const auto no_other_country_given = ( ( country != other.country && other.country.isEmpty() ) ? 10 : 0 );
|
||||
return 50 + matched_region + matched_country + no_other_country_given;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user