Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Details
There are actually two problems.
Building Translated Texts
Building translated strings should be avoided. Example:
The problem is that the translator does not see the whole text and the translated parts then might not fit well together.
Another problem is that the text around might change the context and the injected message might need a different translation. But in this case that is not possible.
It is better to always use the full texts. It might seem annoying to have several similar strings but more important is that the translator has full control for the final text and each of them can be translated slightly differently if needed.
Wrongly Used Plural Form
This is a more serious problem. The code displays a different text for LVM with a single PV and a different text for LVM with multiple PV. That makes sense, if there is one PV we can display it in the text, but there can be a dozen of PVs and then the text would be too long.
But the problem is that it used a gettext plural form
n_()
function for that logic.Then gettext complains about the different number of format specifiers. But the real problem is elsewhere.
num
>= 2!!When using
n_()
function both texts should be the same, the only difference should be singular/plural form for some words!Solution
Refactor the code to use the simple
_()
translation and put the logic into the code.Testing
Screenshots