mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-06 07:05:04 -06:00
Qt: include territory in language menu labels
When translation files include country variants (pt_BR, zh_CN, zh_TW), the language dropdown now shows "Portuguese (Brazil)" instead of just "Portuguese", and "Chinese (Simplified)" instead of just "Chinese". Fixes #18215
This commit is contained in:
parent
3c2815e89c
commit
be30860a47
@ -2298,11 +2298,13 @@ void main_window::UpdateLanguageActions(const QStringList& language_codes, const
|
|||||||
{
|
{
|
||||||
const QLocale locale = QLocale(code);
|
const QLocale locale = QLocale(code);
|
||||||
const QString locale_name = QLocale::languageToString(locale.language());
|
const QString locale_name = QLocale::languageToString(locale.language());
|
||||||
|
const QString territory = QLocale::territoryToString(locale.territory());
|
||||||
|
const QString display_name = territory.isEmpty() ? locale_name : QString("%1 (%2)").arg(locale_name, territory);
|
||||||
|
|
||||||
// create new action
|
// create new action
|
||||||
QAction* act = new QAction(locale_name, this);
|
QAction* act = new QAction(display_name, this);
|
||||||
act->setData(code);
|
act->setData(code);
|
||||||
act->setToolTip(locale_name);
|
act->setToolTip(display_name);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setChecked(code == language_code);
|
act->setChecked(code == language_code);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user