From 7cc2b222d93df33b65144c99b3c373b3f3bb111b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 19 Apr 2018 07:30:54 -0400 Subject: [PATCH] [welcome] Present RTL (country) annotations better - The (RTL) text "Arabiy (Misr)" should be entirely RTL, so make the parenthetical insert -- which would otherwise be LTR and so mess up the placing of those parenthesis around the country -- explicitly RTL. - Since there are no RTL languages in Calamares right now with country-local translations, this isn't visible. --- src/modules/welcome/WelcomePage.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/welcome/WelcomePage.cpp b/src/modules/welcome/WelcomePage.cpp index 46041e063..48f5e5f1c 100644 --- a/src/modules/welcome/WelcomePage.cpp +++ b/src/modules/welcome/WelcomePage.cpp @@ -145,7 +145,11 @@ struct LocaleLabel { sortKey.append( QString( " (%1)" ) .arg( QLocale::countryToString( thisLocale.country() ) ) ); - label.append( QString( " (%1)" ).arg( thisLocale.nativeCountryName() ) ); + + // If the language name is RTL, make this parenthetical addition RTL as well. + QString countryFormat = label.isRightToLeft() ? QString( QChar( 0x202B ) ) : QString(); + countryFormat.append( QLatin1String( " (%1)" ) ); + label.append( countryFormat.arg( thisLocale.nativeCountryName() ) ); } m_sortKey = sortKey;