myzinsky / cloudLogOffline

An App as Offline Frontend for CloudLog
GNU Lesser General Public License v3.0
17 stars 7 forks source link

Reliable translation switching for PageDrawer #94

Closed dg0yt closed 4 months ago

dg0yt commented 7 months ago

Translate the UI, not the list model.

Without this change, some menu items immediately followed the language setting but others didn't, on Linux desktop, Qt 6.6.1.

This is the suggested pattern in https://doc.qt.io/qt-6/i18n-source-translation.html#mark-translatable-data-text-strings. However, I could not make the proposed qsTrNoOp work, and qsTr is used in a different (translation) context, so the desired context has to be handled explicitly in the ItemDelegate

dg0yt commented 4 months ago

This is the suggested pattern in https://doc.qt.io/qt-6/i18n-source-translation.html#mark-translatable-data-text-strings. However, I could not make the proposed qsTrNoOp work, and qsTr is used in a different (translation) context, so the desired context has to be handled explicitly in the ItemDelegate

Okay, they noticed the problem and removed the qsTrNoOp example a few days ago: https://bugreports.qt.io/browse/QTBUG-124657.

But the actual problem was an indirection via a JS function which decoupled the display text binding from UI language changes.