From aeae009960627fc5c58cc53b2f2436da5888179a Mon Sep 17 00:00:00 2001 From: Joseph Lee Date: Thu, 14 Feb 2013 09:49:17 +0100 Subject: [PATCH] Work on adding translator comments (#1410) processed so far: IAccessibleHandler.py, NVDAHelper.py, appModuleHandler.py, braille.py, colors.py, controlTypes.py, core.py, globalCommands.py, installer.py, keyboardHandler.py, mouseHandler.py, speech.py Signed-off-by: Mesar Hameed --- source/IAccessibleHandler.py | 1 + source/NVDAHelper.py | 1 + source/appModuleHandler.py | 1 + source/braille.py | 2 +- source/colors.py | 13 +++++ source/controlTypes.py | 112 +++++++++++++++++++++++++++++++++++++++++++ source/core.py | 2 + source/globalCommands.py | 51 +++++++++++++++++++- source/installer.py | 6 ++- source/keyboardHandler.py | 2 + source/mouseHandler.py | 1 + source/speech.py | 14 +++++- 12 files changed, 201 insertions(+), 5 deletions(-) diff --git a/source/IAccessibleHandler.py b/source/IAccessibleHandler.py index 1f09b0fe9..c20c706c0 100644 --- a/source/IAccessibleHandler.py +++ b/source/IAccessibleHandler.py @@ -669,6 +669,7 @@ class SecureDesktopNVDAObject(NVDAObjects.window.Desktop): return clsList def _get_name(self): + # Translators: Message to indicate User Account Control (UAC) or other secure desktop screen is active. return _("Secure Desktop") def _get_role(self): diff --git a/source/NVDAHelper.py b/source/NVDAHelper.py index 8f9324bdc..f0b5f2622 100755 --- a/source/NVDAHelper.py +++ b/source/NVDAHelper.py @@ -236,6 +236,7 @@ JapaneseInputConversionModeMessages= { 11: _("katakana"), # Translators: For Japanese character input: half-shaped (single-byte) alpha numeric (roman/english) mode. 16: _("half alphanumeric"), + # Translators: For Japanese character input: half katakana roman input mode. 19: _("half katakana roman"), # Translators: For Japanese character input: alpha numeric (roman/english) mode. 24: _("alphanumeric"), diff --git a/source/appModuleHandler.py b/source/appModuleHandler.py index db43f7cc2..7e5f7312b 100644 --- a/source/appModuleHandler.py +++ b/source/appModuleHandler.py @@ -140,6 +140,7 @@ def fetchAppModule(processID,appName): except: log.error("error in appModule %r"%modName, exc_info=True) # We can't present a message which isn't unicode, so use appName, not modName. + # Translators: This is presented when errors are found in an appModule (example output: error in appModule explorer). ui.message(_("Error in appModule %s")%appName) # Use the base AppModule. diff --git a/source/braille.py b/source/braille.py index 5e793bc36..f970fc47f 100644 --- a/source/braille.py +++ b/source/braille.py @@ -1532,7 +1532,7 @@ class BrailleDisplayDriver(baseObject.AutoPropertyObject): #: Automatic port constant to be used by braille displays that support the "automatic" port #: @type: Tupple - # Translators String representing the automatic port selection for braille displays. + # Translators: String representing the automatic port selection for braille displays. AUTOMATIC_PORT = ("auto", _("Automatic")) @classmethod diff --git a/source/colors.py b/source/colors.py index b0bab9fad..1df103f2c 100644 --- a/source/colors.py +++ b/source/colors.py @@ -72,6 +72,7 @@ class RGB(namedtuple('RGB',('red','green','blue'))): if foundName: return foundName longestDistance=255.0 + # Translators: Reported when text is written in unknown color. closestName=_("unknown color") for possibleRGB,possibleName in RGBToNames.iteritems(): distance=math.sqrt(abs(self.red-possibleRGB.red)**2+abs(self.green-possibleRGB.green)**2+abs(self.blue-possibleRGB.blue)**2) @@ -85,22 +86,34 @@ RGBToNamesCache={} RGBToNames={ #Standard 16 HTML 4 colors + # Translators: The color black. RGB(0x00,0x00,0x00):_('black'), + # Translators: The color green. RGB(0x00,0x80,0x00):_('green'), + # Translators: The light gray color. RGB(0xc0,0xc0,0xc0):_('light grey'), # Translators: The color lime. # For more info see: http://en.wikipedia.org/wiki/Lime_%28color%29 RGB(0x00,0xff,0x00):_('lime'), + # Translators: The color gray (halfway between white and black). RGB(0x80,0x80,0x80):_('grey'), # Translators: the color olive. # For more info see: http://en.wikipedia.org/wiki/Olive_%28color%29#Olive RGB(0x80,0x80,0x00):_('olive'), + # Translators: The color white. RGB(0xff,0xff,0xff):_('white'), + # Translators: The color yellow. RGB(0xff,0xff,0x00):_('yellow'), + # Translators: The dark red color. RGB(0x80,0x00,0x00):_('dark red'), + # Translators: The color navy blue (dark blue). + # For more info see http://en.wikipedia.org/wiki/Navy_blue RGB(0x00,0x00,0xa0):_('navy blue'), + # Translators: The color red. RGB(0xff,0x00,0x00):_('red'), + # Translators: The color blue. RGB(0x00,0x00,0xff):_('blue'), + # Translators: The color purple. RGB(0x80,0x00,0x80):_('purple'), # Translators: The color teal, which is a mix of green and blue, mostly green. # For more info see http://en.wikipedia.org/wiki/Teal diff --git a/source/controlTypes.py b/source/controlTypes.py index 6eb19f7a1..9c05ac643 100644 --- a/source/controlTypes.py +++ b/source/controlTypes.py @@ -185,74 +185,132 @@ STATES_SORTED=frozenset([STATE_SORTED,STATE_SORTED_ASCENDING,STATE_SORTED_DESCEN STATE_HASLONGDESC=0x400000000 roleLabels={ + # Translators: The word for an unknown control type. ROLE_UNKNOWN:_("unknown"), + # Translators: The word for window of a program suchas document window. ROLE_WINDOW:_("window"), + # Translators: Used to identify title bar of a program. ROLE_TITLEBAR:_("title bar"), + # Translators: The word used for pane such as desktop pane. ROLE_PANE:_("pane"), + # Translators: The word used to denote a dialog box such as open dialog. ROLE_DIALOG:_("dialog"), + # Translators: The text used to identify check boxes such as select check box. ROLE_CHECKBOX:_("check box"), + # Translators: The text used to identify radio buttons such as yes or no radio button. ROLE_RADIOBUTTON:_("radio button"), + # Translators: The word used to identify a static text such as dialog text. ROLE_STATICTEXT:_("text"), + # Translators: The word used to identify edit fields such as subject edit field. ROLE_EDITABLETEXT:_("edit"), + # Translators: The word used to identify a button such as OK button. ROLE_BUTTON:_("button"), + # Translators: Text used to identify menu bar of a program. ROLE_MENUBAR:_("menu bar"), + # Translators: Used to identify a menu item such as an item in file menu. ROLE_MENUITEM:_("menu item"), + # Translators: The word used for menus such as edit menu. ROLE_POPUPMENU:_("menu"), + # Translators: Used to identify combo boxes such as file type combo box. ROLE_COMBOBOX:_("combo box"), + # Translators: The word used for lists such as folder list. ROLE_LIST:_("list"), + # Translators: Used to identify a list item such as email list items. ROLE_LISTITEM:_("list item"), + # Translators: The word used to identify graphics such as webpage graphics. ROLE_GRAPHIC:_("graphic"), + # Translators: Used to identify help balloon (a circular window with helpful text such as notification text). ROLE_HELPBALLOON:_("help balloon"), + # Translators: Used to identify a tooltip (a small window with additional text about selected item such as file information). ROLE_TOOLTIP:_("tool tip"), + # Translators: Identifies a link in webpage documents. ROLE_LINK:_("link"), + # Translators: Identifies a treeview (a tree-like structure such as treeviews for subfolders). ROLE_TREEVIEW:_("tree view"), + # Translators: Identifies a tree view item. ROLE_TREEVIEWITEM:_("tree view item"), # Translators: The word presented for tabs in a tab enabled window. ROLE_TAB: pgettext("controlType", "tab"), + # Translators: Identifies a tab control such as webpage tabs in web browsers. ROLE_TABCONTROL:_("tab control"), + # Translators: Identifies a slider such as volume slider. ROLE_SLIDER:_("slider"), + # Translators: Identifies a progress bar such as NvDA update progress. ROLE_PROGRESSBAR:_("progress bar"), + # Translators: Identifies a scroll bar. ROLE_SCROLLBAR:_("scroll bar"), + # Translators: Identifies a status bar (text at the bottom bar of the screen such as cursor position in a document). ROLE_STATUSBAR:_("status bar"), + # Translators: Identifies a table such as ones used in various websites. ROLE_TABLE:_("table"), + # Translators: Identifies a cell in a table. ROLE_TABLECELL:_("cell"), + # Translators: Identifies a column (a group of vertical cells in a table). ROLE_TABLECOLUMN:_("column"), + # Translators: Identifies a row (a group of horizontal cells in a table). ROLE_TABLEROW:_("row"), + # Translators: Identifies a frame (a smaller window in a webpage or a document). ROLE_FRAME:_("frame"), + # Translators: Identifies a tool bar. ROLE_TOOLBAR:_("tool bar"), + # Translators: Identifies a column header in tables and spreadsheets. ROLE_TABLECOLUMNHEADER:_("column header"), + # Translators: Identifies a row header in tables and spreadsheets. ROLE_TABLEROWHEADER:_("row header"), + # Translators: Identifies a drop down button (a button that, when clicked, opens a menu of its own). ROLE_DROPDOWNBUTTON:_("drop down button"), + # Translators: Identifies an element. ROLE_CLOCK:_("clock"), + # Translators: Identifies a separator (a horizontal line drawn on the screen). ROLE_SEPARATOR:_("separator"), + # Translators: Identifies a form (controls such as edit boxes, combo boxes and so on). ROLE_FORM:_("form"), + # Translators: Identifies a heading (a bold text used for identifying a section). ROLE_HEADING:_("heading"), + # Translators: Identifies a heading level. ROLE_HEADING1:_("heading 1"), + # Translators: Identifies a heading level. ROLE_HEADING2:_("heading 2"), + # Translators: Identifies a heading level. ROLE_HEADING3:_("heading 3"), + # Translators: Identifies a heading level. ROLE_HEADING4:_("heading 4"), + # Translators: Identifies a heading level. ROLE_HEADING5:_("heading 5"), + # Translators: Identifies a heading level. ROLE_HEADING6:_("heading 6"), + # Translators: Identifies a paragraph (a group of text surrounded by blank lines). ROLE_PARAGRAPH:_("paragraph"), # Translators: Presented for a section in a document which is a block quotation; # i.e. a long quotation in a separate paragraph distinguished by indentation, etc. # See http://en.wikipedia.org/wiki/Block_quotation ROLE_BLOCKQUOTE:_("block quote"), + # Translators: Identifies a table header (a short text at the start of a table which describes what the table is about). ROLE_TABLEHEADER:_("table header"), + # Translators: Identifies a table body (the main body of the table). ROLE_TABLEBODY:_("table body"), + # Translators: Identifies a table footer (text placed at the end of the table). ROLE_TABLEFOOTER:_("table footer"), + # Translators: Identifies a document (for example, a webpage document). ROLE_DOCUMENT:_("document"), + # Translators: Identifies an animation in a document or a webpage. ROLE_ANIMATION:_("animation"), + # Translators: Identifies an application in webpages. ROLE_APPLICATION:_("application"), + # Translators: Identifies a box element. ROLE_BOX:_("box"), + # Translators: Identifies a grouping (a number of related items grouped together, such as related options in dialogs). ROLE_GROUPING:_("grouping"), + # Translators: Identifies a property page such as drive properties dialog. ROLE_PROPERTYPAGE:_("property page"), ROLE_CANVAS:_("canvas"), ROLE_CAPTION:_("caption"), ROLE_CHECKMENUITEM:_("check menu item"), ROLE_DATEEDITOR:_("date edit"), + # Translators: Identifies an icon. ROLE_ICON:_("icon"), ROLE_DIRECTORYPANE:_("directory pane"), + # Translators: Identifies an embedded object such as flash content. ROLE_EMBEDDEDOBJECT:_("embedded object"), ROLE_ENDNOTE:_("end note"), ROLE_FOOTER:_("footer"), @@ -261,11 +319,16 @@ roleLabels={ # a pane that is guaranteed to be on top of all panes beneath it. ROLE_GLASSPANE:_("glass pane"), ROLE_HEADER:_("header"), + # Translators: Identifies an image map (a type of graphical link). ROLE_IMAGEMAP:_("image map"), + # Translators: Identifies an input window. ROLE_INPUTWINDOW:_("input window"), + # Translators: Identifies a label. ROLE_LABEL:_("label"), ROLE_NOTE:_("note"), + # Translators: Identifies a page. ROLE_PAGE:_("page"), + # Translators: Identifies a radio menu item. ROLE_RADIOMENUITEM:_("radio menu item"), ROLE_LAYEREDPANE:_("layered pane"), ROLE_REDUNDANTOBJECT:_("redundant object"), @@ -273,12 +336,17 @@ roleLabels={ # Translators: May be reported for an editable text object in a toolbar. # This is deprecated and is not often (if ever) used. ROLE_EDITBAR:_("edit bar"), + # Translators: Identifies a terminal window such as command prompt. ROLE_TERMINAL:_("terminal"), ROLE_RICHEDIT:_("rich edit"), ROLE_RULER:_("ruler"), + # Translators: Identifies a scroll pane. ROLE_SCROLLPANE:_("scroll pane"), + # Translators: Identifies a section of text. ROLE_SECTION:_("section"), + # Translators: Identifies a shape. ROLE_SHAPE:_("shape"), + # Translators: Identifies a split pane. ROLE_SPLITPANE:_("split pane"), # Translators: Reported for a view port; i.e. an object usually used in a scroll pane # which represents the portion of the entire data that the user can see. @@ -289,6 +357,7 @@ roleLabels={ # to exist as a separate window. ROLE_TEAROFFMENU:_("tear off menu"), ROLE_TEXTFRAME:_("text frame"), + # Translators: Identifies a toggle button (a button used to toggle something). ROLE_TOGGLEBUTTON:_("toggle button"), ROLE_BORDER:_("border"), ROLE_CARET:_("caret"), @@ -302,39 +371,63 @@ roleLabels={ ROLE_MENUBUTTON:_("menu button"), # Translators: Reported for a button which expands a grid when it is pressed. ROLE_DROPDOWNBUTTONGRID:_("drop down button grid"), + # Translators: Identifies an equation. ROLE_EQUATION:_("equation"), ROLE_GRIP:_("grip"), + # Translators: Identifies a hot key field (a field where one can enter a hot key for something, such as assigning shortcut for icons on the desktop). ROLE_HOTKEYFIELD:_("hot key field"), ROLE_INDICATOR:_("indicator"), + # Translators: Identifies a spin button (a button used to go through options in a spinning fashion). ROLE_SPINBUTTON:_("spin button"), + # Translators: Identifies a sound clip on websites. ROLE_SOUND:_("sound"), + # Translators: Identifies a whitespace. ROLE_WHITESPACE:_("white space"), + # Translators: Identifies a tree view button. ROLE_TREEVIEWBUTTON:_("tree view button"), + # Translators: Identifies an IP address (an IP address field element). ROLE_IPADDRESS:_("IP address"), + # Translators: Identifies a desktop icon (the icons on the desktop such as computer and various shortcuts for programs). ROLE_DESKTOPICON:_("desktop icon"), + # Translators: Identifies an alert message. ROLE_ALERT:_("alert"), ROLE_INTERNALFRAME:_("IFrame"), + # Translators: Identifies desktop pane (the desktop window). ROLE_DESKTOPPANE:_("desktop pane"), ROLE_OPTIONPANE:_("option pane"), ROLE_COLORCHOOSER:_("color chooser"), ROLE_FILECHOOSER:_("file chooser"), ROLE_FILLER:_("filler"), + # Translators: Identifies a menu such as file menu. ROLE_MENU:_("menu"), ROLE_PANEL:_("panel"), + # Translators: Identifies a password field (a protected edit field for entering passwords such as when logging into web-based email sites). ROLE_PASSWORDEDIT:_("password edit"), ROLE_FONTCHOOSER:_("font chooser"), ROLE_LINE:_("line"), + # Translators: Identifies a font name. ROLE_FONTNAME:_("font name"), + # Translators: Identifies font size. ROLE_FONTSIZE:_("font size"), + # Translators: Describes text formatting. ROLE_BOLD:_("bold"), + # Translators: Describes text formatting. ROLE_ITALIC:_("ITALIC"), + # Translators: Describes text formatting. ROLE_UNDERLINE:_("underline"), + # Translators: Describes text formatting. ROLE_FGCOLOR:_("foreground color"), + # Translators: Describes text formatting. ROLE_BGCOLOR:_("background color"), + # Translators: Describes text formatting. ROLE_SUPERSCRIPT:_("superscript"), + # Translators: Describes text formatting. ROLE_SUBSCRIPT:_("subscript"), + # Translators: Describes style of text. ROLE_STYLE:_("style"), + # Translators: Describes text formatting. ROLE_INDENT:_("indent"), + # Translators: Describes text formatting. ROLE_ALIGNMENT:_("alignment"), ROLE_ALERT:_("alert"), ROLE_DATAGRID:_("data grid"), @@ -345,28 +438,47 @@ roleLabels={ } stateLabels={ + # Translators: This is presented when a control or document is unavailable. STATE_UNAVAILABLE:_("unavailable"), + # Translators: This is presented when a control has focus. STATE_FOCUSED:_("focused"), + # Translators: This is presented when the control is selected. STATE_SELECTED:_("selected"), + # Translators: This is presented when a document is busy. STATE_BUSY:_("busy"), + # Translators: This is presented when a button is pressed. STATE_PRESSED:_("pressed"), + # Translators: This is presented when a check box is checked. STATE_CHECKED:_("checked"), + # Translators: This is presented when a three state check box is half checked. STATE_HALFCHECKED:_("half checked"), + # Translators: This is presented when the control is a read-only control such as read-only edit box. STATE_READONLY:_("read only"), + # Translators: This is presented when a tree view or submenu item is expanded. STATE_EXPANDED:_("expanded"), + # Translators: This is presented when a tree view or submenu is collapsed. STATE_COLLAPSED:_("collapsed"), + # Translators: This is presented when a control or a document becomes invisible. STATE_INVISIBLE:_("invisible"), + # Translators: This is presented when a visited link is encountered. STATE_VISITED:_("visited"), + # Translators: This is presented when a link is encountered. STATE_LINKED:_("linked"), + # Translators: This is presented when the control menu item has a submenu. STATE_HASPOPUP:_("subMenu"), + # Translators: This is presented when a protected control or a document is encountered. STATE_PROTECTED:_("protected"), + # Translators: This is presented when a required form field is encountered. STATE_REQUIRED:_("required"), # Translators: Reported when an object no longer exists in the user interface; # i.e. it is dead and is no longer usable. STATE_DEFUNCT:_("defunct"), + # Translators: This is presented when an invalid entry has been made. STATE_INVALID_ENTRY:_("invalid entry"), STATE_MODAL:_("modal"), + # Translators: This is presented when a field supports auto completion of entered text such as email address field in Microsoft Outlook. STATE_AUTOCOMPLETE:_("has auto complete"), + # Translators: This is presented when an edit field allows typing multiple lines of text such as comment fields on websites. STATE_MULTILINE:_("multi line"), STATE_ICONIFIED:_("iconified"), STATE_OFFSCREEN:_("off screen"), diff --git a/source/core.py b/source/core.py index be55b3108..5fb7c1cad 100644 --- a/source/core.py +++ b/source/core.py @@ -156,6 +156,7 @@ This initializes all modules such as audio, IAccessible, keyboard, mouse, and GU speech.initialize() if not globalVars.appArgs.minimal and (time.time()-globalVars.startTime)>5: log.debugWarning("Slow starting core (%.2f sec)" % (time.time()-globalVars.startTime)) + # Translators: This is spoken when NVDA is starting. speech.speakMessage(_("Loading NVDA. Please wait...")) import wx log.info("Using wx version %s"%wx.version()) @@ -256,6 +257,7 @@ This initializes all modules such as audio, IAccessible, keyboard, mouse, and GU wx.CallAfter(gui.installerGui.doSilentInstall) elif not globalVars.appArgs.minimal: try: + # Translators: This is shown on a braille display (if one is connected) when NVDA starts. braille.handler.message(_("NVDA started")) except: log.error("", exc_info=True) diff --git a/source/globalCommands.py b/source/globalCommands.py index 759cc3a57..fb8d590fd 100755 --- a/source/globalCommands.py +++ b/source/globalCommands.py @@ -61,7 +61,7 @@ class GlobalCommands(ScriptableObject): else: eventHandler.executeEvent("loseFocus",curFocus) curApp.sleepMode=True - # Translators: This is presented when sleep mode is activated, the focused application is self vocing, such as klango or openbook. + # Translators: This is presented when sleep mode is activated, the focused application is self voicing, such as klango or openbook. ui.message(_("Sleep mode on")) script_toggleCurrentAppSleepMode.__doc__=_("Toggles sleep mode on and off for the active application.") script_toggleCurrentAppSleepMode.allowInSleepMode=True @@ -83,12 +83,14 @@ class GlobalCommands(ScriptableObject): script_reportCurrentLine.__doc__=_("Reports the current line under the application cursor. Pressing this key twice will spell the current line") def script_leftMouseClick(self,gesture): + # Translators: Reported when left mouse button is clicked. ui.message(_("left click")) winUser.mouse_event(winUser.MOUSEEVENTF_LEFTDOWN,0,0,None,None) winUser.mouse_event(winUser.MOUSEEVENTF_LEFTUP,0,0,None,None) script_leftMouseClick.__doc__=_("Clicks the left mouse button once at the current mouse position") def script_rightMouseClick(self,gesture): + # Translators: Reported when right mouse button is clicked. ui.message(_("right click")) winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN,0,0,None,None) winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP,0,0,None,None) @@ -142,6 +144,7 @@ class GlobalCommands(ScriptableObject): def script_increaseSynthSetting(self,gesture): settingName=globalVars.settingsRing.currentSettingName if not settingName: + # Translators: Reported when there are no settings to configure in synth settings ring (example: when there is no setting for language). ui.message(_("No settings")) return settingValue=globalVars.settingsRing.increase() @@ -239,6 +242,7 @@ class GlobalCommands(ScriptableObject): try: (left,top,width,height)=obj.location except: + # Translators: Reported when the object has no location for the mouse to move to it. ui.message(_("object has no location")) return x=left+(width/2) @@ -248,6 +252,7 @@ class GlobalCommands(ScriptableObject): script_moveMouseToNavigatorObject.__doc__=_("Moves the mouse pointer to the current navigator object") def script_moveNavigatorObjectToMouse(self,gesture): + # Translators: Reported when attempting to move the navigator object to the object under mouse pointer. ui.message(_("Move navigator object to mouse")) obj=api.getMouseObject() api.setNavigatorObject(obj) @@ -265,6 +270,7 @@ class GlobalCommands(ScriptableObject): pos.expand(textInfos.UNIT_LINE) speech.speakTextInfo(pos) else: + # Translators: reported when object does not support flat review (example: some graphic window). speech.speakMessage(_("No flat review for this object")) script_navigatorObject_moveToFlatReviewAtObjectPosition.__doc__=_("Moves to flat review for the screen (or document if currently inside one) and positions the review cursor at the location of the current object") @@ -278,6 +284,7 @@ class GlobalCommands(ScriptableObject): api.setNavigatorObject(obj) speech.speakObject(obj,reason=controlTypes.REASON_FOCUS) else: + # Translators: Reported when there is no object at flat review position. speech.speakMessage(_("No object at flat review position")) script_navigatorObject_moveToObjectAtFlatReviewPosition.__doc__=_("Moves navigator object to the object represented by the text at the position of the review cursor within flat review") @@ -312,6 +319,7 @@ class GlobalCommands(ScriptableObject): speech.speakSpelling(text) else: if api.copyToClip(text): + # Translators: Indicates something has been copied to clipboard (example output: title text copied to clipboard). speech.speakMessage(_("%s copied to clipboard")%text) else: speech.speakObject(curObject,reason=controlTypes.REASON_QUERY) @@ -323,16 +331,19 @@ class GlobalCommands(ScriptableObject): ui.message(_("no navigator object")) location=obj.location if not location: + # Translators: Reported when attempting to find out the navigator object's dimensions (width, height) but cannot obtain object's location. ui.message(_("No location information for navigator object")) (left,top,width,height)=location deskLocation=api.getDesktopObject().location if not deskLocation: + # Translators: Reported when attempting to find out the navigator object's dimensions but the screen does not provide location information. ui.message(_("No location information for screen")) (deskLeft,deskTop,deskWidth,deskHeight)=deskLocation percentFromLeft=(float(left-deskLeft)/deskWidth)*100 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). ui.message(_("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").format(left=percentFromLeft,top=percentFromTop,width=percentWidth,height=percentHeight)) script_navigatorObject_currentDimensions.__doc__=_("Reports the hight, width and position of the current navigator object") @@ -343,6 +354,7 @@ class GlobalCommands(ScriptableObject): except (NotImplementedError,RuntimeError): pos=obj.makeTextInfo(textInfos.POSITION_FIRST) api.setReviewPosition(pos) + # Translators: Reported when attempting to move the navigator object to focus. speech.speakMessage(_("move to focus")) speech.speakObject(obj,reason=controlTypes.REASON_FOCUS) script_navigatorObject_toFocus.__doc__=_("Sets the navigator object to the current focus, and the review cursor to the position of the caret inside it, if possible.") @@ -350,8 +362,12 @@ class GlobalCommands(ScriptableObject): def script_navigatorObject_moveFocus(self,gesture): obj=api.getNavigatorObject() if not isinstance(obj,NVDAObject): + # Translators: Reported when: + # 1. There is no focusable object e.g. cannot use tab and shift tab to move to controls. + # 2. Trying to move focus to navigator object but there is no focus. speech.speakMessage(_("no focus")) if scriptHandler.getLastScriptRepeatCount()==0: + # Translators: Reported when attempting to move focus to navigator object. ui.message(_("move focus")) obj.setFocus() else: @@ -359,6 +375,7 @@ class GlobalCommands(ScriptableObject): try: review.updateCaret() except NotImplementedError: + # Translators: Reported when trying to move caret to the position of the review cursor but there is no caret. ui.message(_("no caret")) return info=review.copy() @@ -377,6 +394,7 @@ class GlobalCommands(ScriptableObject): api.setNavigatorObject(curObject) speech.speakObject(curObject,reason=controlTypes.REASON_FOCUS) else: + # Translators: Reported when there is no containing (parent) object such as when focused on desktop. speech.speakMessage(_("No containing object")) script_navigatorObject_parent.__doc__=_("Moves the navigator object to the object containing it") @@ -391,6 +409,7 @@ class GlobalCommands(ScriptableObject): api.setNavigatorObject(curObject) speech.speakObject(curObject,reason=controlTypes.REASON_FOCUS) else: + # Translators: Reported when there is no next object (current object is the last object). speech.speakMessage(_("No next")) script_navigatorObject_next.__doc__=_("Moves the navigator object to the next object") @@ -405,6 +424,7 @@ class GlobalCommands(ScriptableObject): api.setNavigatorObject(curObject) speech.speakObject(curObject,reason=controlTypes.REASON_FOCUS) else: + # Translators: Reported when there is no previous object (current object is the first object). speech.speakMessage(_("No previous")) script_navigatorObject_previous.__doc__=_("Moves the navigator object to the previous object") @@ -419,6 +439,7 @@ class GlobalCommands(ScriptableObject): api.setNavigatorObject(curObject) speech.speakObject(curObject,reason=controlTypes.REASON_FOCUS) else: + # Translators: Reported when there is no contained (first child) object such as inside a document. speech.speakMessage(_("No objects inside")) script_navigatorObject_firstChild.__doc__=_("Moves the navigator object to the first object inside it") @@ -616,7 +637,7 @@ class GlobalCommands(ScriptableObject): speech.speechMode=speech.speechMode_talk newMode=(curMode+1)%3 if newMode==speech.speechMode_off: - # Translators: A speech mode which dissables speech output. + # Translators: A speech mode which disables speech output. name=_("speech mode off") elif newMode==speech.speechMode_beeps: # Translators: A speech mode which will cause NVDA to beep instead of speaking. @@ -703,6 +724,7 @@ class GlobalCommands(ScriptableObject): textList.append(text) if not textList: + # Translators: Reported when trying to obtain formatting information (such as font name, indentation and so on) but there is no formatting information for the text under cursor. ui.message(_("No formatting information")) return @@ -738,6 +760,7 @@ class GlobalCommands(ScriptableObject): api.setReviewPosition(info) found=True if not found: + # Translators: Reported when there is no status line for the current program or window. ui.message(_("No status line found")) return if scriptHandler.getLastScriptRepeatCount()==0: @@ -764,6 +787,7 @@ class GlobalCommands(ScriptableObject): if not isinstance(title,basestring) or not title or title.isspace(): title=obj.appModule.appName if obj.appModule else None if not isinstance(title,basestring) or not title or title.isspace(): + # Translators: Reported when there is no title text for current program or window. title=_("no title") repeatCount=scriptHandler.getLastScriptRepeatCount() if repeatCount==0: @@ -796,15 +820,19 @@ class GlobalCommands(ScriptableObject): outputMode=config.conf["presentation"]["progressBarUpdates"]["progressBarOutputMode"] if outputMode=="both": outputMode="off" + # Translators: A mode where no progress bar updates are given. ui.message(_("no progress bar updates")) elif outputMode=="off": outputMode="speak" + # Translators: A mode where progress bar updates will be spoken. ui.message(_("speak progress bar updates")) elif outputMode=="speak": outputMode="beep" + # Translators: A mode where beeps will indicate progress bar updates (beeps rise in pitch as progress bar updates). ui.message(_("beep for progress bar updates")) else: outputMode="both" + # Translators: A mode where both speech and beeps will indicate progress bar updates. ui.message(_("beep and speak progress bar updates")) config.conf["presentation"]["progressBarUpdates"]["progressBarOutputMode"]=outputMode script_toggleProgressBarOutput.__doc__=_("Toggles between beeps, speech, beeps and speech, and off, for reporting progress bar updates") @@ -855,10 +883,12 @@ class GlobalCommands(ScriptableObject): log.error("error accessing system power status") return if sps.BatteryFlag & NO_SYSTEM_BATTERY: + # Translators: This is presented when there is no battery such as desktop computers and laptops with battery pack removed. ui.message(_("no system battery")) return # Translators: This is presented to inform the user of the current battery percentage. text = _("%d percent") % sps.BatteryLifePercent + " " + # Translators: This is presented when AC power is connected such as when recharging a laptop battery. if sps.ACLineStatus & AC_ONLINE: text += _("AC power on") elif sps.BatteryLifeTime!=0xffffffff: # Translators: This is the estimated remaining runtime of the laptop battery. @@ -868,15 +898,22 @@ class GlobalCommands(ScriptableObject): def script_passNextKeyThrough(self,gesture): keyboardHandler.passNextKeyThrough() + # Translators: Spoken to indicate that the next key press will be sent straight to the current program as though NVDA is not running. ui.message(_("Pass next key through")) script_passNextKeyThrough.__doc__=_("The next key that is pressed will not be handled at all by NVDA, it will be passed directly through to Windows.") def script_reportAppModuleInfo(self,gesture): focus=api.getFocusObject() appName=appModuleHandler.getAppNameFromProcessID(focus.processID,True) + # Translators: Indicates the name of the current program (example output: Currently running application is explorer.exe). + # Note that it does not give friendly name such as Windows Explorer; it presents the file name of the current application. + # If there is an appModule for the current program, NVDA speaks the name of the module after presenting this message. message = _("Currently running application is %s") % appName mod=focus.appModule if isinstance(mod,appModuleHandler.AppModule) and type(mod)!=appModuleHandler.AppModule: + # Translators: Indicates the name of the appModule for the current program (example output: and currently loaded module is explorer). + # For example, the complete message for Windows explorer is: Currently running application is explorer.exe and currently loaded module is explorer. + # This message will not be presented if there is no module for the current program. message += _(" and currently loaded module is %s") % mod.appModuleName.split(".")[0] ui.message(message) script_reportAppModuleInfo.__doc__ = _("Speaks the filename of the active application along with the name of the currently loaded appModule") @@ -942,6 +979,7 @@ class GlobalCommands(ScriptableObject): else: braille.handler.tether = braille.handler.TETHER_FOCUS tetherMsg = _("focus") + # Translators: Reports which position braille is tethered to (braille can be tethered to either focus or review position). ui.message(_("Braille tethered to %s") % tetherMsg) script_braille_toggleTether.__doc__ = _("Toggle tethering of braille between the focus and the review position") @@ -951,32 +989,40 @@ class GlobalCommands(ScriptableObject): except: text = None if not text or not isinstance(text,basestring) or text.isspace(): + # Translators: Presented when there is no text on the clipboard. ui.message(_("There is no text on the clipboard")) return if len(text) < 1024: ui.message(text) else: + # Translators: If the number of characters on the clipboard is greater than about 1000, it reports this message and gives number of characters on the clipboard. + # Example output: The clipboard contains a large portion of text. It is 2300 characters long. ui.message(_("The clipboard contains a large portion of text. It is %s characters long") % len(text)) script_reportClipboardText.__doc__ = _("Reports the text on the Windows clipboard") def script_review_markStartForCopy(self, gesture): self._copyStartMarker = api.getReviewPosition().copy() + # Translators: Indicates start of review cursor text to be copied to clipboard. ui.message(_("Start marked")) script_review_markStartForCopy.__doc__ = _("Marks the current position of the review cursor as the start of text to be copied") def script_review_copy(self, gesture): if not getattr(self, "_copyStartMarker", None): + # Translators: Presented when attempting to copy some review cursor text but there is no start marker. ui.message(_("No start marker set")) return pos = api.getReviewPosition().copy() if self._copyStartMarker.obj != pos.obj: + # Translators: Presented when trying to copy text residing on a different object (that is, start marker is in object 1 but trying to copy text from object 2). ui.message(_("The start marker must reside within the same object")) return pos.move(textInfos.UNIT_CHARACTER, 1, endPoint="end") pos.setEndPoint(self._copyStartMarker, "startToStart") if pos.compareEndPoints(pos, "startToEnd") < 0 and pos.copyToClipboard(): + # Translators: Presented when some review text has been copied to clipboard. ui.message(_("Review selection copied to clipboard")) else: + # Translators: Presented when there is no text selection to copy from review cursor. ui.message(_("No text to copy")) return self._copyStartMarker = None @@ -1015,6 +1061,7 @@ class GlobalCommands(ScriptableObject): appModuleHandler.reloadAppModules() globalPluginHandler.reloadGlobalPlugins() NVDAObject.clearDynamicClassCache() + # Translators: Presented when plugins (app modules and global plugins) are reloaded. ui.message(_("Plugins reloaded")) script_reloadPlugins.__doc__=_("Reloads app modules and global plugins without restarting NVDA, which can be Useful for developers") diff --git a/source/installer.py b/source/installer.py index e1af6e856..f2283a9a1 100644 --- a/source/installer.py +++ b/source/installer.py @@ -155,14 +155,17 @@ def registerInstallation(installDir,startMenuFolder,shouldCreateDesktopShortcut, if shouldCreateDesktopShortcut: createShortcut(u"NVDA.lnk",targetPath=slaveExe,arguments="launchNVDA -r",hotkey="CTRL+ALT+N",workingDirectory=installDir,prependSpecialFolder="AllUsersDesktop") createShortcut(os.path.join(startMenuFolder,"NVDA.lnk"),targetPath=NVDAExe,workingDirectory=installDir,prependSpecialFolder="AllUsersPrograms") + # Translators: A label for a shortcut in start menu and a menu entry in NVDA menu (to go to NVDA website). createShortcut(os.path.join(startMenuFolder,_("NVDA web site")+".lnk"),targetPath=versionInfo.url,prependSpecialFolder="AllUsersPrograms") + # Translators: A label for a shortcut item in start menu to uninstall NVDA from the computer. createShortcut(os.path.join(startMenuFolder,_("Uninstall NVDA")+".lnk"),targetPath=os.path.join(installDir,"uninstall.exe"),workingDirectory=installDir,prependSpecialFolder="AllUsersPrograms") + # Translators: A label for a shortcut item in start menu to open current user's NVDA configuration directory. createShortcut(os.path.join(startMenuFolder,_("Explore NVDA user configuration directory")+".lnk"),targetPath=slaveExe,arguments="explore_userConfigPath",workingDirectory=installDir,prependSpecialFolder="AllUsersPrograms") # Translators: The label of the NVDA Documentation menu in the Start Menu. docFolder=os.path.join(startMenuFolder,_("Documentation")) # Translators: The label of the Start Menu item to open the Commands Quick Reference document. createShortcut(os.path.join(docFolder,_("Commands Quick Reference")+".lnk"),targetPath=getDocFilePath("keyCommands.html",installDir),prependSpecialFolder="AllUsersPrograms") - # Translators: The label of the Start Menu item to open the User Guide. + # Translators: A label for a shortcut in start menu and a menu entry in NVDA menu (to open the user guide). createShortcut(os.path.join(docFolder,_("User Guide")+".lnk"),targetPath=getDocFilePath("userGuide.html",installDir),prependSpecialFolder="AllUsersPrograms") registerAddonFileAssociation(slaveExe) @@ -213,6 +216,7 @@ def registerAddonFileAssociation(slaveExe): try: # Create progID for NVDA ad-ons with _winreg.CreateKeyEx(_winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Classes\\%s" % addonHandler.NVDA_ADDON_PROG_ID, 0, _winreg.KEY_WRITE) as k: + # Translators: A file extension label for NVDA add-on package. _winreg.SetValueEx(k, None, 0, _winreg.REG_SZ, _("NVDA add-on package")) with _winreg.CreateKeyEx(k, "DefaultIcon", 0, _winreg.KEY_WRITE) as k2: _winreg.SetValueEx(k2, None, 0, _winreg.REG_SZ, "@{slaveExe},1".format(slaveExe=slaveExe)) diff --git a/source/keyboardHandler.py b/source/keyboardHandler.py index 618377c63..7ae3e9c77 100644 --- a/source/keyboardHandler.py +++ b/source/keyboardHandler.py @@ -236,7 +236,9 @@ class KeyboardInputGesture(inputCore.InputGesture): #: All possible keyboard layouts, where layout names are mapped to localised layout names. #: @type: dict LAYOUTS = { + # Translators: One of the keyboard layouts for NVDA. "desktop": _("desktop"), + # Translators: One of the keyboard layouts for NVDA. "laptop": _("laptop"), } diff --git a/source/mouseHandler.py b/source/mouseHandler.py index 490a80cd0..b6c054c9d 100644 --- a/source/mouseHandler.py +++ b/source/mouseHandler.py @@ -133,6 +133,7 @@ def pumpAll(): if config.conf["mouse"]["reportMouseShapeChanges"] and mouseShapeChanged>0: if mouseShapeChanged==10: mouseShapeChanged=0 + # Translators: Reported when mouse cursor shape changes (example output: edit cursor). speech.speakMessage(_("%s cursor")%curMouseShape) else: mouseShapeChanged+=1 diff --git a/source/speech.py b/source/speech.py index 40a8cee92..a5af6fbe1 100755 --- a/source/speech.py +++ b/source/speech.py @@ -160,7 +160,7 @@ def speakSpelling(text,locale=None,useCharacterDescriptions=False): locale=defaultLanguage if not text: - # Translators: This is spoken when nvda moves to an empty line. + # Translators: This is spoken when NVDA moves to an empty line. return getSynth().speak((_("blank"),)) if not text.isspace(): text=text.rstrip() @@ -521,6 +521,7 @@ def speakSelectionChange(oldInfo,newInfo,speakSelected=True,speakUnselected=True # Translators: This is spoken to indicate what has been unselected. for example 'unselecting hello' speakSelectionMessage(_("unselecting %s"),text) elif len(unselectedTextList)>0: + # Translators: Reported when selection is removed. speakMessage(_("selection removed")) if not newInfo.isCollapsed: text=newInfo.text @@ -831,6 +832,7 @@ def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues textList.insert(0,_("level %s")%level) oldTreeLevel=level else: + # Translators: Speaks the item level in treeviews (example output: level 2). textList.append(_('level %s')%propertyValues['positionInfo_level']) if cellCoordsText or rowNumber or columnNumber: tableID = propertyValues.get("_tableID") @@ -844,6 +846,7 @@ def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues if rowHeaderText: textList.append(rowHeaderText) if includeTableCellCoords and not cellCoordsText: + # Translators: Speaks current row number (example output: row 3). textList.append(_("row %s")%rowNumber) oldRowNumber = rowNumber if columnNumber and (not sameTable or columnNumber != oldColumnNumber): @@ -851,6 +854,7 @@ def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues if columnHeaderText: textList.append(columnHeaderText) if includeTableCellCoords and not cellCoordsText: + # Translators: Speaks current column number (example output: column 3). textList.append(_("column %s")%columnNumber) oldColumnNumber = columnNumber if includeTableCellCoords and cellCoordsText: @@ -858,10 +862,13 @@ def getSpeechTextForProperties(reason=controlTypes.REASON_QUERY,**propertyValues rowCount=propertyValues.get('rowCount',0) columnCount=propertyValues.get('columnCount',0) if rowCount and columnCount: + # Translators: Speaks number of columns and rows in a table (example output: with 3 rows and 2 columns). textList.append(_("with {rowCount} rows and {columnCount} columns").format(rowCount=rowCount,columnCount=columnCount)) elif columnCount and not rowCount: + # Translators: Speaks number of columns (example output: with 4 columns). textList.append(_("with %s columns")%columnCount) elif rowCount and not columnCount: + # Translators: Speaks number of rows (example output: with 2 rows). textList.append(_("with %s rows")%rowCount) if rowCount or columnCount: # The caller is entering a table, so ensure that it is treated as a new table, even if the previous table was the same. @@ -931,6 +938,7 @@ def getControlFieldSpeech(attrs,ancestorAttrs,fieldType,formatConfig=None,extraD # Special cases if speakEntry and fieldType=="start_addedToControlFieldStack" and role==controlTypes.ROLE_LIST and controlTypes.STATE_READONLY in states: # List. + # Translators: Speaks number of items in a list (example output: list with 5 items). return roleText+" "+_("with %s items")%childCount elif fieldType=="start_addedToControlFieldStack" and role==controlTypes.ROLE_TABLE and tableID: # Table. @@ -957,6 +965,7 @@ def getControlFieldSpeech(attrs,ancestorAttrs,fieldType,formatConfig=None,extraD ): return CHUNK_SEPARATOR.join([x for x in nameText,(stateText if speakStatesFirst else roleText),(roleText if speakStatesFirst else stateText),valueText,descriptionText,levelText,keyboardShortcutText if x]) elif fieldType in ("end_removedFromControlFieldStack","end_relative") and roleText and ((not extraDetail and speakExitForLine) or (extraDetail and speakExitForOther)): + # Translators: Indicates end of something (example output: at the end of a list, speaks out of list). return _("out of %s")%roleText # Special cases @@ -989,6 +998,7 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra headingLevel=attrs.get("heading-level") oldHeadingLevel=attrsCache.get("heading-level") if attrsCache is not None else None if headingLevel and headingLevel!=oldHeadingLevel: + # Translators: Speaks the heading level (example output: heading level 2). text=_("heading level %d")%headingLevel textList.append(text) if formatConfig["reportStyle"]: @@ -1159,6 +1169,7 @@ def getTableInfoSpeech(tableInfo,oldTableInfo,extraDetail=False): if tableInfo is None and oldTableInfo is None: return "" if tableInfo is None and oldTableInfo is not None: + # Translators: Indicates end of a table. return _("out of table") if not oldTableInfo or tableInfo.get("table-id")!=oldTableInfo.get("table-id"): newTable=True @@ -1168,6 +1179,7 @@ def getTableInfoSpeech(tableInfo,oldTableInfo,extraDetail=False): if newTable: columnCount=tableInfo.get("column-count",0) rowCount=tableInfo.get("row-count",0) + # Translators: reports number of columns and rows in a table (example output: table with 3 columns and 5 rows). text=_("table with {columnCount} columns and {rowCount} rows").format(columnCount=columnCount,rowCount=rowCount) textList.append(text) oldColumnNumber=oldTableInfo.get("column-number",0) if oldTableInfo else 0 -- 2.11.0