Translation in Qt5 (placeholders)

Chusslove Illich caslav.ilic at
Sat Jul 9 19:17:15 BST 2011

I forgot to address this:

>> [: Oswald Buddenhagen :]
>> even more wrong when you cut characters while you have a pixel width and
>> a proportional font. you wouldn't believe how hard it is to convince
>> certain nokians of this rather obvious reality ... :} anyway, more valid
>> use cases [for in-string formatting] are:
>>   - choosing a less/more verbose date format
>>   - using less padding, thus trading truncation for risk of misalignment
>>   - choosing a digit style depending on context (think arabian 6)

As you would say, I am not convinced :)

Stealing from arguments to save on space is just about nuts. Argument
padding to fit into width, for example, is 100% one of those things that
should be handled by the code.

The date format should be as succint as possible to provide sufficient
information in the original too. So there should be nothing left to shorten.

Digit style should be dependent on locale.

But fine. I could agree to supporting :* formatting extension, provided that
that its use is clearly discouradged in normal circumstances. Internally,
the extension would just be passed to the appropriate subs() method, e.g.
these two are equivalent:

  ki18n("Amount of foo: {amount}").subs("amount", amountFoo, "10.4f")
  ki18n("Amount of foo: {amount:10.4f}").subs("amount", amountFoo)

When validating translation, the general validator for the translation file
format (msgfmt --check for PO) would just ignore the formatting extension;
if translators tweak it, they are on their own. Environment/project-specific
translation validators can do whatever they want.

Chusslove Illich (Часлав Илић)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <>

More information about the kde-core-devel mailing list