Fix Python 3.7 DeprecationWarning use local.format_string() messages

Fix by replacing locale.format() with locale.format_string().
This commit is contained in:
Curtis Gedak 2018-11-10 12:28:19 -07:00
parent 7f592bae41
commit 60b58d9658
3 changed files with 8 additions and 8 deletions

View file

@ -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

View file

@ -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

View file

@ -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):