[orca] More string moving around for profile-based language switching



commit dd979e829b2c675582bb40ec1c300344a0c1be89
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Mar 4 15:00:54 2013 -0500

    More string moving around for profile-based language switching

 src/orca/formatting.py        |   43 +++++++-------
 src/orca/messages.py          |    2 +
 src/orca/object_properties.py |   92 ++++++++++++++++++++++++++++++
 src/orca/settings.py          |  126 +----------------------------------------
 4 files changed, 117 insertions(+), 146 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index 0533edf..e06a184 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -30,6 +30,7 @@ import copy
 import pyatspi
 
 from . import settings
+from . import object_properties
 
 # pylint: disable-msg=C0301
 
@@ -51,30 +52,30 @@ formatting = {
 
     'strings' : {
         'speech': {
-            'required': settings.speechRequiredStateString,
-            'readonly': settings.speechReadOnlyString,
-            'insensitive': settings.speechInsensitiveString,
-            'checkbox': settings.speechCheckboxIndicators,
-            'radiobutton': settings.speechRadioButtonIndicators,
-            'togglebutton': settings.speechToggleButtonIndicators,
-            'expansion': settings.speechExpansionIndicators,
-            'nodelevel': settings.speechNodeLevelString,
-            'nestinglevel': settings.speechNestingLevelString,
-            'multiselect': settings.speechMultiSelectString,
-            'iconindex': settings.speechIconIndexString,
-            'groupindex': settings.speechGroupIndexString,
+            'required': object_properties.STATE_REQUIRED_SPEECH,
+            'readonly': object_properties.STATE_READ_ONLY_SPEECH,
+            'insensitive': object_properties.STATE_INSENSITIVE_SPEECH,
+            'checkbox': object_properties.CHECK_BOX_INDICATORS_SPEECH,
+            'radiobutton': object_properties.RADIO_BUTTON_INDICATORS_SPEECH,
+            'togglebutton': object_properties.TOGGLE_BUTTON_INDICATORS_SPEECH,
+            'expansion': object_properties.EXPANSION_INDICATORS_SPEECH,
+            'nodelevel': object_properties.NODE_LEVEL_SPEECH,
+            'nestinglevel': object_properties.NESTING_LEVEL_SPEECH,
+            'multiselect': object_properties.STATE_MULTISELECT_SPEECH,
+            'iconindex': object_properties.ICON_INDEX_SPEECH,
+            'groupindex': object_properties.GROUP_INDEX_SPEECH,
         },
         'braille': {
             'eol': settings.brailleEOLIndicator,
-            'required': settings.brailleRequiredStateString,
-            'readonly': settings.brailleReadOnlyString,
-            'insensitive': settings.brailleInsensitiveString,
-            'checkbox': settings.brailleCheckBoxIndicators,
-            'radiobutton': settings.brailleRadioButtonIndicators,
-            'togglebutton': settings.brailleToggleButtonIndicators,
-            'expansion': settings.brailleExpansionIndicators,
-            'nodelevel': settings.brailleNodeLevelString,
-            'nestinglevel': settings.brailleNestingLevelString,
+            'required': object_properties.STATE_REQUIRED_BRAILLE,
+            'readonly': object_properties.STATE_READ_ONLY_BRAILLE,
+            'insensitive': object_properties.STATE_INSENSITIVE_BRAILLE,
+            'checkbox': object_properties.CHECK_BOX_INDICATORS_BRAILLE,
+            'radiobutton': object_properties.RADIO_BUTTON_INDICATORS_BRAILLE,
+            'togglebutton': object_properties.TOGGLE_BUTTON_INDICATORS_BRAILLE,
+            'expansion': object_properties.EXPANSION_INDICATORS_BRAILLE,
+            'nodelevel': object_properties.NODE_LEVEL_BRAILLE,
+            'nestinglevel': object_properties.NESTING_LEVEL_BRAILLE,
         },
     },
 
diff --git a/src/orca/messages.py b/src/orca/messages.py
index cddf96d..033681a 100644
--- a/src/orca/messages.py
+++ b/src/orca/messages.py
@@ -1431,6 +1431,8 @@ def repeatedCharCount(repeatChar, count):
                     count) % {"count" : count, "repeatChar": repeatChar}
 
 def selectedItemsCount(selected, total):
+    # Translators: This message is presented to indicate the number of selected
+    # objects (e.g. icons) and the total number of those objects.
     return ngettext("%(index)d of %(total)d item selected",
                     "%(index)d of %(total)d items selected",
                     total) % {"index" : selected, "total" : total}
diff --git a/src/orca/object_properties.py b/src/orca/object_properties.py
index 80dafbd..31b0a85 100644
--- a/src/orca/object_properties.py
+++ b/src/orca/object_properties.py
@@ -31,6 +31,36 @@ __license__   = "LGPL"
 
 from .orca_i18n import _, C_
 
