Summary: | LabPlot crashes when creating a new spreadsheet from the "Import Data from File" dialog and the UI language is Simplified Chinese (zh_CN) | ||
---|---|---|---|
Product: | [Applications] LabPlot2 | Reporter: | Huanyu Liu <1293660441> |
Component: | frontend | Assignee: | Stefan Gerlach <stefan.gerlach> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | stefan.gerlach |
Priority: | NOR | ||
Version First Reported In: | 2.10.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/education/labplot/-/commit/6441b45561038c9887783670b370bed46e716eb2 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | A mess of Greek, English (green rectangles) and Chinese (red rectangles) |
Description
Huanyu Liu
2024-05-26 11:20:25 UTC
Additional information: This crash will not trigger DrKonqi, so it is necessary to get the backtrace by GDB manually (In reply to Huanyu Liu from comment #1) > Additional information: This crash will not trigger DrKonqi, so it is > necessary to get the backtrace by GDB manually Would it be possible for you to re-check with the current development version please? (In reply to Alexander Semke from comment #2) > (In reply to Huanyu Liu from comment #1) > > Additional information: This crash will not trigger DrKonqi, so it is > > necessary to get the backtrace by GDB manually > > Would it be possible for you to re-check with the current development > version please? I re-checked with the Nightly AppImage Build f17356b (May 19 2024, 10:37:08). Unfortunately, LabPlot still crashes. What's more terrible, the translation handling in the Nightly Build version of LabPlot is a total mess. I run the Nightly Build version of LabPlot with environment variable `LANGUAGE=el` (so the UI language should be Greek), and the result is a mess of Greek (selected), English (a natural fallback) and Chinese (my system language) (see the attached screenshot). The UI language can only be changed in this way; "Settings → Configure Language..." has no effect. Furthermore, as long as the "New Spreadsheet" button is displayed as "新建数据表" (zh_CN; also with a few other languages) or "新增試算表" (zh_TW), LabPlot will crash after clicking on it, regardless of the actual language settings. Created attachment 169969 [details]
A mess of Greek, English (green rectangles) and Chinese (red rectangles)
The translation issue is now fix in the development version. The Appimage is updated. I did a further test using the latest Nightly Version (Build a5a7619, Jun 30 2024, 15:54:56). The crash is still there, and is exclusive to Simplified Chinese (zh_CN) and Traditional Chinese (zh_TW). Any other languages (regardless of translation status) are working fine. Git commit df131b2215edd9add7212d71e2eefd21611ff866 by Stefan Gerlach. Committed on 01/07/2024 at 20:58. Pushed by sgerlach into branch 'master'. Fix Crash splitting translated string M +2 -2 src/kdefrontend/datasources/ImportDialog.cpp https://invent.kde.org/education/labplot/-/commit/df131b2215edd9add7212d71e2eefd21611ff866 After looking through commit df131b2215edd9add7212d71e2eefd21611ff866, it looks like LabPlot is relying on the structure of certian expressions in a language, which is a very bad practice in my opinion. For example, originally, LabPlot split the string by space and took the second part as the "type name", while Chinese (and Japanese, though untranslated) does not use spaces to separate words, so it crashed. In French, "New Spreadsheet" is translated as "Nouvelle feuille de calcul", where "feuille de calcul" as a whole means "spreadsheet", so "Spreadsheet name" became "Nom de feuille" (and will become "Nom de calcul" with the committed workaround, still incorrect). There are also some languages in which verbs are placed after objects (e.g. Japanese). So I think a refactor of type handling of the import dialog is necessary. (Disclaimer: I am not an expert in French) Git commit 6441b45561038c9887783670b370bed46e716eb2 by Stefan Gerlach. Committed on 02/07/2024 at 14:32. Pushed by sgerlach into branch 'master'. Fix using translated strings in new container dialog M +14 -4 src/kdefrontend/datasources/ImportDialog.cpp https://invent.kde.org/education/labplot/-/commit/6441b45561038c9887783670b370bed46e716eb2 |