Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions source/NVDAObjects/IAccessible/winword.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,34 +255,34 @@ def script_setColumnHeader(self, gesture):
return
if scriptCount == 0:
if self.setAsHeaderCell(cell, isColumnHeader=True, isRowHeader=False):
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
ui.message(
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
_("Set row {rowNumber} column {columnNumber} as start of column headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
)
else:
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
ui.message(
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
_("Already set row {rowNumber} column {columnNumber} as start of column headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
)
elif scriptCount == 1:
if self.forgetHeaderCell(cell, isColumnHeader=True, isRowHeader=False):
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
ui.message(
_("Removed row {rowNumber} column {columnNumber} from column headers").format(
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
_("Removed row {rowNumber} column {columnNumber} from column headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
)
else:
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
ui.message(
_("Cannot find row {rowNumber} column {columnNumber} in column headers").format(
# Translators: a message reported in the SetColumnHeader script for Microsoft Word.
_("Cannot find row {rowNumber} column {columnNumber} in column headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
Expand All @@ -307,34 +307,34 @@ def script_setRowHeader(self, gesture):
return
if scriptCount == 0:
if self.setAsHeaderCell(cell, isColumnHeader=False, isRowHeader=True):
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
ui.message(
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
_("Set row {rowNumber} column {columnNumber} as start of row headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
)
else:
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
ui.message(
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
_("Already set row {rowNumber} column {columnNumber} as start of row headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
)
elif scriptCount == 1:
if self.forgetHeaderCell(cell, isColumnHeader=False, isRowHeader=True):
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
ui.message(
_("Removed row {rowNumber} column {columnNumber} from row headers").format(
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
_("Removed row {rowNumber} column {columnNumber} from row headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
)
else:
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
ui.message(
_("Cannot find row {rowNumber} column {columnNumber} in row headers").format(
# Translators: a message reported in the SetRowHeader script for Microsoft Word.
_("Cannot find row {rowNumber} column {columnNumber} in row headers").format(
rowNumber=cell.rowIndex,
columnNumber=cell.columnIndex,
),
Expand Down
7 changes: 2 additions & 5 deletions source/NVDAObjects/UIA/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2723,11 +2723,8 @@ def event_UIA_layoutInvalidated(self):
# Item count must be the last one spoken.
suggestionsCount: int = self.childCount
suggestionsMessage = (
# Translators: part of the suggestions count message for one suggestion.
_("1 suggestion")
# Translators: part of the suggestions count message (for example: 2 suggestions).
if suggestionsCount == 1
else _("{} suggestions").format(suggestionsCount)
# Translators: message from to note the number of suggestions
ngettext("{} suggestion", "{} suggestions", suggestionsCount).format(suggestionsCount)
)
ui.message(suggestionsMessage)

Expand Down
11 changes: 9 additions & 2 deletions source/NVDAObjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,16 @@ def _get_locationText(self):
percentFromTop = (float(top - deskTop) / deskHeight) * 100
percentWidth = (float(width) / deskWidth) * 100
percentHeight = (float(height) / deskHeight) * 100
# Translators: Reports navigator object's dimensions (example output: object edges positioned 20 per cent from left edge of screen, 10 per cent from top edge of screen, width is 40 per cent of screen, height is 50 per cent of screen).
return _(
"Object edges positioned {left:.1f} per cent from left edge of screen, {top:.1f} per cent from top edge of screen, width is {width:.1f} per cent of screen, height is {height:.1f} per cent of screen",
# Translators: Reports navigator object's dimensions.
# Example output: Object edges positioned 20 per cent from left edge of screen,
# 10 per cent from top edge of screen,
# width is 40 per cent of screen,
# height is 50 per cent of screen.
"Object edges positioned {left:.1f} percent from left edge of screen, "
"{top:.1f} percent from top edge of screen, "
"width is {width:.1f} percent of screen, "
"height is {height:.1f} percent of screen",
).format(left=percentFromLeft, top=percentFromTop, width=percentWidth, height=percentHeight)

#: Typing information for auto-property: _get_parent
Expand Down
2 changes: 1 addition & 1 deletion source/NVDAObjects/behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ def getFormattedCandidateName(self, number, candidate):
if description.startswith("(") and description.endswith(")"):
describedSymbols.append(description[1:-1])
else:
# Translators: a message announcing a candidate's character and description.
describedSymbols.append(
# Translators: a message announcing a candidate's character and description.
_("{symbol} as in {description}").format(symbol=symbol, description=description),
)
else:
Expand Down
27 changes: 16 additions & 11 deletions source/NVDAObjects/window/_msOfficeChart.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ def script_reportCurrentChartElementColor(self, gesture):
if self.elementID == xlSeries:
if self.arg2 == -1:
ui.message(
_("Series color: {colorName} ").format(
# Translators: Message to be spoken to report Series Color
_("Series color: {colorName}").format(
colorName=colors.RGB.fromCOLORREF(
int(self.officeChartObject.SeriesCollection(self.arg1).Interior.Color),
).name,
Expand Down Expand Up @@ -786,8 +787,8 @@ def select(self):

def script_reportColor(self, gesture):
if self.officeChartObject.ChartType in (xlPie, xlPieExploded, xlPieOfPie):
# Translators: Message to be spoken to report Slice Color in Pie Chart
ui.message(
# Translators: Message to be spoken to report Slice Color in Pie Chart
_("Slice color: {colorName} ").format(
colorName=colors.RGB.fromCOLORREF(
int(
Expand All @@ -799,9 +800,9 @@ def script_reportColor(self, gesture):
),
)
else:
# Translators: Message to be spoken to report Series Color
ui.message(
_("Series color: {colorName} ").format(
# Translators: Message to be spoken to report Series Color
_("Series color: {colorName}").format(
colorName=colors.RGB.fromCOLORREF(
int(self.officeChartObject.SeriesCollection(self.seriesIndex).Interior.Color),
).name,
Expand Down Expand Up @@ -911,9 +912,9 @@ def _getChartElementText(self, ElementID, arg1, arg2, reportExtraInfo=False):

if self.officeChartObject.ChartType in (xlPie, xlPieExploded, xlPieOfPie):
total = math.fsum(self.officeChartObject.SeriesCollection(arg1).Values)
# Translators: Details about a slice of a pie chart.
# For example, this might report "fraction 25.25 percent slice 1 of 5"
output += _(
# Translators: Details about a slice of a pie chart.
# For example, this might report "fraction 25.25 percent slice 1 of 5"
" fraction {fractionValue:.2f} Percent slice {pointIndex} of {pointCount}",
).format(
fractionValue=self.officeChartObject.SeriesCollection(arg1).Values[arg2 - 1]
Expand Down Expand Up @@ -1069,8 +1070,8 @@ def _getChartElementText(self, ElementID, arg1, arg2, reportExtraInfo=False):
label = re.sub(r"([a-zA-Z]+)([-]*[04-9][0-9]*)", r"\1 to the power \2", label)
# Translators: Substitute - by minus in trendline equations.
label = label.replace("-", _(" minus "))
# Translators: This message gives trendline type and name for selected series
output = _(
# Translators: This message gives trendline type and name for selected series
"{seriesName} trendline type: {trendlineType}, name: {trendlineName}, label: {trendlineLabel} ",
).format(
seriesName=self.officeChartObject.SeriesCollection(self.seriesIndex).Name,
Expand Down Expand Up @@ -1125,9 +1126,10 @@ def __init__(self, windowHandle=None, officeChartObject=None, elementID=None, ar

def _getChartElementText(self, ElementID, arg1, arg2, reportExtraInfo=False):
if reportExtraInfo:
# Translators: Details about the chart area in a Microsoft Office chart.
return _(
"Chart area, height: {chartAreaHeight}, width: {chartAreaWidth}, top: {chartAreaTop}, left: {chartAreaLeft}",
# Translators: Details about the chart area in a Microsoft Office chart.
"Chart area, height: {chartAreaHeight}, "
"width: {chartAreaWidth}, top: {chartAreaTop}, left: {chartAreaLeft}",
).format(
chartAreaHeight=self.officeChartObject.ChartArea.Height,
chartAreaWidth=self.officeChartObject.ChartArea.Width,
Expand Down Expand Up @@ -1155,9 +1157,12 @@ def __init__(self, windowHandle=None, officeChartObject=None, elementID=None, ar
def _getChartElementText(self, ElementID, arg1, arg2, reportExtraInfo=False):
if reportExtraInfo:
# useing {:.0f} to remove fractions
# Translators: Details about the plot area of a Microsoft Office chart.
return _(
"Plot area, inside height: {plotAreaInsideHeight:.0f}, inside width: {plotAreaInsideWidth:.0f}, inside top: {plotAreaInsideTop:.0f}, inside left: {plotAreaInsideLeft:.0f}",
# Translators: Details about the plot area of a Microsoft Office chart.
"Plot area, inside height: {plotAreaInsideHeight:.0f}, "
"inside width: {plotAreaInsideWidth:.0f}, "
"inside top: {plotAreaInsideTop:.0f}, "
"inside left: {plotAreaInsideLeft:.0f}",
).format(
plotAreaInsideHeight=self.officeChartObject.PlotArea.InsideHeight,
plotAreaInsideWidth=self.officeChartObject.PlotArea.InsideWidth,
Expand Down
10 changes: 5 additions & 5 deletions source/NVDAObjects/window/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1621,18 +1621,18 @@ def script_setColumnHeader(self, gesture):
# Translators: a message reported in the SetColumnHeader script for Excel.
ui.message(_("Set {address} as start of column headers").format(address=self.cellCoordsText))
else:
# Translators: a message reported in the SetColumnHeader script for Excel.
ui.message(
# Translators: a message reported in the SetColumnHeader script for Excel.
_("Already set {address} as start of column headers").format(address=self.cellCoordsText),
)
elif scriptCount == 1:
if self.parent.forgetHeaderCell(self, isColumnHeader=True, isRowHeader=False):
# Translators: a message reported in the SetColumnHeader script for Excel.
ui.message(_("Removed {address} from column headers").format(address=self.cellCoordsText))
ui.message(_("Removed {address} from column headers").format(address=self.cellCoordsText))
else:
# Translators: a message reported in the SetColumnHeader script for Excel.
ui.message(
_("Cannot find {address} in column headers").format(address=self.cellCoordsText),
# Translators: a message reported in the SetColumnHeader script for Excel.
_("Cannot find {address} in column headers").format(address=self.cellCoordsText),
)

@script(
Expand All @@ -1652,8 +1652,8 @@ def script_setRowHeader(self, gesture):
# Translators: a message reported in the SetRowHeader script for Excel.
ui.message(_("Set {address} as start of row headers").format(address=self.cellCoordsText))
else:
# Translators: a message reported in the SetRowHeader script for Excel.
ui.message(
# Translators: a message reported in the SetRowHeader script for Excel.
_("Already set {address} as start of row headers").format(address=self.cellCoordsText),
)
elif scriptCount == 1:
Expand Down
2 changes: 1 addition & 1 deletion source/NVDAObjects/window/excelCellBorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def getCellBorderStyleDescription(bordersObj, reportBorderColor=False):
del d[xlDiagonalUp]
del d[xlDiagonalDown]
for pos, desc in d.items():
# Translators: border styles in Microsoft Excel.
s.append(
# Translators: border styles in Microsoft Excel.
_("{desc} {position}").format(
desc=desc,
position=bordersIndexLabels.get(pos),
Expand Down
2 changes: 1 addition & 1 deletion source/NVDAObjects/window/winword.py
Original file line number Diff line number Diff line change
Expand Up @@ -1665,8 +1665,8 @@ def script_increaseDecreaseOutlineLevel(self, gesture):
lambda: self.WinwordSelectionObject.paragraphFormat.outlineLevel,
)
style = self.WinwordSelectionObject.style.nameLocal
# Translators: the message when the outline level / style is changed in Microsoft word
ui.message(
# Translators: the message when the outline level / style is changed in Microsoft word
_("{styleName} style, outline level {outlineLevel}").format(styleName=style, outlineLevel=val),
)

Expand Down
4 changes: 2 additions & 2 deletions source/addonStore/models/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,16 @@ def _displayStringLabels(self) -> Dict["AvailableAddonStatus", str]:
self.PENDING_DISABLE: pgettext("addonStore", "Disabled, pending restart"),
# Translators: Status for addons shown in the add-on store dialog
self.DISABLED: pgettext("addonStore", "Disabled"),
# Translators: Status for addons shown in the add-on store dialog
self.PENDING_INCOMPATIBLE_DISABLED: pgettext(
"addonStore",
# Translators: Status for addons shown in the add-on store dialog
"Disabled (incompatible), pending restart",
),
# Translators: Status for addons shown in the add-on store dialog
self.INCOMPATIBLE_DISABLED: pgettext("addonStore", "Disabled (incompatible)"),
# Translators: Status for addons shown in the add-on store dialog
self.PENDING_INCOMPATIBLE_ENABLED: pgettext(
"addonStore",
# Translators: Status for addons shown in the add-on store dialog
"Enabled (incompatible), pending restart",
),
# Translators: Status for addons shown in the add-on store dialog
Expand Down
2 changes: 1 addition & 1 deletion source/appModules/foobar2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def script_reportRemainingTime(self, gesture: "InputGesture"):
if parsedElapsedTime is not None and parsedTotalTime is not None:
remainingTime = parsedTotalTime - parsedElapsedTime
remainingTimeFormatted = TimeOutputFormat.parseTimeDeltaToFormatted(remainingTime)
# Translators: Reported remaining time in Foobar2000
ui.message(
# Translators: Reported remaining time in Foobar2000
_("{remainingTimeFormatted} remaining").format(remainingTimeFormatted=remainingTimeFormatted),
)
else:
Expand Down
7 changes: 4 additions & 3 deletions source/brailleDisplayDrivers/freedomScientific.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,16 @@ class BrailleDisplayDriver(braille.BrailleDisplayDriver, ScriptableObject):
timeout = 0.2

wizWheelActions = [
# Translators: The name of a key on a braille display, that scrolls the display
# to show previous/next part of a long line.
(
# Translators: The name of a key on a braille display, that scrolls the display
# to show previous/next part of a long line.
_("display scroll"),
("globalCommands", "GlobalCommands", "braille_scrollBack"),
("globalCommands", "GlobalCommands", "braille_scrollForward"),
),
# Translators: The name of a key on a braille display, that scrolls the display to show the next/previous line.
(
# Translators: The name of a key on a braille display,
# that scrolls the display to show the next/previous line.
_("line scroll"),
("globalCommands", "GlobalCommands", "braille_previousLine"),
("globalCommands", "GlobalCommands", "braille_nextLine"),
Expand Down
2 changes: 1 addition & 1 deletion source/brailleInput.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ def toggleModifiers(self, modifiers: List[str]):
for modifier in added:
speech.speakMessage(keyLabels.getKeyCombinationLabel(modifier))
for modifier in removed:
# Translators: Reported when a braille input modifier is released.
speech.speakMessage(
# Translators: Reported when a braille input modifier is released.
_("{modifier} released").format(
modifier=keyLabels.getKeyCombinationLabel(modifier),
),
Expand Down
16 changes: 9 additions & 7 deletions source/browseMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,11 @@ def script_toggleSingleLetterNav(self, gesture):
# Translators: Reported when single letter navigation in browse mode is turned on.
ui.message(_("Single letter navigation on"))

# Translators: the description for the toggleSingleLetterNavigation command in browse mode.
script_toggleSingleLetterNav.__doc__ = _(
"Toggles single letter navigation on and off. When on, single letter keys in browse mode jump to various kinds of elements on the page. When off, these keys are passed to the application",
# Translators: the description for the toggleSingleLetterNavigation command in browse mode.
"Toggles single letter navigation on and off. "
"When on, single letter keys in browse mode jump to various kinds of elements on the page. "
"When off, these keys are passed to the application",
)

def _get_ElementsListDialog(self):
Expand Down Expand Up @@ -1297,11 +1299,11 @@ def __init__(self, document):
mainSizer = wx.BoxSizer(wx.VERTICAL)
contentsSizer = wx.BoxSizer(wx.VERTICAL)

# Translators: The label of a group of radio buttons to select the type of element
# in the browse mode Elements List dialog.
child = wx.RadioBox(
self,
wx.ID_ANY,
# Translators: The label of a group of radio buttons to select the type of element
# in the browse mode Elements List dialog.
label=_("Type:"),
choices=tuple(et[1] for et in self.ELEMENT_TYPES),
)
Expand Down Expand Up @@ -2302,8 +2304,8 @@ def script_moveToStartOfContainer(self, gesture):
speech.speakTextInfo(container, reason=OutputReason.FOCUS)

script_moveToStartOfContainer.resumeSayAllMode = sayAll.CURSOR.CARET
# Translators: Description for the Move to start of container command in browse mode.
script_moveToStartOfContainer.__doc__ = _(
# Translators: Description for the Move to start of container command in browse mode.
"Moves to the start of the container element, such as a list or table",
)

Expand All @@ -2330,9 +2332,9 @@ def script_movePastEndOfContainer(self, gesture):
speech.speakTextInfo(container, reason=OutputReason.FOCUS)

script_movePastEndOfContainer.resumeSayAllMode = sayAll.CURSOR.CARET
# Translators: Description for the Move past end of container command in browse mode.
script_movePastEndOfContainer.__doc__ = _(
"Moves past the end of the container element, such as a list or table",
# Translators: Description for the Move past end of container command in browse mode.
"Moves past the end of the container element, such as a list or table",
)

NOT_LINK_BLOCK_MIN_LEN = 30
Expand Down
4 changes: 2 additions & 2 deletions source/config/configFlags.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def _displayStringLabels(self):
# Translators: A choice in a combo box in the document formatting dialog to report indentation
# with tones.
ReportLineIndentation.TONES: pgettext("line indentation setting", "Tones"),
# Translators: A choice in a combo box in the document formatting dialog to report indentation with both
# Speech and tones.
ReportLineIndentation.SPEECH_AND_TONES: pgettext(
"line indentation setting",
# Translators: A choice in a combo box in the document formatting dialog to report indentation with both
# Speech and tones.
"Both Speech and Tones",
),
}
Expand Down
2 changes: 1 addition & 1 deletion source/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def handleReplaceCLIArg(cliArgument: str) -> bool:
import wx

gui.messageBox(
# Translators: A message informing the user that there are errors in the configuration file.
_(
# Translators: A message informing the user that there are errors in the configuration file.
"Your configuration file contains errors. "
"Your configuration has been reset to factory defaults.\n"
"More details about the errors can be found in the log file.",
Expand Down
Loading