mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-15 01:14:34 +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
|
wc = 0
|
||||||
if goal:
|
if goal:
|
||||||
return qApp.translate("outlineItem", "{} words / {} ({})").format(
|
return qApp.translate("outlineItem", "{} words / {} ({})").format(
|
||||||
locale.format("%d", wc, grouping=True),
|
locale.format_string("%d", wc, grouping=True),
|
||||||
locale.format("%d", goal, grouping=True),
|
locale.format_string("%d", goal, grouping=True),
|
||||||
"{}%".format(str(int(progress * 100))))
|
"{}%".format(str(int(progress * 100))))
|
||||||
else:
|
else:
|
||||||
return qApp.translate("outlineItem", "{} words").format(
|
return qApp.translate("outlineItem", "{} words").format(
|
||||||
locale.format("%d", wc, grouping=True))
|
locale.format_string("%d", wc, grouping=True))
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Tools: split and merge
|
# Tools: split and merge
|
||||||
|
|
|
@ -318,12 +318,12 @@ class mainEditor(QWidget, Ui_mainEditor):
|
||||||
del p
|
del p
|
||||||
self.lblRedacProgress.setPixmap(self.px)
|
self.lblRedacProgress.setPixmap(self.px)
|
||||||
self.lblRedacWC.setText(self.tr("{} words / {} ").format(
|
self.lblRedacWC.setText(self.tr("{} words / {} ").format(
|
||||||
locale.format("%d", wc, grouping=True),
|
locale.format_string("%d", wc, grouping=True),
|
||||||
locale.format("%d", goal, grouping=True)))
|
locale.format_string("%d", goal, grouping=True)))
|
||||||
else:
|
else:
|
||||||
self.lblRedacProgress.hide()
|
self.lblRedacProgress.hide()
|
||||||
self.lblRedacWC.setText(self.tr("{} words ").format(
|
self.lblRedacWC.setText(self.tr("{} words ").format(
|
||||||
locale.format("%d", wc, grouping=True)))
|
locale.format_string("%d", wc, grouping=True)))
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# VIEWS
|
# VIEWS
|
||||||
|
|
|
@ -349,8 +349,8 @@ class welcome(QWidget, Ui_welcome):
|
||||||
total = 0
|
total = 0
|
||||||
|
|
||||||
self.lblTotal.setText(self.tr("<b>Total:</b> {} words (~ {} pages)").format(
|
self.lblTotal.setText(self.tr("<b>Total:</b> {} words (~ {} pages)").format(
|
||||||
locale.format("%d", total, grouping=True),
|
locale.format_string("%d", total, grouping=True),
|
||||||
locale.format("%d", total / 250, grouping=True)
|
locale.format_string("%d", total / 250, grouping=True)
|
||||||
))
|
))
|
||||||
|
|
||||||
def addTopLevelItem(self, name):
|
def addTopLevelItem(self, name):
|
||||||
|
|
Loading…
Reference in a new issue