mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	citra_qt: Backport review comments from the yuzu translation PR (#5465)
This commit is contained in:
		
							parent
							
								
									f6b543886c
								
							
						
					
					
						commit
						f4be733355
					
				
					 4 changed files with 23 additions and 19 deletions
				
			
		|  | @ -25,7 +25,7 @@ Most of the development happens on GitHub. It's also where [our central reposito | ||||||
| 
 | 
 | ||||||
| If you want to contribute please take a look at the [Contributor's Guide](https://github.com/citra-emu/citra/wiki/Contributing) and [Developer Information](https://github.com/citra-emu/citra/wiki/Developer-Information). You should also contact any of the developers in the forum in order to know about the current state of the emulator because the [TODO list](https://docs.google.com/document/d/1SWIop0uBI9IW8VGg97TAtoT_CHNoP42FzYmvG1F4QDA) isn't maintained anymore. | If you want to contribute please take a look at the [Contributor's Guide](https://github.com/citra-emu/citra/wiki/Contributing) and [Developer Information](https://github.com/citra-emu/citra/wiki/Developer-Information). You should also contact any of the developers in the forum in order to know about the current state of the emulator because the [TODO list](https://docs.google.com/document/d/1SWIop0uBI9IW8VGg97TAtoT_CHNoP42FzYmvG1F4QDA) isn't maintained anymore. | ||||||
| 
 | 
 | ||||||
| If you want to contribute to the user interface translation, please checkout [citra project on transifex](https://www.transifex.com/citra/citra). We centralize the translation work there, and periodically upstream translation. | If you want to contribute to the user interface translation, please check out the [citra project on transifex](https://www.transifex.com/citra/citra). We centralize the translation work there, and periodically upstream translations. | ||||||
| 
 | 
 | ||||||
| ### Building | ### Building | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -223,8 +223,8 @@ target_sources(citra-qt | ||||||
|     PRIVATE |     PRIVATE | ||||||
|         ${COMPAT_LIST} |         ${COMPAT_LIST} | ||||||
|         ${ICONS} |         ${ICONS} | ||||||
|         ${THEMES} |  | ||||||
|         ${LANGUAGES} |         ${LANGUAGES} | ||||||
|  |         ${THEMES} | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if (APPLE) | if (APPLE) | ||||||
|  |  | ||||||
|  | @ -9,23 +9,7 @@ | ||||||
| 
 | 
 | ||||||
| ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureUi) { | ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureUi) { | ||||||
|     ui->setupUi(this); |     ui->setupUi(this); | ||||||
|     ui->language_combobox->addItem(tr("<System>"), QString{}); |     InitializeLanguageComboBox(); | ||||||
|     ui->language_combobox->addItem(tr("English"), QStringLiteral("en")); |  | ||||||
|     QDirIterator it(QStringLiteral(":/languages"), QDirIterator::NoIteratorFlags); |  | ||||||
|     while (it.hasNext()) { |  | ||||||
|         QString locale = it.next(); |  | ||||||
|         locale.truncate(locale.lastIndexOf(QLatin1Char{'.'})); |  | ||||||
|         locale.remove(0, locale.lastIndexOf(QLatin1Char{'/'}) + 1); |  | ||||||
|         QString lang = QLocale::languageToString(QLocale(locale).language()); |  | ||||||
|         ui->language_combobox->addItem(lang, locale); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     // Unlike other configuration changes, interface language changes need to be reflected on the
 |  | ||||||
|     // interface immediately. This is done by passing a signal to the main window, and then
 |  | ||||||
|     // retranslating when passing back.
 |  | ||||||
|     connect(ui->language_combobox, |  | ||||||
|             static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, |  | ||||||
|             &ConfigureUi::OnLanguageChanged); |  | ||||||
| 
 | 
 | ||||||
|     for (const auto& theme : UISettings::themes) { |     for (const auto& theme : UISettings::themes) { | ||||||
|         ui->theme_combobox->addItem(QString::fromUtf8(theme.first), |         ui->theme_combobox->addItem(QString::fromUtf8(theme.first), | ||||||
|  | @ -37,6 +21,25 @@ ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::Configur | ||||||
| 
 | 
 | ||||||
| ConfigureUi::~ConfigureUi() = default; | ConfigureUi::~ConfigureUi() = default; | ||||||
| 
 | 
 | ||||||
|  | void ConfigureUi::InitializeLanguageComboBox() { | ||||||
|  |     ui->language_combobox->addItem(tr("<System>"), QString{}); | ||||||
|  |     ui->language_combobox->addItem(tr("English"), QStringLiteral("en")); | ||||||
|  |     QDirIterator it(QStringLiteral(":/languages"), QDirIterator::NoIteratorFlags); | ||||||
|  |     while (it.hasNext()) { | ||||||
|  |         QString locale = it.next(); | ||||||
|  |         locale.truncate(locale.lastIndexOf(QLatin1Char{'.'})); | ||||||
|  |         locale.remove(0, locale.lastIndexOf(QLatin1Char{'/'}) + 1); | ||||||
|  |         const QString lang = QLocale::languageToString(QLocale(locale).language()); | ||||||
|  |         ui->language_combobox->addItem(lang, locale); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     // Unlike other configuration changes, interface language changes need to be reflected on the
 | ||||||
|  |     // interface immediately. This is done by passing a signal to the main window, and then
 | ||||||
|  |     // retranslating when passing back.
 | ||||||
|  |     connect(ui->language_combobox, qOverload<int>(&QComboBox::currentIndexChanged), this, | ||||||
|  |             &ConfigureUi::OnLanguageChanged); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void ConfigureUi::SetConfiguration() { | void ConfigureUi::SetConfiguration() { | ||||||
|     ui->theme_combobox->setCurrentIndex(ui->theme_combobox->findData(UISettings::values.theme)); |     ui->theme_combobox->setCurrentIndex(ui->theme_combobox->findData(UISettings::values.theme)); | ||||||
|     ui->language_combobox->setCurrentIndex( |     ui->language_combobox->setCurrentIndex( | ||||||
|  |  | ||||||
|  | @ -18,6 +18,7 @@ public: | ||||||
|     explicit ConfigureUi(QWidget* parent = nullptr); |     explicit ConfigureUi(QWidget* parent = nullptr); | ||||||
|     ~ConfigureUi() override; |     ~ConfigureUi() override; | ||||||
| 
 | 
 | ||||||
|  |     void InitializeLanguageComboBox(); | ||||||
|     void ApplyConfiguration(); |     void ApplyConfiguration(); | ||||||
|     void RetranslateUI(); |     void RetranslateUI(); | ||||||
|     void SetConfiguration(); |     void SetConfiguration(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue