mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-04 13:55:23 -05:00
qt6: Handle deprecated QLocale::nativeCountryName
This change ensures compatibility across all supported Qt versions.
This commit is contained in:
parent
d812cf1189
commit
9123a286e9
1 changed files with 9 additions and 2 deletions
|
@ -169,8 +169,15 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
|||
/** check if the locale name consists of 2 parts (language_country) */
|
||||
if(langStr.contains("_"))
|
||||
{
|
||||
/** display language strings as "native language - native country (locale name)", e.g. "Deutsch - Deutschland (de)" */
|
||||
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") + locale.nativeCountryName() + QString(" (") + langStr + QString(")"), QVariant(langStr));
|
||||
/** display language strings as "native language - native country/territory (locale name)", e.g. "Deutsch - Deutschland (de)" */
|
||||
ui->lang->addItem(locale.nativeLanguageName() + QString(" - ") +
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0))
|
||||
locale.nativeTerritoryName() +
|
||||
#else
|
||||
locale.nativeCountryName() +
|
||||
#endif
|
||||
QString(" (") + langStr + QString(")"), QVariant(langStr));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue