Don’t concatenate strings
There are many reasons you should never split sentences.
I found a few strings that are built by concatenation and that will cause problems with some languages.
src/ui/backup_status.rs
has a call to utils::duration::ago()
in a formatted string "Successful Integrity Check {}"
. Some languages may work differently and not have “n minutes ago" as a single pack of words, and may need to put words in several places in the sentence. Even in English, this seems to result in inconsistent capitalization (with most of the string being Title Case and “minute ago” being lowercase). I see two solutions, depending on the result you want to get:
- You keep what you currently have and just add a colon so the string becomes
"Successful Integrity Check: {}"
. Capitalization would still have to be checked. - A more substantial change, you tweak the code so the string becomes
"Successful Integrity Check {} minutes ago"
. This requires putting all the variations you have inutils
to be moved here.
Another problematic example of concatenated string is with the utils::duration::left()
call in the same file. " - {}"
may work in English, but will break RTL languages. I may be incorrect because I am not familiar enough with your code, but it looks like you are building something akin to "{sub} - {left}"
which would be better as it allows reordering. It may still be problematic. The bullet proof solution would be, once more, to build the full strings here with all variations. So formatting "{} % finished - {} minutes left"
etc.
There are probably other cases, as src/utils/duration.rs
has a couple more functions, but I’m stopping my analysis here as the above examples should be enough to provide you with guidelines to fix the situation.
Cheers.