mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-08 07:10:32 +00:00
chat: fix crash at startup due to missing en_US translation (#2816)
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
parent
a910d65755
commit
6957706af7
@ -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
|
||||
|
@ -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())) {
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user