Skip to content

Commit

Permalink
chat: fix crash at startup due to missing en_US translation (nomic-ai…
Browse files Browse the repository at this point in the history
…#2816)

Signed-off-by: Jared Van Bortel <[email protected]>
  • Loading branch information
cebtenzzre authored Aug 8, 2024
1 parent a910d65 commit 6957706
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions gpt4all-chat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ qt_add_qml_module(chat
)

if (GPT4ALL_TRANSLATIONS)
target_compile_definitions(chat PRIVATE GPT4ALL_USE_TRANSLATIONS)
qt_add_translations(chat
TS_FILES
${CMAKE_SOURCE_DIR}/translations/gpt4all_en_US.ts
Expand Down
2 changes: 2 additions & 0 deletions gpt4all-chat/mysettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ void MySettings::setLanguageAndLocale(const QString &bcp47Name)
else
locale = QLocale(l);

#ifdef GPT4ALL_USE_TRANSLATIONS
// If we previously installed a translator, then remove it
if (m_translator) {
if (!qGuiApp->removeTranslator(m_translator.get())) {
Expand Down Expand Up @@ -661,6 +662,7 @@ void MySettings::setLanguageAndLocale(const QString &bcp47Name)
m_translator.reset();
}
}
#endif

// Finally, set the locale whether we have a translation or not
QLocale::setDefault(locale);
Expand Down

0 comments on commit 6957706

Please sign in to comment.