+# Translators: this is a indication of the focused icon and the count of the
+# total number of icons within an icon panel. An example of an icon panel is
+# the Nautilus folder view.
+ICON_INDEX_SPEECH = _("on %(index)d of %(total)d")
+
+# Translators: this refers to the position of an item in a list or group of
+# objects, such as menu items in a menu, radio buttons in a radio button group,
+# combobox item in a combobox, etc.
+GROUP_INDEX_SPEECH = _("%(index)d of %(total)d")
+
+# Translators: This message describes a list item in a document. Nesting level
+# is how "deep" the item is (e.g., a level of 2 represents a list item inside a
+# list that's inside another list).
+NESTING_LEVEL_SPEECH = _("Nesting level %d")
+
+# Translators: This message describes a list item in a document. Nesting level
+# is how "deep" the item is (e.g., a level of 2 represents a list item inside a
+# list that's inside another list). This string is specifically for braille.
+# Because braille displays lack real estate, we're using a shorter string than
+# we use for speech.
+NESTING_LEVEL_BRAILLE = _("LEVEL %d")
+
+# Translators: This represents the depth of a node in a TreeView (i.e. how many
+# ancestors the node has). This is the spoken version.
+NODE_LEVEL_SPEECH = _("tree level %d")
+
+# Translators: This represents the depth of a node in a TreeView (i.e. how many
+# ancestors the node has). This is the braille version.
+NODE_LEVEL_BRAILLE = _("TREE LEVEL %d")
+
 # Translators: The 'h' in this string represents a heading level attribute for
 # content that you might find in something such as HTML content (e.g., <h1>).
 # The translated form is meant to be a single character followed by a numeric
@@ -46,6 +76,16 @@ ROLE_HEADING_LEVEL_SPEECH = _("%(role)s level %(level)d")
 # of icons.
 ROLE_ICON_PANEL = _("Icon panel")
 
+# Translators: This is a state which applies to items which can be expanded
+# or collapsed such as combo boxes and nodes/groups in a treeview. Collapsed
+# means the item's children are not showing; expanded means they are.
+STATE_COLLAPSED = _("collapsed")
+
+# Translators: This is a state which applies to items which can be expanded
+# or collapsed such as combo boxes and nodes/groups in a treeview. Collapsed
+# means the item's children are not showing; expanded means they are.
+STATE_EXPANDED = _("expanded")
+
 # Translators: This is a state which applies to the orientation of widgets
 # such as sliders and scroll bars.
 STATE_HORIZONTAL = _("horizontal")
@@ -83,3 +123,55 @@ STATE_VISITED = C_("link state", "visited")
 
 # Translators: This is a state which applies to a link.
 STATE_UNVISITED = C_("link state", "unvisited")
+
+# Translators: This state represents an item on the screen that has been set
+# insensitive (or grayed out).
+STATE_INSENSITIVE_SPEECH = _("grayed")
+
+# Translators: This state represents an item on the screen that has been set
+# insensitive (or grayed out).
+STATE_INSENSITIVE_BRAILLE = _("grayed")
+
+# Translators: Certain objects (such as form controls on web pages) can have
+# STATE_EDITABLE set to inform the user that this field can be filled out.
+# It is assumed that form fields will be editable; if they lack this state,
+# we need to present that information to the user. This string is the spoken
+# version.
+STATE_READ_ONLY_SPEECH = C_("text", "read only")
+
+# Translators: Certain objects (such as form controls on web pages) can have
+# STATE_EDITABLE set to inform the user that this field can be filled out.
+# It is assumed that form fields will be editable; if they lack this state,
+# we need to present that information to the user. This string is the braille
+# version. (Because braille displays have limited real estate, we abbreviate.)
+STATE_READ_ONLY_BRAILLE =  C_("text", "rdonly")
+
+# Translators: Certain objects (such as form controls on web pages) can have
+# STATE_REQUIRED set to inform the user that this field must be filled out.
+STATE_REQUIRED_SPEECH = _("required")
+
+# Translators: Certain objects (such as form controls on web pages) can have
+# STATE_REQUIRED set to inform the user that this field must be filled out.
+STATE_REQUIRED_BRAILLE = _("required")
+
+# Translators: "multi-select" refers to a web form list in which more than
+# one item can be selected at a time.
+STATE_MULTISELECT_SPEECH = _("multi-select")
+
+
+
+# TODO: Look at why we're doing this as lists.
+
+CHECK_BOX_INDICATORS_SPEECH = \
+    [STATE_NOT_CHECKED, STATE_CHECKED, STATE_PARTIALLY_CHECKED]
+EXPANSION_INDICATORS_SPEECH = \
+    [STATE_COLLAPSED, STATE_EXPANDED]
+RADIO_BUTTON_INDICATORS_SPEECH = \
+    [STATE_UNSELECTED_RADIO_BUTTON, STATE_SELECTED_RADIO_BUTTON]
+TOGGLE_BUTTON_INDICATORS_SPEECH = \
+    [STATE_NOT_PRESSED, STATE_PRESSED]
+
+CHECK_BOX_INDICATORS_BRAILLE     = ["< >", "<x>", "<->"]
+EXPANSION_INDICATORS_BRAILLE     = [STATE_COLLAPSED, STATE_EXPANDED]
+RADIO_BUTTON_INDICATORS_BRAILLE  = ["& y", "&=y"]
+TOGGLE_BUTTON_INDICATORS_BRAILLE = ["& y", "&=y"]
diff --git a/src/orca/settings.py b/src/orca/settings.py
index b798fe1..0f0c9dd 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -757,144 +757,20 @@ defaultModifierMask = NON_LOCKING_MODIFIER_MASK
 #
 presentRequiredState = False
 
