From 40527ffd4e6585038ac9cbbe3e75853a7b6fd6e0 Mon Sep 17 00:00:00 2001
From: Adriaan de Groot <groot@kde.org>
Date: Mon, 22 Aug 2022 23:48:21 +0200
Subject: [PATCH] [locale] Be more chatty while matching locales

---
 src/modules/locale/LocaleConfiguration.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/modules/locale/LocaleConfiguration.cpp b/src/modules/locale/LocaleConfiguration.cpp
index ac54524566..c7db10af1f 100644
--- a/src/modules/locale/LocaleConfiguration.cpp
+++ b/src/modules/locale/LocaleConfiguration.cpp
@@ -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() )
-- 
GitLab