Commit 9a51a371708a118e459c0b4d4153bfa0171c46d2
Make sure locale C gets marked as active in generalsettings
Reviewed-by: Daniel Molkentin
| |   |
| 86 | 86 | |
| 87 | 87 | void GeneralSettings::fillLanguageBox() const |
| 88 | 88 | { |
| const QString currentLocale = language(); |
|
| 89 | 91 | m_page->languageBox->addItem(tr("<System Language>"), QString()); |
| 90 | 92 | // need to add this explicitly, since there is no qm file for English |
| 91 | 93 | m_page->languageBox->addItem(QLatin1String("English"), QLatin1String("C")); |
| if (currentLocale == QLatin1String("C")) |
| m_page->languageBox->setCurrentIndex(m_page->languageBox->count() - 1); |
| 92 | 96 | |
| 93 | 97 | const QString creatorTrPath = |
| 94 | 98 | Core::ICore::instance()->resourcePath() + QLatin1String("/translations"); |
| 95 | 99 | const QStringList languageFiles = QDir(creatorTrPath).entryList(QStringList(QLatin1String("*.qm"))); |
| const QString currentLocale = language(); |
| 97 | 100 | |
| 98 | 101 | Q_FOREACH(const QString &languageFile, languageFiles) |
| 99 | 102 | { |
| … | … | |
| 108 | 108 | m_page->languageBox->addItem(QLocale::languageToString(QLocale(locale).language()), locale); |
| 109 | 109 | if (locale == currentLocale) |
| 110 | 110 | m_page->languageBox->setCurrentIndex(m_page->languageBox->count() - 1); |
|
| 112 | 111 | } |
| 113 | 112 | } |
| 114 | 113 | } |