-########################################################################
-#                                                                      #
-# Sounds                                                               #
-#                                                                      #
-########################################################################
+
 
 # A dictionary where the keys are rolenames and the values are
 # filenames containing audio snippets.
 #
 sounds = {}
 
-########################################################################
-#                                                                      #
-# Strings for speech and braille                                       #
-#                                                                      #
-########################################################################
-
-# Translators: Certain objects (such as form controls on web pages)
-# can have STATE_REQUIRED set on them to inform the user that this
-# field must be filled out. This string is the default string which
-# will be spoken and displayed in braille to indicate this state is
-# present.
-#
-speechRequiredStateString = _("required")
-
-# Translators: this is used to indicate the user is in a text
-# area that is not editable.  It is meant to be spoken to the user.
-#
-speechReadOnlyString = C_("text", "read only")
-
-# Translators: this represents an item on the screen that has
-# been set insensitive (or grayed out).
-#
-speechInsensitiveString = _("grayed")
 
-# Translators: this represents the state of a checkbox.  It is meant
-# to be spoken to the user.
-#
-speechCheckboxIndicators = [_("not checked"),
-                            _("checked"),
-                            _("partially checked")]
-
-# Translators: this represents the state of a radio button.  It is
-# meant to be spoken to the user.
-#
-speechRadioButtonIndicators = [C_("radiobutton", "not selected"),
-                               C_("radiobutton", "selected")]
-
-# Translators: this represents the state of a toggle button.  It is
-# meant to be spoken to the user.
-#
-speechToggleButtonIndicators = [_("not pressed"), _("pressed")]
-
-# Translators: this represents the state of a node in a tree.
-# 'expanded' means the children are showing.  'collapsed' means the
-# children are not showing.
-#
-speechExpansionIndicators = [_("collapsed"), _("expanded")]
-
-# Translators: "multi-select" refers to a web form list
-# in which more than one item can be selected at a time.
-#
-speechMultiSelectString = _("multi-select")
-
-# Translators: this represents the depth of a node in a tree
-# view (i.e., how many ancestors a node has).  It is meant to be
-# spoken.
-#
-speechNodeLevelString = _("tree level %d")
-
-# Translators: this represents a list item in a document.
-# The nesting level is how 'deep' the item is (e.g., a
-# level of 2 represents a list item inside a list that's
-# inside another list). This is meant to be spoken.
-#
-speechNestingLevelString = _("Nesting level %d")
-
-# Translators: this is a indication of the focused icon and the
-# count of the total number of icons within an icon panel. An
-# example of an icon panel is the Nautilus folder view.
-#
-speechIconIndexString = _("on %(index)d of %(total)d")
-
-# Translators: this refers to the position of an item in a list
-# or group of objects, such as menu items in a menu, radio buttons
-# in a radio button group, combobox item in a combobox, etc.
-#
-speechGroupIndexString = _("%(index)d of %(total)d")
 
 # string to indicate end of printed line for braille displays:
 #
 disableBrailleEOL = False
 brailleEOLIndicator = " $l"
 
-# Translators: Certain objects (such as form controls on web pages)
-# can have STATE_REQUIRED set on them to inform the user that this
-# field must be filled out. This string is the default string which
-# will be spoken and displayed in braille to indicate this state is
-# present.
-#
-brailleRequiredStateString = _("required")
-
-# Translators: this is used to indicate the user is in a text
-# area that is not editable.  It is meant to be a short abbreviation
-# to be presented on the braille display.
-#
-brailleReadOnlyString = C_("text", "rdonly")
-
-# Translators: this represents an item on the screen that has
-# been set insensitive (or grayed out).
-#
-brailleInsensitiveString = _("grayed")
-
-# Strings used to indicate checkbox/radio button states in braille:
-#
-brailleCheckBoxIndicators = ["< >", "<x>", "<->"]
-brailleRadioButtonIndicators = ["& y", "&=y"]
-brailleToggleButtonIndicators = ["& y", "&=y"]
-
-# Translators: this represents the state of a node in a tree.
-# 'expanded' means the children are showing.  'collapsed' means the
-# children are not showing.
-#
-brailleExpansionIndicators = [_("collapsed"), _("expanded")]
-
-# Translators: this represents the depth of a node in a tree
-# view (i.e., how many ancestors a node has).  It is meant to
-# be presented on a braille display.
-#
-brailleNodeLevelString = _("TREE LEVEL %d")
-
-# Translators: this represents a list item in a document.
-# The nesting level is how 'deep' the item is (e.g., a
-# level of 2 represents a list item inside a list that's
-# inside another list).  It is meant to be presented on
-# the braille display.
-#
-brailleNestingLevelString = _("LEVEL %d")
 
 # String for delimiters between table cells
 #


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]