Skip to content
Snippets Groups Projects
Commit 40527ffd authored by Adriaan de Groot's avatar Adriaan de Groot
Browse files

[locale] Be more chatty while matching locales

parent eb242168
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,14 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
LocaleNameParts best_match = others.last();
if ( !( self.similarity( best_match ) > LocaleNameParts::no_match ) )
{
cDebug() << Logger::SubEntry << "Got no good match for" << languageLocale;
best_match = LocaleNameParts {};
}
else
{
cDebug() << Logger::SubEntry << "Got best match for" << languageLocale << "as" << best_match.name();
}
// .. but it might match **better** with the chosen location country Code
if ( self.similarity( best_match ) < LocaleNameParts::complete_match )
{
......@@ -82,6 +88,8 @@ LocaleConfiguration::fromLanguageAndLocation( const QString& languageLocale,
if ( self_other_country.similarity( others.last() ) > self.similarity( best_match ) )
{
best_match = others.last();
cDebug() << Logger::SubEntry << "Found better match with country" << countryCode << "as"
<< best_match.name();
}
}
if ( best_match.isValid() )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment