From kde-i18n-doc Mon Oct 29 18:02:33 2012 From: Albert Astals Cid Date: Mon, 29 Oct 2012 18:02:33 +0000 To: kde-i18n-doc Subject: Re: Multiple plural arguments Message-Id: <2165850.KvoMOgSaAJ () xps> X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=135153377931061 El Diumenge, 28 d'octubre de 2012, a les 20:19:44, Kevin Krammer va escriure: > Hi there! > > Over at http://git.reviewboard.kde.org/r/107021/ we are discussing how to > best handle a case where the non-i18n handling would be a conditional > concatenation of strings. > > The string would ultimately be something like > "Comments: 5, Likes: 3" > or > "Comments: 5" (no likes > or > "Likes: 3" (no comments) > > This is currently done by conditionally appending ", " to the "Comments: > ..." string if comments and likes exist and then appending "Likes: ..." to > the result. > > Another option I suggested but which can probably be improved on as well is > to have three strings, i.e. > > i18n( "Comments: %1" ) > i18n( "Likes: %1" ) > i18n( "Comments: %1, Likes: %2" ) > and then selecting the appropriate one. > > While thinking a bit more about this I came across this variation: > i18np( "Comment:", "Comments:", numComments ) > i18np( "Like:", "Likes:", numLikes ) > i18nc( "Comment+Like merge pattern", "%1, %2" ) > > At this point I decided to go to the experts and ask them :) > > Any thoughts on this? This is a hard problem, for KLocale and hours + minutes translations we "solved" it like your second approach, have a look at KLocalePrivate::formatSingleDuration + KLocalePrivate::prettyFormatDuration Cheers, Albert > > Cheers, > Kevin