mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-19 09:46:58 +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)
|
if (GPT4ALL_TRANSLATIONS)
|
||||||
|
target_compile_definitions(chat PRIVATE GPT4ALL_USE_TRANSLATIONS)
|
||||||
qt_add_translations(chat
|
qt_add_translations(chat
|
||||||
TS_FILES
|
TS_FILES
|
||||||
${CMAKE_SOURCE_DIR}/translations/gpt4all_en_US.ts
|
${CMAKE_SOURCE_DIR}/translations/gpt4all_en_US.ts
|
||||||
|
@ -632,6 +632,7 @@ void MySettings::setLanguageAndLocale(const QString &bcp47Name)
|
|||||||
else
|
else
|
||||||
locale = QLocale(l);
|
locale = QLocale(l);
|
||||||
|
|
||||||
|
#ifdef GPT4ALL_USE_TRANSLATIONS
|
||||||
// If we previously installed a translator, then remove it
|
// If we previously installed a translator, then remove it
|
||||||
if (m_translator) {
|
if (m_translator) {
|
||||||
if (!qGuiApp->removeTranslator(m_translator.get())) {
|
if (!qGuiApp->removeTranslator(m_translator.get())) {
|
||||||
@ -661,6 +662,7 @@ void MySettings::setLanguageAndLocale(const QString &bcp47Name)
|
|||||||
m_translator.reset();
|
m_translator.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Finally, set the locale whether we have a translation or not
|
// Finally, set the locale whether we have a translation or not
|
||||||
QLocale::setDefault(locale);
|
QLocale::setDefault(locale);
|
||||||
|
Loading…
Reference in New Issue
Block a user