mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-17 11:22:28 +12:00
Fix Python 3.7 DeprecationWarning use local.format_string() messages
Fix by replacing locale.format() with locale.format_string().
This commit is contained in:
parent
7f592bae41
commit
60b58d9658
|
@ -224,12 +224,12 @@ class outlineItem(abstractItem):
|
|||
wc = 0
|
||||
if goal:
|
||||
return qApp.translate("outlineItem", "{} words / {} ({})").format(
|
||||
locale.format("%d", wc, grouping=True),
|
||||
locale.format("%d", goal, grouping=True),
|
||||
locale.format_string("%d", wc, grouping=True),
|
||||
locale.format_string("%d", goal, grouping=True),
|
||||
"{}%".format(str(int(progress * 100))))
|
||||
else:
|
||||
return qApp.translate("outlineItem", "{} words").format(
|
||||
locale.format("%d", wc, grouping=True))
|
||||
locale.format_string("%d", wc, grouping=True))
|
||||
|
||||
#######################################################################
|
||||
# Tools: split and merge
|
||||
|
|
|
@ -318,12 +318,12 @@ class mainEditor(QWidget, Ui_mainEditor):
|
|||
del p
|
||||
self.lblRedacProgress.setPixmap(self.px)
|
||||
self.lblRedacWC.setText(self.tr("{} words / {} ").format(
|
||||
locale.format("%d", wc, grouping=True),
|
||||
locale.format("%d", goal, grouping=True)))
|
||||
locale.format_string("%d", wc, grouping=True),
|
||||
locale.format_string("%d", goal, grouping=True)))
|
||||
else:
|
||||
self.lblRedacProgress.hide()
|
||||
self.lblRedacWC.setText(self.tr("{} words ").format(
|
||||
locale.format("%d", wc, grouping=True)))
|
||||
locale.format_string("%d", wc, grouping=True)))
|
||||
|
||||
###############################################################################
|
||||
# VIEWS
|
||||
|
|
|
@ -349,8 +349,8 @@ class welcome(QWidget, Ui_welcome):
|
|||
total = 0
|
||||
|
||||
self.lblTotal.setText(self.tr("<b>Total:</b> {} words (~ {} pages)").format(
|
||||
locale.format("%d", total, grouping=True),
|
||||
locale.format("%d", total / 250, grouping=True)
|
||||
locale.format_string("%d", total, grouping=True),
|
||||
locale.format_string("%d", total / 250, grouping=True)
|
||||
))
|
||||
|
||||
def addTopLevelItem(self, name):
|
||||
|
|
Loading…
Reference in a new issue