OSDN Git Service

Add translator comments for reporting of formatting.
authorJames Teh <jamie@jantrid.net>
Fri, 20 Apr 2012 02:07:02 +0000 (12:07 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 20 Apr 2012 02:07:02 +0000 (12:07 +1000)
source/speech.py

index 2ddfa16..d5982e4 100755 (executable)
@@ -957,6 +957,8 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
                pageNumber=attrs.get("page-number")\r
                oldPageNumber=attrsCache.get("page-number") if attrsCache is not None else None\r
                if pageNumber and pageNumber!=oldPageNumber:\r
+                       # Translators: Indicates the page number in a document.\r
+                       # %s will be replaced with the page number.\r
                        text=_("page %s")%pageNumber\r
                        textList.append(text)\r
        if  formatConfig["reportStyle"]:\r
@@ -964,8 +966,13 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
                oldStyle=attrsCache.get("style") if attrsCache is not None else None\r
                if style!=oldStyle:\r
                        if style:\r
+                               # Translators: Indicates the style of text.\r
+                               # A style is a collection of formatting settings and depends on the application.\r
+                               # %s will be replaced with the name of the style.\r
                                text=_("style %s")%style\r
                        else:\r
+                               # Translators: Indicates that text has reverted to the default style.\r
+                               # A style is a collection of formatting settings and depends on the application.\r
                                text=_("default style")\r
                        textList.append(text)\r
        if  formatConfig["reportFontName"]:\r
@@ -999,38 +1006,58 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
                lineNumber=attrs.get("line-number")\r
                oldLineNumber=attrsCache.get("line-number") if attrsCache is not None else None\r
                if lineNumber is not None and lineNumber!=oldLineNumber:\r
+                       # Translators: Indicates the line number of the text.\r
+                       # %s will be replaced with the line number.\r
                        text=_("line %s")%lineNumber\r
                        textList.append(text)\r
        if  formatConfig["reportFontAttributes"]:\r
                bold=attrs.get("bold")\r
                oldBold=attrsCache.get("bold") if attrsCache is not None else None\r
                if (bold or oldBold is not None) and bold!=oldBold:\r
-                       text=_("bold") if bold else _("no bold")\r
+                       # Translators: Reported when text is bolded.\r
+                       text=(_("bold") if bold\r
+                               # Translators: Reported when text is not bolded.\r
+                               else _("no bold"))\r
                        textList.append(text)\r
                italic=attrs.get("italic")\r
                oldItalic=attrsCache.get("italic") if attrsCache is not None else None\r
                if (italic or oldItalic is not None) and italic!=oldItalic:\r
-                       text=_("italic") if italic else _("no italic")\r
+                       # Translators: Reported when text is italicized.\r
+                       text=(_("italic") if italic\r
+                               # Translators: Reported when text is not italicized.\r
+                               else _("no italic"))\r
                        textList.append(text)\r
                strikethrough=attrs.get("strikethrough")\r
                oldStrikethrough=attrsCache.get("strikethrough") if attrsCache is not None else None\r
                if (strikethrough or oldStrikethrough is not None) and strikethrough!=oldStrikethrough:\r
-                       text=_("strikethrough") if strikethrough else _("no strikethrough")\r
+                       # Translators: Reported when text is formatted with strikethrough.\r
+                       # See http://en.wikipedia.org/wiki/Strikethrough\r
+                       text=(_("strikethrough") if strikethrough\r
+                               # Translators: Reported when text is formatted without strikethrough.\r
+                               # See http://en.wikipedia.org/wiki/Strikethrough\r
+                               else _("no strikethrough"))\r
                        textList.append(text)\r
                underline=attrs.get("underline")\r
                oldUnderline=attrsCache.get("underline") if attrsCache is not None else None\r
                if (underline or oldUnderline is not None) and underline!=oldUnderline:\r
-                       text=_("underlined") if underline else _("not underlined")\r
+                       # Translators: Reported when text is underlined.\r
+                       text=(_("underlined") if underline\r
+                               # Translators: Reported when text is not underlined.\r
+                               else _("not underlined"))\r
                        textList.append(text)\r
                textPosition=attrs.get("text-position")\r
                oldTextPosition=attrsCache.get("text-position") if attrsCache is not None else None\r
                if (textPosition or oldTextPosition is not None) and textPosition!=oldTextPosition:\r
                        textPosition=textPosition.lower() if textPosition else textPosition\r
                        if textPosition=="super":\r
+                               # Translators: Reported for superscript text.\r
                                text=_("superscript")\r
                        elif textPosition=="sub":\r
+                               # Translators: Reported for subscript text.\r
                                text=_("subscript")\r
                        else:\r
+                               # Translators: Reported for text which is at the baseline position;\r
+                               # i.e. not superscript or subscript.\r
                                text=_("baseline")\r
                        textList.append(text)\r
        if formatConfig["reportAlignment"]:\r
@@ -1039,14 +1066,20 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
                if (textAlign or oldTextAlign is not None) and textAlign!=oldTextAlign:\r
                        textAlign=textAlign.lower() if textAlign else textAlign\r
                        if textAlign=="left":\r
+                               # Translators: Reported when text is left-aligned.\r
                                text=_("align left")\r
                        elif textAlign=="center":\r
+                               # Translators: Reported when text is centered.\r
                                text=_("align center")\r
                        elif textAlign=="right":\r
+                               # Translators: Reported when text is right-aligned.\r
                                text=_("align right")\r
                        elif textAlign=="justify":\r
+                               # Translators: Reported when text is justified.\r
+                               # See http://en.wikipedia.org/wiki/Typographic_alignment#Justified\r
                                text=_("align justify")\r
                        else:\r
+                               # Translators: Reported when text has reverted to default alignment.\r
                                text=_("align default")\r
                        textList.append(text)\r
        if  formatConfig["reportLinks"]:\r
@@ -1059,6 +1092,7 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
                comment=attrs.get("comment")\r
                oldComment=attrsCache.get("comment") if attrsCache is not None else None\r
                if comment and comment!=oldComment:\r
+                       # Translators: Reported when text contains a comment.\r
                        text=_("has comment")\r
                        textList.append(text)\r
        if formatConfig["reportSpellingErrors"]:\r
@@ -1066,8 +1100,10 @@ def getFormatFieldSpeech(attrs,attrsCache=None,formatConfig=None,unit=None,extra
                oldInvalidSpelling=attrsCache.get("invalid-spelling") if attrsCache is not None else None\r
                if (invalidSpelling or oldInvalidSpelling is not None) and invalidSpelling!=oldInvalidSpelling:\r
                        if invalidSpelling:\r
+                               # Translators: Reported when text contains a spelling error.\r
                                text=_("spelling error")\r
                        elif extraDetail:\r
+                               # Translators: Reported when moving out of text containing a spelling error.\r
                                text=_("out of spelling error")\r
                        else:\r
                                text=""\r