From 0ad97beed5825c5039ce9834a7085f88a60c5d03 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 6 Sep 2024 13:57:15 +0200 Subject: [PATCH] [locale] Use human-readable naming for messages --- src/modules/locale/Config.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index 8fa17a768..92f38cd5a 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -376,9 +376,16 @@ Config::setLCLocaleExplicitly( const QString& locale ) QString Config::currentLocationStatus() const { - return tr( "Set timezone to %1/%2", "@action" ) - .arg( m_currentLocation ? m_currentLocation->region() : QString(), - m_currentLocation ? m_currentLocation->zone() : QString() ); + if ( m_currentLocation ) + { + // See currentTimezoneName() which constructs the name with / + const auto region = m_regionModel->translated( m_currentLocation->region() ); + const auto zone = m_currentLocation->translated(); + + // TODO: 3.4 Use currentTimezoneName() and drop /%2 + return tr( "Set timezone to %1/%2", "@action" ).arg( region, zone ); + } + return QString(); } QString