View Single Post
Old 10-03-2021, 06:36 AM   #24
un_pogaz
Chalut o/
un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.
 
un_pogaz's Avatar
 
Posts: 446
Karma: 672378
Join Date: Dec 2017
Device: Kobo
New version 1.4.1
Clean text full heading, but we don't care about that.

The real feature of this version is "[Fix] The text of progress dialog is correctly translated".
YES! FINALLY!!!
I finally found the origin of this bug that has been there since v1.0 without me managing to find its origin. The worst is that I have another plugin where this text is correctly translated, so where from? where you don't work HERE?!

In the end, such a stupid invalid cast thing that I still don't understand why Python doesn't work. But well, problem solved.


Here is the invalid code (where num and self.book_count as integer)
Code:
self.setLabelText(_('Book {0} of {1}').format(num, self.book_count))
...
.format() is applied after retrieving the translated text, the formatting is valid: Why the final text is not translated?

And here the 1000 IQ fix that makes the code work:
Code:
self.setLabelText(_('Book {:d} of {:d}').format(num, self.book_count))
Why does it work? no idea, but it work! I wouldn't be fooled twice by this kind of bullshit.

Last edited by un_pogaz; 10-04-2021 at 10:16 AM.
un_pogaz is offline   Reply With Quote