Add formatList() to convert QStringLists to human readable strings.
This makes it possible to display strings like "A, B, C and D" natively in
all languages.
Details
- Reviewers
- None
- Group Reviewers
Frameworks
Added a test
Diff Detail
- Repository
- R244 KCoreAddons
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 1682 Build 1700: arc lint + arc unit
Tbh I don't fully understand the struct and find statments (just saw working similar code and edited-copy-pasted). I prefer if someone can continue this instead of me.
You should start with
a) a use case
b) show it actually matches the needs of different languages.
For e.g. englisch and the most european languages, two different positions are sufficent. Also, the AndListType and the UnitListType are identical. What is missing is a format where no conjunction is used, i.e. all lists elements are joined using ', '
a) Most of the uses I found is in PIM, where day names and people names are joined for a neat sentence. Maybe even email header renderer could use this. Other uses: KAlgebra and KTurtle. Maybe even KMyMoney with the print check function (representing the full text representation of the amount.)
Not a very strong use case, yes, but I thought this can be helpful.
b) I agree with this that most languages use 2 positions only. I prefered to do what Unicode is doing and provide all the three forms they provide, to be in the safe side.
And you can see in that document all the forms they have. I thought it will be an overkill to add them all. I've scanned most languages in Unicode and there isn't any difference between normal and shorter versions.
If you see that this could be useful, then great, let's develop it. Otherwise we can just ignore it till we find a good use case.