Merge pull request #346 from Arthur-Milchior/dontTranslateShortcut

Tells QT not to translate shortcuts.
This commit is contained in:
Damien Elmes 2019-11-03 08:50:04 +10:00 committed by GitHub
commit a4cb3debe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 44 deletions

View File

@ -379,6 +379,7 @@ group by day order by day""" % (self._limit(), lim),
tunit = _("hours") tunit = _("hours")
else: else:
tunit = unit tunit = unit
#T: unit: can be hours, minutes, reviews... tot: the number of unit.
self._line(i, _("Total"), _("%(tot)s %(unit)s") % dict( self._line(i, _("Total"), _("%(tot)s %(unit)s") % dict(
unit=tunit, tot=int(tot))) unit=tunit, tot=int(tot)))
if convHours: if convHours:
@ -747,6 +748,7 @@ when you answer "good" on a review.''')
return txt return txt
def _line(self, i, a, b, bold=True): def _line(self, i, a, b, bold=True):
#T: Symbols separating first and second column in a statistics table. Eg in "Total: 3 reviews".
colon = _(":") colon = _(":")
if bold: if bold:
i.append(("<tr><td width=200 align=right>%s%s</td><td><b>%s</b></td></tr>") % (a,colon,b)) i.append(("<tr><td width=200 align=right>%s%s</td><td><b>%s</b></td></tr>") % (a,colon,b))
@ -814,7 +816,13 @@ from cards where did in %s""" % self._limit())
if xunit is None: if xunit is None:
conf['timeTicks'] = False conf['timeTicks'] = False
else: else:
conf['timeTicks'] = {1: _("d"), 7: _("w"), 31: _("mo")}[xunit] #T: abbreviation of day
d = _("d")
#T: abbreviation of week
w = _("w")
#T: abbreviation of month
mo = _("mo")
conf['timeTicks'] = {1: d, 7: w, 31: mo}[xunit]
# types # types
width = self.width width = self.width
height = self.height height = self.height

View File

