From 4996824ab100a3666a0420a52ee7f19bf009356e Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Fri, 12 Jul 2024 17:18:01 -0400 Subject: [PATCH] Replace hyphens with underscores and fix build. Signed-off-by: Adam Treat --- gpt4all-chat/mysettings.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gpt4all-chat/mysettings.cpp b/gpt4all-chat/mysettings.cpp index c80af29f..d89f6e32 100644 --- a/gpt4all-chat/mysettings.cpp +++ b/gpt4all-chat/mysettings.cpp @@ -581,7 +581,9 @@ QString MySettings::filePathForLocale(const QLocale &locale) { // Check and see if we have a translation for the chosen locale and set it if possible otherwise // we return the filepath for the 'en' translation - const QStringList uiLanguages = locale.uiLanguages(QLocale::TagSeparator::Underscore); + QStringList uiLanguages = locale.uiLanguages(); + for (int i = 0; i < uiLanguages.size(); ++i) + uiLanguages[i].replace('-', '_'); // Scan this directory for files named like gpt4all_%1.qm that match and if so return them first // this is the model download directory and it can be used by translation developers who are