more ngettext references
This commit is contained in:
parent
1255e7530c
commit
b49805fef5
@ -634,14 +634,7 @@ class CardLayout(QDialog):
|
|||||||
|
|
||||||
def onAddCard(self):
|
def onAddCard(self):
|
||||||
cnt = self.mw.col.models.useCount(self.model)
|
cnt = self.mw.col.models.useCount(self.model)
|
||||||
txt = (
|
txt = tr(TR.CARD_TEMPLATES_THIS_WILL_CREATE_CARD_PROCEED, count=cnt)
|
||||||
ngettext(
|
|
||||||
"This will create %d card. Proceed?",
|
|
||||||
"This will create %d cards. Proceed?",
|
|
||||||
cnt,
|
|
||||||
)
|
|
||||||
% cnt
|
|
||||||
)
|
|
||||||
if not askUser(txt):
|
if not askUser(txt):
|
||||||
return
|
return
|
||||||
if not self.change_tracker.mark_schema():
|
if not self.change_tracker.mark_schema():
|
||||||
|
@ -164,10 +164,7 @@ class DeckConf(QDialog):
|
|||||||
continue
|
continue
|
||||||
deck["conf"] = self.deck["conf"]
|
deck["conf"] = self.deck["conf"]
|
||||||
self.mw.col.decks.save(deck)
|
self.mw.col.decks.save(deck)
|
||||||
tooltip(
|
tooltip(tr(TR.SCHEDULING_DECK_UPDATED, count=len(self.childDids)))
|
||||||
ngettext("%d deck updated.", "%d decks updated.", len(self.childDids))
|
|
||||||
% len(self.childDids)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Loading
|
# Loading
|
||||||
##################################################
|
##################################################
|
||||||
|
@ -150,10 +150,7 @@ class ExportDialog(QDialog):
|
|||||||
def exported_media(cnt):
|
def exported_media(cnt):
|
||||||
self.mw.taskman.run_on_main(
|
self.mw.taskman.run_on_main(
|
||||||
lambda: self.mw.progress.update(
|
lambda: self.mw.progress.update(
|
||||||
label=ngettext(
|
label=tr(TR.EXPORTING_EXPORTED_MEDIA_FILE, count=cnt)
|
||||||
"Exported %d media file", "Exported %d media files", cnt
|
|
||||||
)
|
|
||||||
% cnt
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -178,22 +175,8 @@ class ExportDialog(QDialog):
|
|||||||
self.mw.reopen()
|
self.mw.reopen()
|
||||||
else:
|
else:
|
||||||
if self.isTextNote:
|
if self.isTextNote:
|
||||||
msg = (
|
msg = tr(TR.EXPORTING_NOTE_EXPORTED, count=self.exporter.count)
|
||||||
ngettext(
|
|
||||||
"%d note exported.",
|
|
||||||
"%d notes exported.",
|
|
||||||
self.exporter.count,
|
|
||||||
)
|
|
||||||
% self.exporter.count
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
msg = (
|
msg = tr(TR.EXPORTING_CARD_EXPORTED, count=self.exporter.count)
|
||||||
ngettext(
|
|
||||||
"%d card exported.",
|
|
||||||
"%d cards exported.",
|
|
||||||
self.exporter.count,
|
|
||||||
)
|
|
||||||
% self.exporter.count
|
|
||||||
)
|
|
||||||
tooltip(msg, period=3000)
|
tooltip(msg, period=3000)
|
||||||
QDialog.reject(self)
|
QDialog.reject(self)
|
||||||
|
@ -482,8 +482,7 @@ def _replaceWithApkg(mw, filename, backup):
|
|||||||
):
|
):
|
||||||
mw.taskman.run_on_main(
|
mw.taskman.run_on_main(
|
||||||
lambda n=n: mw.progress.update(
|
lambda n=n: mw.progress.update(
|
||||||
ngettext("Processed %d media file", "Processed %d media files", n)
|
tr(TR.IMPORTING_PROCESSED_MEDIA_FILE, count=n)
|
||||||
% n
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
size = z.getinfo(cStr).file_size
|
size = z.getinfo(cStr).file_size
|
||||||
|
@ -822,12 +822,7 @@ time = %(time)d;
|
|||||||
cnt = len(self.card.note().cards())
|
cnt = len(self.card.note().cards())
|
||||||
self.mw.col.remove_notes([self.card.note().id])
|
self.mw.col.remove_notes([self.card.note().id])
|
||||||
self.mw.reset()
|
self.mw.reset()
|
||||||
tooltip(
|
tooltip(tr(TR.STUDYING_NOTE_AND_ITS_CARD_DELETED, count=cnt))
|
||||||
ngettext(
|
|
||||||
"Note and its %d card deleted.", "Note and its %d cards deleted.", cnt
|
|
||||||
)
|
|
||||||
% cnt
|
|
||||||
)
|
|
||||||
|
|
||||||
def onBuryCard(self) -> None:
|
def onBuryCard(self) -> None:
|
||||||
self.mw.checkpoint(tr(TR.STUDYING_BURY))
|
self.mw.checkpoint(tr(TR.STUDYING_BURY))
|
||||||
|
@ -7,7 +7,9 @@ files = (
|
|||||||
glob.glob("../../qt/**/*.py", recursive=True)
|
glob.glob("../../qt/**/*.py", recursive=True)
|
||||||
# glob.glob("../../qt/**/forms/*.ui", recursive=True)
|
# glob.glob("../../qt/**/forms/*.ui", recursive=True)
|
||||||
)
|
)
|
||||||
string_re = re.compile(r'ngettext\(\s*"(.+?)",\s+".+?",\s+(.+?)\) % \2', re.DOTALL)
|
string_re = re.compile(
|
||||||
|
r'ngettext\(\s*"(.+?)",\s+".+?",\s+(.+?)\s*,?\s*\)\s+%\s+\2', re.DOTALL
|
||||||
|
)
|
||||||
|
|
||||||
map = json.load(open("keys_by_text.json"))
|
map = json.load(open("keys_by_text.json"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user