VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main')
-rw-r--r--src/Main/Forms/PreferencesDialog.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Main/Forms/PreferencesDialog.cpp b/src/Main/Forms/PreferencesDialog.cpp
index a610987d..4e7644b6 100644
--- a/src/Main/Forms/PreferencesDialog.cpp
+++ b/src/Main/Forms/PreferencesDialog.cpp
@@ -130,13 +130,22 @@ namespace VeraCrypt
if (wxDir::Exists(languagesFolder.GetName())) {
size_t langCount;
- langCount = wxDir::GetAllFiles(languagesFolder.GetName(), &langArray, wxEmptyString, wxDIR_FILES);
+ langCount = wxDir::GetAllFiles(languagesFolder.GetName(), &langArray, "*.xml", wxDIR_FILES);
for (size_t i = 0; i < langCount; ++i) {
wxFileName filename(langArray[i]);
- wxString langId = filename.GetName().AfterLast('.');
- wxString langNative = langEntries[langId];
- if (!langNative.empty()) {
- LanguageListBox->Append(langNative);
+
+ // Get the name part of the file (without extension)
+ wxString basename = filename.GetName();
+
+ // Check if the basename matches the pattern "Language.langId"
+ if (basename.StartsWith("Language.")) {
+ wxString langId = basename.AfterFirst('.');
+
+ // Verify if the language ID exists in langEntries map
+ wxString langNative = langEntries[langId];
+ if (!langNative.empty()) {
+ LanguageListBox->Append(langNative);
+ }
}
}
}