agateau / mup

A markup previewer
Other
39 stars 3 forks source link

fix python syntax #10

Closed CedricCabessa closed 8 years ago

CedricCabessa commented 8 years ago

I think the author do too much Qt ;-)

agateau-g commented 8 years ago

Hehe :) I think the self.tr() lines must stay this way: if I ever do the work to load translations, then Qt source strings must use %1...%n for placeholders, so that Linguist can warn if the placeholders are missing in the translated strings.

CedricCabessa commented 8 years ago

I seems that recent version of PyQt use python string and don't provide QString. So I don't know how to write something that linguist will understand... (the syntax used in this PR works, but as you said we loose the warning). But maybe I'm missing something...

agateau commented 8 years ago

Oh, so the code was not working anymore? Which version of PyQt are you using?

CedricCabessa commented 8 years ago

Yes doesn't work

Traceback (most recent call last):
  File "/home/ccabessa/workdir/mup/mup/history.py", line 81, in _updateBackForwardActions
    tip = self.tr("Go to %1").arg(str(item))
AttributeError: 'str' object has no attribute 'arg'

I'm using python3-qt5-5.6-4.fc24.x86_64 (fedora 24)

agateau commented 8 years ago

OK, let's merge it then. The placeholder topic can be revisited when translation support is added. Thanks for your work!