Repository navigation
Fix incorrect parsing of translation strings - #1168
Conversation
|
Urks, we run lupdate without cmake, maybe we should change that? https://github.com/opencloud-eu/desktop/blob/main/.woodpecker/translation.yaml#L21 |
6de5676 to
747fa4a
Compare
For future reference: I tried using the canonical CMake-based workflow, and came to the conclusion that it's fundamentally flawed. Since it just scans CMake targets, all files that contain translation strings that were excluded during configuration (e.g. platform-specific files) will not be included in the final .ts file, since they were not added to any target for the local build. |
747fa4a to
14fba12
Compare
81ab6d0 to
e691f73
Compare
It seems that lupdate gets confused by some includes that omit the src/ at the beginning of the path (e.g. in accountconfiguredsetupwizardstate.cpp), which results in the ts file output not containing the namespace. This would then break string lookup at runtime, resulting in the string not being shown translated to the user. This adds: - A new CMake script that calls lupdate with an added "-I src" argument, which adds the src folder as an extra include path. - A call to that script in the woodpecker file - A CMake target 'update_translations' that directly runs the script with the correct output file inside the source tree - A new test case that runs the script without modifying the sources, and runs with the -warnings-are-errors switch to catch future problems like this
e691f73 to
76fc5de
Compare
|
Looks good, let's see what the translation job will do tonight. |
It seems that lupdate gets confused by some includes that
omit the src/ at the beginning of the path (e.g. in
accountconfiguredsetupwizardstate.cpp), which results in
the ts file output not containing the namespace. This would
then break string lookup at runtime, resulting in the string
not being shown translated to the user.
This commit modifies the woodpecker file containing the lupdate
command to add a "-I src" argument, which adds the src folder as
an extra include path. Also adds a CMake-based test that runs the
same command, but with the -warnings-are-errors argument, which
should help catch any future issues of the same kind.
Fixes #654