@ -50,11 +50,17 @@ inTimeTable = {
def shortTimeFmt(type): def shortTimeFmt(type):
return { return {
#T: year is an abbreviation for year. %s is a number of years
"years": _("%sy"), "years": _("%sy"),
#T: m is an abbreviation for month. %s is a number of months
"months": _("%smo"), "months": _("%smo"),
#T: d is an abbreviation for day. %s is a number of days
"days": _("%sd"), "days": _("%sd"),
#T: h is an abbreviation for hour. %s is a number of hours
"hours": _("%sh"), "hours": _("%sh"),
#T: m is an abbreviation for minute. %s is a number of minutes
"minutes": _("%sm"), "minutes": _("%sm"),
#T: s is an abbreviation for second. %s is a number of seconds
"seconds": _("%ss"), "seconds": _("%ss"),
}[type] }[type]

View File

@ -1061,6 +1061,8 @@ by clicking on one on the left."""))
# add templates # add templates
for c, tmpl in enumerate(nt['tmpls']): for c, tmpl in enumerate(nt['tmpls']):
#T: name is a card type name. n it's order in the list of card type.
#T: this is shown in browser's filter, when seeing the list of card type of a note type.
name = _("%(n)d: %(name)s") % dict(n=c+1, name=tmpl['name']) name = _("%(n)d: %(name)s") % dict(n=c+1, name=tmpl['name'])
subm.addItem(name, self._filterFunc( subm.addItem(name, self._filterFunc(
"note", nt['name'], "card", str(c+1))) "note", nt['name'], "card", str(c+1)))

View File

@ -120,7 +120,7 @@
<string>Preview</string> <string>Preview</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+P</string> <string notr="true">Ctrl+Shift+P</string>
</property> </property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
@ -327,7 +327,7 @@
<string>&amp;Reschedule...</string> <string>&amp;Reschedule...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Alt+R</string> <string notr="true">Ctrl+Alt+R</string>
</property> </property>
</action> </action>
<action name="actionSelectAll"> <action name="actionSelectAll">
@ -335,7 +335,7 @@
<string>Select &amp;All</string> <string>Select &amp;All</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Alt+A</string> <string notr="true">Ctrl+Alt+A</string>
</property> </property>
</action> </action>
<action name="actionUndo"> <action name="actionUndo">
@ -343,7 +343,7 @@
<string>&amp;Undo</string> <string>&amp;Undo</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Alt+Z</string> <string notr="true">Ctrl+Alt+Z</string>
</property> </property>
</action> </action>
<action name="actionInvertSelection"> <action name="actionInvertSelection">
@ -351,7 +351,7 @@
<string>&amp;Invert Selection</string> <string>&amp;Invert Selection</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Alt+S</string> <string notr="true">Ctrl+Alt+S</string>
</property> </property>
</action> </action>
<action name="actionFind"> <action name="actionFind">
@ -359,7 +359,7 @@
<string>&amp;Find</string> <string>&amp;Find</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+F</string> <string notr="true">Ctrl+F</string>
</property> </property>
</action> </action>
<action name="actionNote"> <action name="actionNote">
@ -367,7 +367,7 @@
<string>N&amp;ote</string> <string>N&amp;ote</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+N</string> <string notr="true">Ctrl+Shift+N</string>
</property> </property>
</action> </action>
<action name="actionNextCard"> <action name="actionNextCard">
@ -375,7 +375,7 @@
<string>&amp;Next Card</string> <string>&amp;Next Card</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+N</string> <string notr="true">Ctrl+N</string>
</property> </property>
</action> </action>
<action name="actionPreviousCard"> <action name="actionPreviousCard">
@ -383,7 +383,7 @@
<string>&amp;Previous Card</string> <string>&amp;Previous Card</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+P</string> <string notr="true">Ctrl+P</string>
</property> </property>
</action> </action>
<action name="actionGuide"> <action name="actionGuide">
@ -391,7 +391,7 @@
<string>&amp;Guide</string> <string>&amp;Guide</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>F1</string> <string notr="true">F1</string>
</property> </property>
</action> </action>
<action name="actionChangeModel"> <action name="actionChangeModel">
@ -399,7 +399,7 @@
<string>Change Note Type...</string> <string>Change Note Type...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+M</string> <string notr="true">Ctrl+Shift+M</string>
</property> </property>
</action> </action>
<action name="actionSelectNotes"> <action name="actionSelectNotes">
@ -412,7 +412,7 @@
<string>Find and Re&amp;place...</string> <string>Find and Re&amp;place...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Alt+F</string> <string notr="true">Ctrl+Alt+F</string>
</property> </property>
</action> </action>
<action name="actionCram"> <action name="actionCram">
@ -425,7 +425,7 @@
<string>Fil&amp;ter</string> <string>Fil&amp;ter</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+F</string> <string notr="true">Ctrl+Shift+F</string>
</property> </property>
</action> </action>
<action name="actionCardList"> <action name="actionCardList">
@ -433,7 +433,7 @@
<string>Card List</string> <string>Card List</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+L</string> <string notr="true">Ctrl+Shift+L</string>
</property> </property>
</action> </action>
<action name="actionFindDuplicates"> <action name="actionFindDuplicates">
@ -446,7 +446,7 @@
<string>Reposition...</string> <string>Reposition...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+S</string> <string notr="true">Ctrl+Shift+S</string>
</property> </property>
</action> </action>
<action name="actionFirstCard"> <action name="actionFirstCard">
@ -470,7 +470,7 @@
<string>Close</string> <string>Close</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+W</string> <string notr="true">Ctrl+W</string>
</property> </property>
</action> </action>
<action name="action_Info"> <action name="action_Info">
@ -478,7 +478,7 @@
<string>&amp;Info...</string> <string>&amp;Info...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+I</string> <string notr="true">Ctrl+Shift+I</string>
</property> </property>
</action> </action>
<action name="actionAdd_Tags"> <action name="actionAdd_Tags">
@ -486,7 +486,7 @@
<string>Add Tags...</string> <string>Add Tags...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+A</string> <string notr="true">Ctrl+Shift+A</string>
</property> </property>
</action> </action>
<action name="actionRemove_Tags"> <action name="actionRemove_Tags">
@ -494,7 +494,7 @@
<string>Remove Tags...</string> <string>Remove Tags...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+D</string> <string notr="true">Ctrl+Shift+D</string>
</property> </property>
</action> </action>
<action name="actionToggle_Suspend"> <action name="actionToggle_Suspend">
@ -502,7 +502,7 @@
<string>Toggle Suspend</string> <string>Toggle Suspend</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+J</string> <string notr="true">Ctrl+J</string>
</property> </property>
</action> </action>
<action name="actionDelete"> <action name="actionDelete">
@ -510,7 +510,7 @@
<string>Delete</string> <string>Delete</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Del</string> <string notr="true">Ctrl+Del</string>
</property> </property>
</action> </action>
<action name="actionAdd"> <action name="actionAdd">
@ -518,7 +518,7 @@
<string>Add Notes...</string> <string>Add Notes...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+E</string> <string notr="true">Ctrl+E</string>
</property> </property>
</action> </action>
<action name="actionChange_Deck"> <action name="actionChange_Deck">
@ -526,7 +526,7 @@
<string>Change Deck...</string> <string>Change Deck...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+D</string> <string notr="true">Ctrl+D</string>
</property> </property>
</action> </action>
<action name="actionRed_Flag"> <action name="actionRed_Flag">
@ -537,7 +537,7 @@
<string>Red Flag</string> <string>Red Flag</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+1</string> <string notr="true">Ctrl+1</string>
</property> </property>
</action> </action>
<action name="actionOrange_Flag"> <action name="actionOrange_Flag">
@ -548,7 +548,7 @@
<string>Orange Flag</string> <string>Orange Flag</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+2</string> <string notr="true">Ctrl+2</string>
</property> </property>
</action> </action>
<action name="actionGreen_Flag"> <action name="actionGreen_Flag">
@ -559,7 +559,7 @@
<string>Green Flag</string> <string>Green Flag</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+3</string> <string notr="true">Ctrl+3</string>
</property> </property>
</action> </action>
<action name="actionBlue_Flag"> <action name="actionBlue_Flag">
@ -570,7 +570,7 @@
<string>Blue Flag</string> <string>Blue Flag</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+4</string> <string notr="true">Ctrl+4</string>
</property> </property>
</action> </action>
<action name="actionSidebar"> <action name="actionSidebar">
@ -578,7 +578,7 @@
<string>Sidebar</string> <string>Sidebar</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+R</string> <string notr="true">Ctrl+Shift+R</string>
</property> </property>
</action> </action>
<action name="actionClear_Unused_Tags"> <action name="actionClear_Unused_Tags">
@ -596,7 +596,7 @@
<string>Toggle Mark</string> <string>Toggle Mark</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+K</string> <string notr="true">Ctrl+K</string>
</property> </property>
</action> </action>
</widget> </widget>

View File

@ -69,7 +69,7 @@
<item> <item>
<widget class="QLabel" name="title"> <widget class="QLabel" name="title">
<property name="text"> <property name="text">
<string>...</string> <string notr="true">...</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -78,7 +78,7 @@
<item> <item>
<widget class="QLabel" name="preSpin"> <widget class="QLabel" name="preSpin">
<property name="text"> <property name="text">
<string>...</string> <string notr="true">...</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -88,7 +88,7 @@
<item> <item>
<widget class="QLabel" name="postSpin"> <widget class="QLabel" name="postSpin">
<property name="text"> <property name="text">
<string>...</string> <string notr="true">...</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -101,7 +101,7 @@
<string>E&amp;xit</string> <string>E&amp;xit</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Q</string> <string notr="true">Ctrl+Q</string>
</property> </property>
</action> </action>
<action name="actionPreferences"> <action name="actionPreferences">
@ -112,7 +112,7 @@
<string>Configure interface language and options</string> <string>Configure interface language and options</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+P</string> <string notr="true">Ctrl+P</string>
</property> </property>
<property name="menuRole"> <property name="menuRole">
<enum>QAction::PreferencesRole</enum> <enum>QAction::PreferencesRole</enum>
@ -134,7 +134,7 @@
<string>&amp;Undo</string> <string>&amp;Undo</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Z</string> <string notr="true">Ctrl+Z</string>
</property> </property>
</action> </action>
<action name="actionCheckMediaDatabase"> <action name="actionCheckMediaDatabase">
@ -173,7 +173,7 @@
<string>&amp;Guide...</string> <string>&amp;Guide...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>F1</string> <string notr="true">F1</string>
</property> </property>
</action> </action>
<action name="actionSwitchProfile"> <action name="actionSwitchProfile">
@ -181,7 +181,7 @@
<string>&amp;Switch Profile</string> <string>&amp;Switch Profile</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+P</string> <string notr="true">Ctrl+Shift+P</string>
</property> </property>
</action> </action>
<action name="actionExport"> <action name="actionExport">
@ -189,7 +189,7 @@
<string>&amp;Export...</string> <string>&amp;Export...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+E</string> <string notr="true">Ctrl+E</string>
</property> </property>
</action> </action>
<action name="actionImport"> <action name="actionImport">
@ -197,7 +197,7 @@
<string>&amp;Import...</string> <string>&amp;Import...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+I</string> <string notr="true">Ctrl+Shift+I</string>
</property> </property>
</action> </action>
<action name="actionStudyDeck"> <action name="actionStudyDeck">
@ -205,7 +205,7 @@
<string>Study Deck...</string> <string>Study Deck...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>/</string> <string notr="true">/</string>
</property> </property>
</action> </action>
<action name="actionEmptyCards"> <action name="actionEmptyCards">
@ -218,7 +218,7 @@
<string>Create Filtered Deck...</string> <string>Create Filtered Deck...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>F</string> <string notr="true">F</string>
</property> </property>
</action> </action>
<action name="actionNoteTypes"> <action name="actionNoteTypes">
@ -226,7 +226,7 @@
<string>Manage Note Types</string> <string>Manage Note Types</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+N</string> <string notr="true">Ctrl+Shift+N</string>
</property> </property>
</action> </action>
<action name="actionAdd_ons"> <action name="actionAdd_ons">
@ -234,7 +234,7 @@
<string>Add-ons</string> <string>Add-ons</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+Shift+A</string> <string notr="true">Ctrl+Shift+A</string>
</property> </property>
</action> </action>
</widget> </widget>