mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-01 12:08:12 +00:00
Qt: filter for rpcs3_*.qm files when enumerating languages
This commit is contained in:
parent
f115032095
commit
3de0f042c6
@ -239,15 +239,22 @@ QStringList gui_application::GetAvailableLanguageCodes()
|
||||
if (QFileInfo(language_path).isDir())
|
||||
{
|
||||
const QDir dir(language_path);
|
||||
const QStringList filenames = dir.entryList(QStringList("*.qm"));
|
||||
const QStringList filenames = dir.entryList(QStringList("rpcs3_*.qm"));
|
||||
|
||||
for (const auto& filename : filenames)
|
||||
for (const QString& filename : filenames)
|
||||
{
|
||||
QString language_code = filename; // "rpcs3_en.qm"
|
||||
language_code.truncate(language_code.lastIndexOf('.')); // "rpcs3_en"
|
||||
language_code.remove(0, language_code.indexOf('_') + 1); // "en"
|
||||
|
||||
language_codes << language_code;
|
||||
if (language_codes.contains(language_code))
|
||||
{
|
||||
gui_log.error("Found duplicate language '%s' (%s)", language_code.toStdString(), filename.toStdString());
|
||||
}
|
||||
else
|
||||
{
|
||||
language_codes << language_code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user