[orca] More work on getting strings in the right language for profile-based language switching
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] More work on getting strings in the right language for profile-based language switching
- Date: Mon, 4 Mar 2013 16:36:04 +0000 (UTC)
commit 1aeaea94874908ba70bf78c1064924d94230bc1d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Sat Mar 2 16:28:35 2013 -0500
More work on getting strings in the right language for profile-based language switching
po/POTFILES.in | 33 +-
src/orca/Makefile.am | 3 +
src/orca/app_gui_prefs.py | 2 +-
src/orca/bookmarks.py | 48 +-
src/orca/braille.py | 161 ++---
src/orca/braille_generator.py | 11 +-
src/orca/brltablenames.py | 156 ++++
src/orca/chat.py | 98 +--
src/orca/cmdnames.py | 452 +++++++++++
src/orca/common_keyboardmap.py | 3 -
src/orca/event_manager.py | 9 +-
src/orca/find.py | 25 +-
src/orca/flat_review.py | 53 +-
src/orca/guilabels.py | 399 ++++++++++
src/orca/input_event.py | 20 +-
src/orca/liveregions.py | 45 +-
src/orca/messages.py | 626 +++++++++++++++-
src/orca/notification_messages.py | 70 +--
src/orca/object_properties.py | 85 ++
src/orca/orca.py | 1 -
src/orca/orca_i18n.py.in | 5 +-
src/orca/script_utilities.py | 38 +-
src/orca/scripts/apps/evolution/script.py | 4 +-
src/orca/scripts/apps/gcalctool/script.py | 12 +-
src/orca/scripts/apps/gnome-search-tool/script.py | 14 +-
.../scripts/apps/gtk-window-decorator/script.py | 9 +-
src/orca/scripts/apps/metacity/script.py | 7 +-
src/orca/scripts/apps/nautilus/script.py | 8 +-
.../scripts/apps/notification-daemon/script.py | 9 +-
src/orca/scripts/apps/notify-osd/script.py | 7 +-
src/orca/scripts/apps/packagemanager/script.py | 11 +-
src/orca/scripts/apps/pidgin/script.py | 5 +-
src/orca/scripts/apps/soffice/script.py | 402 +---------
src/orca/scripts/apps/soffice/speech_generator.py | 18 +-
.../scripts/apps/soffice/structural_navigation.py | 7 +-
src/orca/scripts/default.py | 32 +-
src/orca/scripts/toolkits/Gecko/bookmarks.py | 43 +-
src/orca/scripts/toolkits/Gecko/script.py | 385 ++--------
.../scripts/toolkits/Gecko/speech_generator.py | 64 +--
.../J2SE-access-bridge/speech_generator.py | 9 +-
.../toolkits/WebKitGtk/braille_generator.py | 12 +-
src/orca/scripts/toolkits/WebKitGtk/script.py | 59 +--
.../scripts/toolkits/WebKitGtk/speech_generator.py | 9 +-
src/orca/settings.py | 5 -
src/orca/speech_generator.py | 183 +----
src/orca/speechdispatcherfactory.py | 37 +-
src/orca/structural_navigation.py | 801 +++++---------------
47 files changed, 2251 insertions(+), 2244 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 03c7747..720f161 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -4,23 +4,18 @@
orca.desktop.in
orca-autostart.desktop.in
src/orca/app_gui_prefs.py
-src/orca/bookmarks.py
-src/orca/braille.py
-src/orca/braille_generator.py
src/orca/braille_rolenames.py
-src/orca/chat.py
+src/orca/brltablenames.py
src/orca/chnames.py
src/orca/cmdnames.py
-src/orca/event_manager.py
-src/orca/find.py
src/orca/flat_review.py
src/orca/generator.py
-src/orca/input_event.py
+src/orca/guilabels.py
src/orca/keybindings.py
src/orca/keynames.py
-src/orca/liveregions.py
src/orca/messages.py
src/orca/notification_messages.py
+src/orca/object_properties.py
src/orca/orca_bin.py.in
src/orca/orca_console_prefs.py
[type: gettext/glade]src/orca/orca-find.ui
@@ -28,45 +23,23 @@ src/orca/orca_gui_find.py
src/orca/orca_gui_navlist.py
src/orca/orca_gui_prefs.py
src/orca/orca_gui_profile.py
-src/orca/orca.py
[type: gettext/glade]src/orca/orca-setup.ui
src/orca/phonnames.py
-src/orca/script_utilities.py
-src/orca/scripts/apps/evolution/script.py
src/orca/scripts/apps/evolution/speech_generator.py
-src/orca/scripts/apps/gcalctool/script.py
src/orca/scripts/apps/gedit/script.py
src/orca/scripts/apps/gnome-mud/script.py
src/orca/scripts/apps/gnome-search-tool/script.py
-src/orca/scripts/apps/gtk-window-decorator/script.py
src/orca/scripts/apps/liferea/script.py
src/orca/scripts/apps/metacity/script.py
-src/orca/scripts/apps/nautilus/script.py
-src/orca/scripts/apps/notification-daemon/script.py
-src/orca/scripts/apps/notify-osd/script.py
src/orca/scripts/apps/packagemanager/script.py
src/orca/scripts/apps/packagemanager/tutorialgenerator.py
-src/orca/scripts/apps/pidgin/script.py
src/orca/scripts/apps/planner/braille_generator.py
src/orca/scripts/apps/planner/speech_generator.py
-src/orca/scripts/apps/soffice/script.py
-src/orca/scripts/apps/soffice/speech_generator.py
-src/orca/scripts/apps/soffice/structural_navigation.py
src/orca/scripts/apps/Thunderbird/script.py
src/orca/scripts/apps/Thunderbird/speech_generator.py
src/orca/scripts/default.py
-src/orca/scripts/toolkits/Gecko/bookmarks.py
src/orca/scripts/toolkits/Gecko/braille_generator.py
src/orca/scripts/toolkits/Gecko/script.py
-src/orca/scripts/toolkits/Gecko/speech_generator.py
-src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
-src/orca/scripts/toolkits/WebKitGtk/script.py
-src/orca/scripts/toolkits/WebKitGtk/speech_generator.py
src/orca/settings.py
-src/orca/speechdispatcherfactory.py
-src/orca/speech_generator.py
-src/orca/speech.py
-src/orca/speechserver.py
-src/orca/structural_navigation.py
src/orca/text_attribute_names.py
src/orca/tutorialgenerator.py
diff --git a/src/orca/Makefile.am b/src/orca/Makefile.am
index 943a6c4..e68eecf 100644
--- a/src/orca/Makefile.am
+++ b/src/orca/Makefile.am
@@ -17,6 +17,7 @@ orca_python_PYTHON = \
braille_generator.py \
braille_rolenames.py \
brlmon.py \
+ brltablenames.py \
chat.py \
chnames.py \
cmdnames.py \
@@ -29,6 +30,7 @@ orca_python_PYTHON = \
flat_review.py \
formatting.py \
generator.py \
+ guilabels.py \
input_event.py \
keybindings.py \
keynames.py \
@@ -39,6 +41,7 @@ orca_python_PYTHON = \
messages.py \
mouse_review.py \
notification_messages.py \
+ object_properties.py \
orca.py \
orca_console_prefs.py \
orca_gtkbuilder.py \
diff --git a/src/orca/app_gui_prefs.py b/src/orca/app_gui_prefs.py
index 6b39050..f0d065a 100644
--- a/src/orca/app_gui_prefs.py
+++ b/src/orca/app_gui_prefs.py
@@ -277,7 +277,7 @@ def showPreferencesUI():
#
if not orca_state.locusOfFocus or \
not orca_state.locusOfFocus.getApplication():
- message = _("No application has focus.")
+ message = messages.NO_FOCUSED_APPLICATION
braille.displayMessage(message)
speech.speak(message)
return
diff --git a/src/orca/bookmarks.py b/src/orca/bookmarks.py
index f9b776e..2c4839f 100644
--- a/src/orca/bookmarks.py
+++ b/src/orca/bookmarks.py
@@ -22,10 +22,10 @@
import pickle
import os
+from . import messages
from . import speech
from . import orca_state
from . import settings_manager
-from .orca_i18n import _
_settingsManager = settings_manager.getManager()
@@ -70,13 +70,8 @@ class Bookmarks:
""" Add an in-page accessible object bookmark for this key. """
context = self._script.getFlatReviewContext()
self._bookmarks[inputEvent.hw_code] = self._contextToBookmark(context)
-
- # Translators: this announces that a bookmark has been entered.
- # Orca allows users to tell it to remember a particular spot in an
- # application window and provides keystrokes for the user to jump to
- # those spots. These spots are known as 'bookmarks'.
- #
- utterances = [_('bookmark entered')]
+
+ utterances = [messages.BOOKMARK_ENTERED]
utterances.extend(
self._script.speechGenerator.generateSpeech(
context.getCurrentAccessible()))
@@ -97,18 +92,11 @@ class Bookmarks:
# Are they the same object?
if self._script.utilities.isSameObject(cur_obj, obj):
- # Translators: this announces that the current object is the same
- # object pointed to by the bookmark.
- #
- self._script.presentMessage(_('bookmark is current object'))
+ self._script.presentMessage(messages.BOOKMARK_IS_CURRENT_OBJECT)
return
# Are their parents the same?
elif self._script.utilities.isSameObject(cur_obj.parent, obj.parent):
- # Translators: this announces that the current object's parent and
- # the parent of the object pointed to by the bookmark are the same.
- #
- self._script.presentMessage(
- _('bookmark and current object have same parent'))
+ self._script.presentMessage(messages.BOOKMARK_PARENT_IS_SAME)
return
# Do they share a common ancestor?
@@ -122,32 +110,20 @@ class Bookmarks:
p = cur_obj.parent
while p:
if bookmark_ancestors.count(p) > 0:
- rolename = p.getLocalizedRoleName()
- # Translators: this announces that the bookmark and the current
- # object share a common ancestor
- #
- self._script.presentMessage(_('shared ancestor %s') % rolename)
+ msg = messages.BOOKMARK_SHARED_ANCESTOR % p.getLocalizedRoleName()
+ self._script.presentMessage(msg)
return
p = p.parent
- # Translators: This announces that a comparison between the bookmark
- # and the current object can not be determined.
- #
- self._script.presentMessage(_('comparison unknown'))
+ self._script.presentMessage(messages.BOOKMARK_COMPARISON_UNKNOWN)
def saveBookmarks(self, inputEvent):
""" Save the bookmarks for this script. """
try:
self.saveBookmarksToDisk(self._bookmarks)
- # Translators: this announces that a bookmark has been saved to
- # disk
- #
- self._script.presentMessage(_('bookmarks saved'))
+ self._script.presentMessage(messages.BOOKMARKS_SAVED)
except IOError:
- # Translators: this announces that a bookmark could not be saved to
- # disk
- #
- self._script.presentMessage(_('bookmarks could not be saved'))
+ self._script.presentMessage(messages.BOOKMARKS_SAVED_FAILURE)
# Notify the observers
for o in self._saveObservers:
@@ -218,7 +194,7 @@ class Bookmarks:
try:
inputFile = open( os.path.join( orcaBookmarksDir, \
'%s.pkl' %filename), "r")
- bookmarks = pickle.load(inputFile)
+ bookmarks = pickle.load(inputFile.buffer)
inputFile.close()
return bookmarks
except (IOError, EOFError, OSError):
@@ -237,7 +213,7 @@ class Bookmarks:
os.mkdir(orcaBookmarksDir)
output = open( os.path.join( orcaBookmarksDir, \
'%s.pkl' %filename), "w", os.O_CREAT)
- pickle.dump(bookmarksObj, output)
+ pickle.dump(bookmarksObj, output.buffer)
output.close()
def _contextToBookmark(self, context):
diff --git a/src/orca/braille.py b/src/orca/braille.py
index ce92f4b..93c399d 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -68,6 +68,8 @@ try:
except:
settings.enableBrailleMonitor = False
+from . import brltablenames
+from . import cmdnames
from . import debug
from . import eventsynthesizer
from . import orca_state
@@ -93,8 +95,6 @@ if louis and not tablesdir:
"not be available.")
louis = None
-from .orca_i18n import _ # for gettext support
-
# The braille monitor
#
_monitor = None
@@ -112,89 +112,18 @@ if _brlAPIAvailable:
command_name = {}
if _brlAPIAvailable:
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls to the left.
- #
- command_name[brlapi.KEY_CMD_FWINLT] = _("Line Left")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls to the right.
- #
- command_name[brlapi.KEY_CMD_FWINRT] = _("Line Right")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls up.
- #
- command_name[brlapi.KEY_CMD_LNUP] = _("Line Up")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls down.
- #
- command_name[brlapi.KEY_CMD_LNDN] = _("Line Down")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, it instructs the braille display to freeze.
- #
- command_name[brlapi.KEY_CMD_FREEZE] = _("Freeze")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls to the top left of the
- # window.
- #
- command_name[brlapi.KEY_CMD_TOP_LEFT] = _("Top Left")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls to the bottom right of
- # the window.
- #
- command_name[brlapi.KEY_CMD_BOT_LEFT] = _("Bottom Right")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display scrolls to position containing
- # the cursor.
- #
- command_name[brlapi.KEY_CMD_HOME] = _("Cursor Position")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # When pressing the button, the display toggles between contracted and
- # contracted braille.
- #
- command_name[brlapi.KEY_CMD_SIXDOTS] = _("Six Dots")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # This command represents a whole set of buttons known as cursor
- # routings keys and are a way for a user to tell the machine they are
- # interested in a particular character on the display.
- #
- command_name[brlapi.KEY_CMD_ROUTE] = _("Cursor Routing")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # This command represents the start of a selection operation. It is
- # called "Cut Begin" to map to what BrlTTY users are used to: in
- # character cell mode operation on virtual consoles, the act of copying
- # text is erroneously called a "cut" operation.
- #
- command_name[brlapi.KEY_CMD_CUTBEGIN] = _("Cut Begin")
-
- # Translators: this is a command for a button on a refreshable braille
- # display (an external hardware device used by people who are blind).
- # This command represents marking the endpoint of a selection. It is
- # called "Cut Line" to map to what BrlTTY users are used to: in
- # character cell mode operation on virtual consoles, the act of copying
- # text is erroneously called a "cut" operation.
- #
- command_name[brlapi.KEY_CMD_CUTLINE] = _("Cut Line")
+ command_name[brlapi.KEY_CMD_FWINLT] = cmdnames.BRAILLE_LINE_LEFT
+ command_name[brlapi.KEY_CMD_FWINRT] = cmdnames.BRAILLE_LINE_RIGHT
+ command_name[brlapi.KEY_CMD_LNUP] = cmdnames.BRAILLE_LINE_UP
+ command_name[brlapi.KEY_CMD_LNDN] = cmdnames.BRAILLE_LINE_DOWN
+ command_name[brlapi.KEY_CMD_FREEZE] = cmdnames.BRAILLE_FREEZE
+ command_name[brlapi.KEY_CMD_TOP_LEFT] = cmdnames.BRAILLE_TOP_LEFT
+ command_name[brlapi.KEY_CMD_BOT_LEFT] = cmdnames.BRAILLE_BOTTOM_LEFT
+ command_name[brlapi.KEY_CMD_HOME] = cmdnames.BRAILLE_HOME
+ command_name[brlapi.KEY_CMD_SIXDOTS] = cmdnames.BRAILLE_SIX_DOTS
+ command_name[brlapi.KEY_CMD_ROUTE] = cmdnames.BRAILLE_ROUTE_CURSOR
+ command_name[brlapi.KEY_CMD_CUTBEGIN] = cmdnames.BRAILLE_CUT_BEGIN
+ command_name[brlapi.KEY_CMD_CUTLINE] = cmdnames.BRAILLE_CUT_LINE
# The size of the physical display (width, height). The coordinate system of
# the display is set such that the upper left is (0,0), x values increase from
@@ -260,37 +189,37 @@ _saved = None
# languages. You could read about braille tables at:
# http://en.wikipedia.org/wiki/Braille
#
-TABLE_NAMES = {"Cz-Cz-g1": _("Czech Grade 1"),
- "Es-Es-g1": _("Spanish Grade 1"),
- "Fr-Ca-g2": _("Canada French Grade 2"),
- "Fr-Fr-g2": _("France French Grade 2"),
- "Lv-Lv-g1": _("Latvian Grade 1"),
- "Nl-Nl-g1": _("Netherlands Dutch Grade 1"),
- "No-No-g0": _("Norwegian Grade 0"),
- "No-No-g1": _("Norwegian Grade 1"),
- "No-No-g2": _("Norwegian Grade 2"),
- "No-No-g3": _("Norwegian Grade 3"),
- "Pl-Pl-g1": _("Polish Grade 1"),
- "Pt-Pt-g1": _("Portuguese Grade 1"),
- "Se-Se-g1": _("Swedish Grade 1"),
- "ar-ar-g1": _("Arabic Grade 1"),
- "cy-cy-g1": _("Welsh Grade 1"),
- "cy-cy-g2": _("Welsh Grade 2"),
- "de-de-g0": _("German Grade 0"),
- "de-de-g1": _("German Grade 1"),
- "de-de-g2": _("German Grade 2"),
- "en-GB-g2": _("U.K. English Grade 2"),
- "en-gb-g1": _("U.K. English Grade 1"),
- "en-us-g1": _("U.S. English Grade 1"),
- "en-us-g2": _("U.S. English Grade 2"),
- "fr-ca-g1": _("Canada French Grade 1"),
- "fr-fr-g1": _("France French Grade 1"),
- "gr-gr-g1": _("Greek Grade 1"),
- "hi-in-g1": _("Hindi Grade 1"),
- "hu-hu-comp8": _("Hungarian 8 dot computer"),
- "hu-hu-g1": _("Hungarian Grade 1"),
- "it-it-g1": _("Italian Grade 1"),
- "nl-be-g1": _("Belgium Dutch Grade 1")}
+TABLE_NAMES = {"Cz-Cz-g1": brltablenames.CZ_CZ_G1,
+ "Es-Es-g1": brltablenames.ES_ES_G1,
+ "Fr-Ca-g2": brltablenames.FR_CA_G2,
+ "Fr-Fr-g2": brltablenames.FR_FR_G2,
+ "Lv-Lv-g1": brltablenames.LV_LV_G1,
+ "Nl-Nl-g1": brltablenames.NL_NL_G1,
+ "No-No-g0": brltablenames.NO_NO_G0,
+ "No-No-g1": brltablenames.NO_NO_G1,
+ "No-No-g2": brltablenames.NO_NO_G2,
+ "No-No-g3": brltablenames.NO_NO_G3,
+ "Pl-Pl-g1": brltablenames.PL_PL_G1,
+ "Pt-Pt-g1": brltablenames.PT_PT_G1,
+ "Se-Se-g1": brltablenames.SE_SE_G1,
+ "ar-ar-g1": brltablenames.AR_AR_G1,
+ "cy-cy-g1": brltablenames.CY_CY_G1,
+ "cy-cy-g2": brltablenames.CY_CY_G2,
+ "de-de-g0": brltablenames.DE_DE_G0,
+ "de-de-g1": brltablenames.DE_DE_G1,
+ "de-de-g2": brltablenames.DE_DE_G2,
+ "en-GB-g2": brltablenames.EN_GB_G2,
+ "en-gb-g1": brltablenames.EN_GB_G1,
+ "en-us-g1": brltablenames.EN_US_G1,
+ "en-us-g2": brltablenames.EN_US_G2,
+ "fr-ca-g1": brltablenames.FR_CA_G1,
+ "fr-fr-g1": brltablenames.FR_FR_G1,
+ "gr-gr-g1": brltablenames.GR_GR_G1,
+ "hi-in-g1": brltablenames.HI_IN_G1,
+ "hu-hu-comp8": brltablenames.HU_HU_8DOT,
+ "hu-hu-g1": brltablenames.HU_HU_G1,
+ "it-it-g1": brltablenames.IT_IT_G1,
+ "nl-be-g1": brltablenames.NL_BE_G1}
def listTables():
tables = {}
diff --git a/src/orca/braille_generator.py b/src/orca/braille_generator.py
index 7eb0339..345756f 100644
--- a/src/orca/braille_generator.py
+++ b/src/orca/braille_generator.py
@@ -30,11 +30,11 @@ from gi.repository import Atspi, Atk
from . import braille
from . import generator
+from . import messages
from . import orca_state
from . import settings
from . import settings_manager
from .braille_rolenames import shortRoleNames
-from .orca_i18n import ngettext
_settingsManager = settings_manager.getManager()
@@ -211,13 +211,8 @@ class BrailleGenerator(generator.Generator):
except:
alertAndDialogCount = 0
if alertAndDialogCount > 0:
- # Translators: this tells the user how many unfocused
- # alert and dialog windows plus the total number of
- # windows that this application has.
- #
- result.append(ngettext("(%d dialog)",
- "(%d dialogs)",
- alertAndDialogCount) % alertAndDialogCount)
+ result.append(messages.dialogCountBraille(alertAndDialogCount))
+
return result
def _generateAncestors(self, obj, **args):
diff --git a/src/orca/brltablenames.py b/src/orca/brltablenames.py
new file mode 100644
index 0000000..10ccde3
--- /dev/null
+++ b/src/orca/brltablenames.py
@@ -0,0 +1,156 @@
+# Orca
+#
+# Copyright 2004-2009 Sun Microsystems Inc.
+# Copyright 2010-2013 The Orca Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Braille translation table names. These have been put in their own module
+so that we can present them in the correct language when users change the
+synthesizer language on the fly without having to reload a bunch of modules."""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
+ "Copyright (c) 2010-2013 The Orca Team"
+__license__ = "LGPL"
+
+from .orca_i18n import _
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+CZ_CZ_G1 = _("Czech Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+ES_ES_G1 = _("Spanish Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+FR_CA_G2 = _("Canada French Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+FR_FR_G2 = _("France French Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+LV_LV_G1 = _("Latvian Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+NL_NL_G1 = _("Netherlands Dutch Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+NO_NO_G0 = _("Norwegian Grade 0")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+NO_NO_G1 = _("Norwegian Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+NO_NO_G2 = _("Norwegian Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+NO_NO_G3 = _("Norwegian Grade 3")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+PL_PL_G1 = _("Polish Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+PT_PT_G1 = _("Portuguese Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+SE_SE_G1 = _("Swedish Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+AR_AR_G1 = _("Arabic Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+CY_CY_G1 = _("Welsh Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+CY_CY_G2 = _("Welsh Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+DE_DE_G0 = _("German Grade 0")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+DE_DE_G1 = _("German Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+DE_DE_G2 = _("German Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+EN_GB_G2 = _("U.K. English Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+EN_GB_G1 = _("U.K. English Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+EN_US_G1 = _("U.S. English Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+EN_US_G2 = _("U.S. English Grade 2")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+FR_CA_G1 = _("Canada French Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+FR_FR_G1 = _("France French Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+GR_GR_G1 = _("Greek Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+HI_IN_G1 = _("Hindi Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+HU_HU_8DOT = _("Hungarian 8 dot computer")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+HU_HU_G1 = _("Hungarian Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+IT_IT_G1 = _("Italian Grade 1")
+
+# Translators: These is the name of a braille transation table. To learn more
+# about braille translation tables, see http://en.wikipedia.org/wiki/Braille.
+NL_BE_G1 = _("Belgium Dutch Grade 1")
diff --git a/src/orca/chat.py b/src/orca/chat.py
index 72d40c7..2473ce4 100644
--- a/src/orca/chat.py
+++ b/src/orca/chat.py
@@ -27,13 +27,15 @@ __license__ = "LGPL"
import pyatspi
+from . import cmdnames
+from . import guilabels
from . import input_event
from . import keybindings
+from . import messages
from . import orca_state
from . import settings
from . import settings_manager
from . import speech
-from .orca_i18n import _
_settingsManager = settings_manager.getManager()
@@ -330,53 +332,25 @@ class Chat:
"""Defines InputEventHandler fields for chat functions which
will be used by the script associated with this chat instance."""
- # Translators: In chat applcations, Orca automatically presents incoming
- # messages in speech and braille. If a user is in multiple conversations
- # or channels at the same time, it can be confusing to know what room or
- # channel a given message came from just from hearing/reading it. For
- # For this reason, Orca has an option to present the name of the room
- # first ( "#a11y <joanie> hello!" instead of "<joanie> hello world!".
- # This string to be translated is associated with the command to toggle
- # room name presentation on or off.
- #
self.inputEventHandlers["togglePrefixHandler"] = \
input_event.InputEventHandler(
self.togglePrefix,
- _("Toggle whether we prefix chat room messages with " \
- "the name of the chat room."))
-
- # Translators: In chat applications, it is often possible to see that
- # a "buddy" is typing currently (e.g. via a keyboard icon or status
- # text). Some users like to have this typing status announced by Orca;
- # others find that announcment unpleasant. Therefore, it is a setting
- # in Orca. This string to be translated is associated with the command
- # to toggle typing status presentation on or off.
+ cmdnames.CHAT_TOGGLE_ROOM_NAME_PREFIX)
+
self.inputEventHandlers["toggleBuddyTypingHandler"] = \
input_event.InputEventHandler(
self.toggleBuddyTyping,
- _("Toggle whether we announce when our buddies are typing."))
-
- # Translators: Orca has a command to review previous chat room messages
- # in speech and braille. Some users prefer to have this message history
- # combined (e.g. the last ten messages which came in, no matter what
- # room they came from). Other users prefer to have specific room history
- # (e.g. the last ten messages from #a11y). Therefore, this is a setting
- # in Orca. This string to be translated is associated with the command
- # to toggle specific room history on or off.
+ cmdnames.CHAT_TOGGLE_BUDDY_TYPING)
+
self.inputEventHandlers["toggleMessageHistoriesHandler"] = \
input_event.InputEventHandler(
self.toggleMessageHistories,
- _("Toggle whether we provide chat room specific message " \
- "histories."))
+ cmdnames.CHAT_TOGGLE_MESSAGE_HISTORIES)
- # Translators: Orca has a command to review previous chat room messages
- # in speech and braille. This string to be translated is associated
- # with the keyboard commands used to review those previous messages.
- #
self.inputEventHandlers["reviewMessage"] = \
input_event.InputEventHandler(
self.readPreviousMessage,
- _("Speak and braille a previous chat room message."))
+ cmdnames.CHAT_PREVIOUS_MESSAGE)
return
@@ -429,30 +403,19 @@ class Chat:
grid = Gtk.Grid()
grid.set_border_width(12)
- # Translators: If this checkbox is checked, then Orca will speak
- # the name of the chat room prior to presenting an incoming message.
- #
- label = _("_Speak Chat Room name")
+ label = guilabels.CHAT_SPEAK_ROOM_NAME
value = _settingsManager.getSetting('chatSpeakRoomName')
self.speakNameCheckButton = Gtk.CheckButton.new_with_mnemonic(label)
self.speakNameCheckButton.set_active(value)
grid.attach(self.speakNameCheckButton, 0, 0, 1, 1)
- # Translators: If this checkbox is checked, then Orca will tell
- # you when one of your buddies is typing a message.
- #
- label = _("Announce when your _buddies are typing")
+ label = guilabels.CHAT_ANNOUNCE_BUDDY_TYPING
value = _settingsManager.getSetting('chatAnnounceBuddyTyping')
self.buddyTypingCheckButton = Gtk.CheckButton.new_with_mnemonic(label)
self.buddyTypingCheckButton.set_active(value)
grid.attach(self.buddyTypingCheckButton, 0, 1, 1, 1)
- # Translators: If this checkbox is checked, then Orca will provide
- # the user with chat room specific message histories rather than just
- # a single history which contains the latest messages from all the
- # chat rooms that they are currently in.
- #
- label = _("Provide chat room specific _message histories")
+ label = guilabels.CHAT_SEPARATE_MESSAGE_HISTORIES
value = _settingsManager.getSetting('chatRoomHistories')
self.chatRoomHistoriesCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
@@ -461,11 +424,7 @@ class Chat:
messagesFrame = Gtk.Frame()
grid.attach(messagesFrame, 0, 3, 1, 1)
-
- # Translators: this is the title of a panel holding options for
- # how messages in this application's chat rooms should be spoken.
- #
- label = Gtk.Label("<b>%s</b>" % _("Speak messages from"))
+ label = Gtk.Label("<b>%s</b>" % guilabels.CHAT_SPEAK_MESSAGES_FROM)
label.set_use_markup(True)
messagesFrame.set_label_widget(label)
@@ -477,31 +436,20 @@ class Chat:
value = _settingsManager.getSetting('chatMessageVerbosity')
- # Translators: Orca will speak all new chat messages as they appear
- # irrespective of whether the chat application currently has focus.
- # This is the default behaviour.
- #
- label = _("All cha_nnels")
+ label = guilabels.CHAT_SPEAK_MESSAGES_ALL
rb1 = Gtk.RadioButton.new_with_mnemonic(None, label)
rb1.set_active(value == settings.CHAT_SPEAK_ALL)
self.allMessagesRadioButton = rb1
messagesGrid.attach(self.allMessagesRadioButton, 0, 0, 1, 1)
- # Translators: Orca will speak only new chat messages for the channel
- # that currently has focus, irrespective of whether the chat
- # application has focus.
- #
- label = _("A channel only if its _window is active")
+ label = guilabels.CHAT_SPEAK_MESSAGES_ACTIVE
rb2 = Gtk.RadioButton.new_with_mnemonic(None, label)
rb2.join_group(rb1)
rb2.set_active(value == settings.CHAT_SPEAK_FOCUSED_CHANNEL)
self.focusedChannelRadioButton = rb2
messagesGrid.attach(self.focusedChannelRadioButton, 0, 1, 1, 1)
- # Translators: Orca will speak new chat messages for all channels
- # only when the chat application has focus.
- #
- label = _("All channels when an_y %s window is active") % \
+ label = guilabels.CHAT_SPEAK_MESSAGES_ALL_IF_FOCUSED % \
self._script.app.name
rb3 = Gtk.RadioButton.new_with_mnemonic(None, label)
rb3.join_group(rb1)
@@ -569,11 +517,11 @@ class Chat:
- inputEvent: if not None, the input event that caused this action.
"""
- line = _("speak chat room name.")
+ line = messages.CHAT_ROOM_NAME_PREFIX_ON
speakRoomName = _settingsManager.getSetting('chatSpeakRoomName')
_settingsManager.setSetting('chatSpeakRoomName', not speakRoomName)
if speakRoomName:
- line = _("Do not speak chat room name.")
+ line = messages.CHAT_ROOM_NAME_PREFIX_OFF
self._script.presentMessage(line)
return True
@@ -586,12 +534,12 @@ class Chat:
- inputEvent: if not None, the input event that caused this action.
"""
- line = _("announce when your buddies are typing.")
+ line = messages.CHAT_BUDDY_TYPING_ON
announceTyping = _settingsManager.getSetting('chatAnnounceBuddyTyping')
_settingsManager.setSetting(
'chatAnnounceBuddyTyping', not announceTyping)
if announceTyping:
- line = _("Do not announce when your buddies are typing.")
+ line = messages.CHAT_BUDDY_TYPING_OFF
self._script.presentMessage(line)
return True
@@ -604,11 +552,11 @@ class Chat:
- inputEvent: if not None, the input event that caused this action.
"""
- line = _("Provide chat room specific message histories.")
+ line = messages.CHAT_SEPARATE_HISTORIES_ON
roomHistories = _settingsManager.getSetting('chatRoomHistories')
_settingsManager.setSetting('chatRoomHistories', not roomHistories)
if roomHistories:
- line = _("Do not provide chat room specific message histories.")
+ line = messages.CHAT_SEPARATE_HISTORIES_OFF
self._script.presentMessage(line)
return True
@@ -668,7 +616,7 @@ class Chat:
text = ""
if _settingsManager.getSetting('chatSpeakRoomName') and chatRoomName:
- text = _("Message from chat room %s") % chatRoomName
+ text = message.CHAT_MESSAGE_FROM_ROOM % chatRoomName
text = self._script.utilities.appendString(text, message)
if len(text.strip()):
diff --git a/src/orca/cmdnames.py b/src/orca/cmdnames.py
index 88fd73a..04e58e1 100644
--- a/src/orca/cmdnames.py
+++ b/src/orca/cmdnames.py
@@ -498,3 +498,455 @@ PRESENT_CURRENT_DATE = _("Present current date.")
# application, bypassing Orca's interception of it.
BYPASS_NEXT_COMMAND = \
_("Passes the next command on to the current application.")
+
+# Translators: Orca has a command to review previous chat room messages in
+# speech and braille. This string to be translated is associated with the
+# keyboard commands used to review those previous messages.
+CHAT_PREVIOUS_MESSAGE = _("Speak and braille a previous chat room message.")
+
+# Translators: In chat applications, it is often possible to see that a "buddy"
+# is typing currently (e.g. via a keyboard icon or status text). Some users like
+# to have this typing status announced by Orca; others find that announcment
+# unpleasant. Therefore, it is a setting in Orca. This string to be translated
+# is associated with the command to toggle typing status presentation on or off.
+CHAT_TOGGLE_BUDDY_TYPING = \
+ _("Toggle whether we announce when our buddies are typing.")
+
+# Translators: Orca has a command to review previous chat room messages in
+# speech and braille. Some users prefer to have this message history combined
+# (e.g. the last ten messages which came in, no matter what room they came
+# from). Other users prefer to have specific room history (e.g. the last ten
+# messages from #a11y). Therefore, this is a setting in Orca. This string to be
+# translated is associated with the command to toggle specific room history on
+# or off.
+CHAT_TOGGLE_MESSAGE_HISTORIES = \
+ _("Toggle whether we provide chat room specific message " \
+ "histories.")
+
+# Translators: In chat applcations, Orca automatically presents incoming
+# messages in speech and braille. If a user is in multiple conversations or
+# channels at the same time, it can be confusing to know what room or channel
+# a given message came from just from hearing/reading it. For this reason, Orca
+# has an option to present the name of the room first ("#a11y <joanie> hello!"
+# instead of "<joanie> hello!"). This string to be translated is associated with
+# the command to toggle room name presentation on or off.
+CHAT_TOGGLE_ROOM_NAME_PREFIX = \
+ _("Toggle whether we prefix chat room messages with " \
+ "the name of the chat room.")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls to the left.
+BRAILLE_LINE_LEFT = _("Line Left")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls to the right.
+BRAILLE_LINE_RIGHT = _("Line Right")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls up.
+BRAILLE_LINE_UP = _("Line Up")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls down.
+BRAILLE_LINE_DOWN = _("Line Down")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, it instructs the braille display to freeze.
+BRAILLE_FREEZE = _("Freeze")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls to the top left of the window.
+BRAILLE_TOP_LEFT = _("Top Left")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls to the bottom left of the window.
+BRAILLE_BOTTOM_LEFT = _("Bottom Left")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display scrolls to position containing the cursor.
+BRAILLE_HOME = _("Cursor Position")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). When pressing the
+# button, the display toggles between six-dot braille and eight-dot braille.
+BRAILLE_SIX_DOTS = _("Six Dots")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). This command
+# represents a whole set of buttons known as cursor routing keys and are a way
+# for a user to move the application's caret to the position indicated on the
+# display.
+BRAILLE_ROUTE_CURSOR = _("Cursor Routing")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). This command
+# represents the start of a selection operation. It is called "Cut Begin" to map
+# to what BrlTTY users are used to: in character cell mode operation on virtual
+# consoles, the act of copying text is erroneously called a "cut" operation.
+BRAILLE_CUT_BEGIN = _("Cut Begin")
+
+# Translators: this is a command for a button on a refreshable braille display
+# (an external hardware device used by people who are blind). This command
+# represents marking the endpoint of a selection. It is called "Cut Line" to map
+# to what BrlTTY users are used to: in character cell mode operation on virtual
+# consoles, the act of copying text is erroneously called a "cut" operation.
+BRAILLE_CUT_LINE = _("Cut Line")
+
+# Translators: this is a command which causes Orca to present the last received
+# notification message.
+NOTIFICATION_MESSAGES_LAST = _("Present last notification message.")
+
+# Translators: this is a command which causes Orca to present a list of all the
+# notification messages received.
+NOTIFICATION_MESSAGES_LIST = _("Present notification messages list")
+
+# Translators: this is a command which causes Orca to present the previous
+# notification message.
+NOTIFICATION_MESSAGES_PREVIOUS = _("Present previous notification message.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_NEXT_CHAR = _("Goes to next character.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_PREV_CHAR = _("Goes to previous character.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_NEXT_WORD = _("Goes to next word.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_PREV_WORD = _("Goes to previous word.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_NEXT_LINE = _("Goes to next line.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_PREV_LINE = _("Goes to previous line.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_FILE_START = _("Goes to the top of the file.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_FILE_END = _("Goes to the bottom of the file.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_LINE_START = _("Goes to the beginning of the line.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_LINE_END = _("Goes to the end of the line.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_NEXT_OBJECT = _("Goes to the next object.")
+
+# Translators: this is a command related to navigating within a document.
+CARET_NAVIGATION_PREV_OBJECT = _("Goes to the previous object.")
+
+# Translators: this is for causing a collapsed combo box which was reached
+# by Orca's caret navigation to be expanded.
+CARET_NAVIGATION_EXPAND_COMBO_BOX = \
+ _("Causes the current combo box to be expanded.")
+
+# Translators: Gecko native caret navigation is where Firefox (or Thunderbird)
+# itself controls how the arrow keys move the caret around HTML content. It's
+# often broken, so Orca needs to provide its own support. As such, Orca offers
+# the user the ability to toggle which application is controlling the caret.
+CARET_NAVIGATION_TOGGLE = \
+ _("Switches between Gecko native and Orca caret navigation.")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This string refers to a command
+# to cycle through the different "politeness" levels.
+LIVE_REGIONS_ADVANCE_POLITENESS = _("Advance live region politeness setting.")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This string refers to a command
+# to turn off live regions by default.
+LIVE_REGIONS_SET_POLITENESS_OFF = \
+ _("Set default live region politeness level to off.")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# This string refers to a command for reviewing up to nine stored previous live
+# messages.
+LIVE_REGIONS_REVIEW = _("Review live region announcement.")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# This string refers to an Orca command which allows the user to toggle whether
+# or not Orca pays attention to changes in live regions. Note that turning off
+# monitoring of live events is NOT the same as turning the politeness level
+# to "off". The user can opt to have no notifications presented (politeness
+# level of "off") and still manually review recent updates to live regions via
+# Orca commands for doing so -- as long as the monitoring of live regions is
+# enabled.
+LIVE_REGIONS_MONITOR = _("Monitor live regions.")
+
+# Translators: hovering the mouse over certain objects on a web page causes a
+# new object to appear such as a pop-up menu. This command will move the user
+# to the object which just appeared as a result of the user hovering the mouse.
+# If the user is already in the mouse over object, this command will hide the
+# mouse over and return the user to the object he/she was in.
+MOUSE_OVER_MOVE = _("Moves focus into and away from the current mouse over.")
+
+# Translators: Orca allows you to dynamically define which row of a spreadsheet
+# or table should be treated as containing column headers. This string refers to
+# the command to set the row.
+DYNAMIC_COLUMN_HEADER_SET = _("Set the row to use as dynamic column headers.")
+
+# Translators: Orca allows you to dynamically define which row of a spreadsheet
+# or table should be treated as containing column headers. This string refers to
+# the command to unset the row so it is no longer treated as if it contained
+# column headers.
+DYNAMIC_COLUMN_HEADER_CLEAR = _("Clears the dynamic column headers.")
+
+# Translators: Orca allows you to dynamically define which column of a
+# spreadsheet or table should be treated as containing column headers. This
+# string refers to the command to set the column.
+DYNAMIC_ROW_HEADER_SET = _("Set the column to use as dynamic row headers.")
+
+# Translators: Orca allows you to dynamically define which column of a
+# spreadsheet or table should be treated as containing column headers. This
+# string refers to the command to unset the column so it is no longer treated
+# as if it contained row headers.
+DYNAMIC_ROW_HEADER_CLEAR = _("Clears the dynamic row headers")
+
+# Translators: This string refers to an Orca command. The "input line" refers
+# to the place where one enters formulas for a spreadsheet.
+PRESENT_INPUT_LINE = _("Presents the contents of the input line.")
+
+# Translators: the structural navigation keys are designed to move the caret
+# around the document content by object type. Thus H moves you to the next
+# heading, Shift H to the previous heading, T to the next table, and so on.
+# This feature needs to be toggle-able so that it does not interfere with normal
+# writing functions.
+STRUCTURAL_NAVIGATION_TOGGLE = _("Toggles structural navigation keys.")
+
+# Translators: this is for navigating among anchors in a document. An anchor is
+# a named spot that one can jump to.
+ANCHOR_PREV = _("Goes to previous anchor.")
+
+# Translators: this is for navigating among anchors in a document. An anchor is
+# a named spot that one can jump to.
+ANCHOR_NEXT = _("Goes to next anchor.")
+
+# Translators: this is for navigating among blockquotes in a document.
+BLOCKQUOTE_PREV = _("Goes to previous blockquote.")
+
+# Translators: this is for navigating among blockquotes in a document.
+BLOCKQUOTE_NEXT = _("Goes to next blockquote.")
+
+# Translators: this is for navigating among blockquotes in a document.
+BLOCKQUOTE_LIST = _("Displays a list of blockquotes.")
+
+# Translators: this is for navigating among buttons in a document.
+BUTTON_PREV = _("Goes to previous button.")
+
+# Translators: this is for navigating among buttons in a document.
+BUTTON_NEXT = _("Goes to next button.")
+
+# Translators: this is for navigating among buttons in a document.
+BUTTON_LIST = _("Displays a list of buttons.")
+
+# Translators: this is for navigating among check boxes in a document.
+CHECK_BOX_PREV = _("Goes to previous check box.")
+
+# Translators: this is for navigating among check boxes in a document.
+CHECK_BOX_NEXT = _("Goes to next check box.")
+
+# Translators: this is for navigating among check boxes in a document.
+CHECK_BOX_LIST = _("Displays a list of check boxes.")
+
+# Translators: this is for navigating among combo boxes in a document.
+COMBO_BOX_PREV = _("Goes to previous combo box.")
+
+# Translators: this is for navigating among combo boxes in a document.
+COMBO_BOX_NEXT = _("Goes to next combo box.")
+
+# Translators: this is for navigating among combo boxes in a document.
+COMBO_BOX_LIST = _("Displays a list of combo boxes.")
+
+# Translators: this is for navigating among entries in a document.
+ENTRY_PREV = _("Goes to previous entry.")
+
+# Translators: this is for navigating among entries in a document.
+ENTRY_NEXT = _("Goes to next entry.")
+
+# Translators: this is for navigating among entries in a document.
+ENTRY_LIST = _("Displays a list of entries.")
+
+# Translators: this is for navigating among form fields in a document.
+FORM_FIELD_PREV = _("Goes to previous form field.")
+
+# Translators: this is for navigating among form fields in a document.
+FORM_FIELD_NEXT = _("Goes to next form field.")
+
+# Translators: this is for navigating among form fields in a document.
+FORM_FIELD_LIST = _("Displays a list of form fields.")
+
+# Translators: this is for navigating among headings (e.g. <h1>) in a document.
+HEADING_PREV = _("Goes to previous heading.")
+
+# Translators: this is for navigating among headings (e.g. <h1>) in a document.
+HEADING_NEXT = _("Goes to next heading.")
+
+# Translators: this is for navigating among headings (e.g. <h1>) in a document.
+HEADING_LIST = _("Displays a list of headings.")
+
+# Translators: this is for navigating among headings (e.g. <h1>) in a document.
+# <h1> is a heading at level 1, <h2> is a heading at level 2, etc.
+HEADING_AT_LEVEL_PREV = _("Goes to previous heading at level %d.")
+
+# Translators: this is for navigating among headings (e.g. <h1>) in a document.
+# <h1> is a heading at level 1, <h2> is a heading at level 2, etc.
+HEADING_AT_LEVEL_NEXT = _("Goes to next heading at level %d.")
+
+# Translators: this is for navigating among headings (e.g. <h1>) in a document.
+# <h1> is a heading at level 1, <h2> is a heading at level 2, etc.
+HEADING_AT_LEVEL_LIST = _("Displays a list of headings at level %d.")
+
+# Translators: this is for navigating among ARIA landmarks in a document. ARIA
+# role landmarks are the W3C defined HTML tag attribute 'role' used to identify
+# important part of webpage like banners, main context, search etc.
+LANDMARK_PREV = _("Goes to previous landmark.")
+
+# Translators: this is for navigating among ARIA landmarks in a document. ARIA
+# role landmarks are the W3C defined HTML tag attribute 'role' used to identify
+# important part of webpage like banners, main context, search etc.
+LANDMARK_NEXT = _("Goes to next landmark.")
+
+# Translators: this is for navigating among large objects in a document.
+# A 'large object' is a logical chunk of text, such as a paragraph, a list,
+# a table, etc.
+LARGE_OBJECT_PREV = _("Goes to previous large object.")
+
+# Translators: this is for navigating among large objects in a document.
+# A 'large object' is a logical chunk of text, such as a paragraph, a list,
+# a table, etc.
+LARGE_OBJECT_NEXT = _("Goes to next large object.")
+
+# Translators: this is for navigating among large objects in a document.
+# A 'large object' is a logical chunk of text, such as a paragraph, a list,
+# a table, etc.
+LARGE_OBJECT_LIST = _("Displays a list of large objects.")
+
+# Translators: this is for navigating among links in a document.
+LINK_LIST = _("Displays a list of links.")
+
+# Translators: this is for navigating among lists in a document.
+LIST_PREV = _("Goes to previous list.")
+
+# Translators: this is for navigating among lists in a document.
+LIST_NEXT = _("Goes to next list.")
+
+# Translators: this is for navigating among lists in a document.
+LIST_LIST = _("Displays a list of lists.")
+
+# Translators: this is for navigating among list items in a document.
+LIST_ITEM_PREV = _("Goes to previous list item.")
+
+# Translators: this is for navigating among list items in a document.
+LIST_ITEM_NEXT = _("Goes to next list item.")
+
+# Translators: this is for navigating among list items in a document.
+LIST_ITEM_LIST = _("Displays a list of list items.")
+
+# Translators: this is for navigating among live regions in a document. A live
+# region is an area of a web page that is periodically updated, e.g. a stock
+# ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+LIVE_REGION_PREV = _("Goes to previous live region.")
+
+# Translators: this is for navigating among live regions in a document. A live
+# region is an area of a web page that is periodically updated, e.g. a stock
+# ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+LIVE_REGION_NEXT = _("Goes to next live region.")
+
+# Translators: this is for navigating among live regions in a document. A live
+# region is an area of a web page that is periodically updated, e.g. a stock
+# ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+LIVE_REGION_LAST = _("Goes to the last live region which made an announcement.")
+
+# Translators: this is for navigating among paragraphs in a document.
+PARAGRAPH_PREV = _("Goes to previous paragraph.")
+
+# Translators: this is for navigating among paragraphs in a document.
+PARAGRAPH_NEXT = _("Goes to next paragraph.")
+
+# Translators: this is for navigating among paragraphs in a document.
+PARAGRAPH_LIST = _("Displays a list of paragraphs.")
+
+# Translators: this is for navigating among radio buttons in a document.
+RADIO_BUTTON_PREV = _("Goes to previous radio button.")
+
+# Translators: this is for navigating among radio buttons in a document.
+RADIO_BUTTON_NEXT = _("Goes to next radio button.")
+
+# Translators: this is for navigating among radio buttons in a document.
+RADIO_BUTTON_LIST = _("Displays a list of radio buttons.")
+
+# Translators: this is for navigating among separators (e.g. <hr>) in a
+# document.
+SEPARATOR_PREV = _("Goes to previous separator.")
+
+# Translators: this is for navigating among separators (e.g. <hr>) in a
+# document.
+SEPARATOR_NEXT = _("Goes to next separator.")
+
+# Translators: this is for navigating among tables in a document.
+TABLE_PREV = _("Goes to previous table.")
+
+# Translators: this is for navigating among tables in a document.
+TABLE_NEXT = _("Goes to next table.")
+
+# Translators: this is for navigating among tables in a document.
+TABLE_LIST = _("Displays a list of tables.")
+
+# Translators: this is for navigating among table cells in a document.
+TABLE_CELL_DOWN = _("Goes down one cell.")
+
+# Translators: this is for navigating among table cells in a document.
+TABLE_CELL_FIRST = _("Goes to the first cell in a table.")
+
+# Translators: this is for navigating among table cells in a document.
+TABLE_CELL_LAST = _("Goes to the last cell in a table.")
+
+# Translators: this is for navigating among table cells in a document.
+TABLE_CELL_LEFT = _("Goes left one cell.")
+
+# Translators: this is for navigating among table cells in a document.
+TABLE_CELL_RIGHT = _("Goes right one cell.")
+
+# Translators: this is for navigating among table cells in a document.
+TABLE_CELL_UP = _("Goes up one cell.")
+
+# Translators: this is for navigating among unvisited links in a document.
+UNVISITED_LINK_PREV = _("Goes to previous unvisited link.")
+
+# Translators: this is for navigating among unvisited links in a document.
+UNVISITED_LINK_NEXT = _("Goes to next unvisited link.")
+
+# Translators: this is for navigating among unvisited links in a document.
+UNVISITED_LINK_LIST = _("Displays a list of unvisited links.")
+
+# Translators: this is for navigating among visited links in a document.
+VISITED_LINK_PREV = _("Goes to previous visited link.")
+
+# Translators: this is for navigating among visited links in a document.
+VISITED_LINK_NEXT = _("Goes to next visited link.")
+
+# Translators: this is for navigating among visited links in a document.
+VISITED_LINK_LIST = _("Displays a list of visited links.")
diff --git a/src/orca/common_keyboardmap.py b/src/orca/common_keyboardmap.py
index 21899ac..e1f10a4 100644
--- a/src/orca/common_keyboardmap.py
+++ b/src/orca/common_keyboardmap.py
@@ -54,9 +54,6 @@ keymap = (
("h", defaultModifierMask, ORCA_MODIFIER_MASK,
"enterLearnModeHandler", 1),
- ("h", defaultModifierMask, ORCA_MODIFIER_MASK,
- "enterListShortcutsModeHandler", 2),
-
("q", defaultModifierMask, ORCA_MODIFIER_MASK,
"shutdownHandler"),
diff --git a/src/orca/event_manager.py b/src/orca/event_manager.py
index 38e614b..3283c4f 100644
--- a/src/orca/event_manager.py
+++ b/src/orca/event_manager.py
@@ -32,12 +32,11 @@ import time
from . import debug
from . import input_event
+from . import messages
from . import orca_state
from . import script_manager
from . import settings
-from .orca_i18n import _
-
_scriptManager = script_manager.getManager()
class EventManager:
@@ -233,11 +232,7 @@ class EventManager:
if noFocus:
if settings.gilSleepTime:
time.sleep(settings.gilSleepTime)
- # Translators: this is intended to be a short phrase to
- # speak and braille to tell the user that no component
- # has keyboard focus.
- #
- fullMessage = _("No focus")
+ fullMessage = messages.NO_FOCUS
defaultScript = _scriptManager.getDefaultScript()
defaultScript.presentMessage(fullMessage, '')
self.noFocusTimestamp = orca_state.noFocusTimestamp
diff --git a/src/orca/find.py b/src/orca/find.py
index 2fed5e7..6c7de38 100644
--- a/src/orca/find.py
+++ b/src/orca/find.py
@@ -31,10 +31,9 @@ import re
from . import debug
from . import flat_review
+from . import messages
from . import orca_state
-from .orca_i18n import _
-
class SearchQuery:
"""Represents a search that the user wants to perform."""
@@ -254,31 +253,13 @@ class SearchQuery:
doneWithLine = False
wrappedYet = True
if self.searchBackwards:
- # Translators: the Orca "Find" dialog
- # allows a user to search for text in a
- # window and then move focus to that text.
- # For example, they may want to find the
- # "OK" button. This message indicates
- # that a find operation in the reverse
- # direction is wrapping from the top of
- # the window down to the bottom.
- #
- script.presentMessage(_("Wrapping to Bottom"))
+ script.presentMessage(messages.WRAPPING_TO_BOTTOM)
moved = context.goPrevious( \
flat_review.Context.LINE, \
flat_review.Context.WRAP_ALL)
self.debugContext(context, "[3] go previous")
else:
- # Translators: the Orca "Find" dialog
- # allows a user to search for text in a
- # window and then move focus to that text.
- # For example, they may want to find the
- # "OK" button. This message indicates
- # that a find operation in the forward
- # direction is wrapping from the bottom of
- # the window up to the top.
- #
- script.presentMessage(_("Wrapping to Top"))
+ script.presentMessage(messages.WRAPPING_TO_TOP)
moved = context.goNext( \
flat_review.Context.LINE, \
flat_review.Context.WRAP_ALL)
diff --git a/src/orca/flat_review.py b/src/orca/flat_review.py
index 9a9efaa..9e52783 100644
--- a/src/orca/flat_review.py
+++ b/src/orca/flat_review.py
@@ -31,13 +31,13 @@ import re
from . import braille
from . import debug
from . import eventsynthesizer
+from . import messages
+from . import object_properties
from . import orca_state
from . import settings
from .braille_generator import BrailleGenerator
from .orca_i18n import _
-from .orca_i18n import C_
-from .orca_i18n import ngettext
# [[[WDW - HACK Regular expression to split strings on whitespace
# boundaries, which is what we'll use for word dividers instead of
@@ -350,41 +350,25 @@ class StateZone(Zone):
pyatspi.ROLE_CHECK_MENU_ITEM,
pyatspi.ROLE_TABLE_CELL]:
if stateCount == 2:
- # Translators: this represents the state of a checkbox.
- #
- speechState = _("partially checked")
+ speechState = object_properties.STATE_PARTIALLY_CHECKED
elif stateCount == 1:
- # Translators: this represents the state of a checkbox.
- #
- speechState = _("checked")
+ speechState = object_properties.STATE_CHECKED
else:
- # Translators: this represents the state of a checkbox.
- #
- speechState = _("not checked")
+ speechState = object_properties.STATE_NOT_CHECKED
brailleState = \
settings.brailleCheckBoxIndicators[stateCount]
elif self.role == pyatspi.ROLE_TOGGLE_BUTTON:
if stateCount:
- # Translators: the state of a toggle button.
- #
- speechState = _("pressed")
+ speechState = object_properties.STATE_PRESSED
else:
- # Translators: the state of a toggle button.
- #
- speechState = _("not pressed")
+ speechState = object_properties.STATE_NOT_PRESSED
brailleState = \
settings.brailleRadioButtonIndicators[stateCount]
else:
if stateCount:
- # Translators: this is in reference to a radio button being
- # selected or not.
- #
- speechState = C_("radiobutton", "selected")
+ speechState = object_properties.STATE_SELECTED_RADIO_BUTTON
else:
- # Translators: this is in reference to a radio button being
- # selected or not.
- #
- speechState = C_("radiobutton", "not selected")
+ speechState = object_properties.STATE_UNSELECTED_RADIO_BUTTON
brailleState = \
settings.brailleRadioButtonIndicators[stateCount]
@@ -420,13 +404,9 @@ class ValueZone(Zone):
pyatspi.ROLE_SCROLL_BAR]:
stateset = self.accessible.getState()
if stateset.contains(pyatspi.STATE_HORIZONTAL):
- # Translators: The component orientation is horizontal.
- #
- orientation = _("horizontal")
+ orientation = object_properties.STATE_HORIZONTAL
elif stateset.contains(pyatspi.STATE_VERTICAL):
- # Translators: The component orientation is vertical.
- #
- orientation = _("vertical")
+ orientation = object_properties.STATE_VERTICAL
try:
value = self.accessible.queryValue()
@@ -445,15 +425,8 @@ class ValueZone(Zone):
speechValue = orientation + " " + rolename
else:
speechValue = rolename
-
- # Translators: this is the percentage value of a slider,
- # progress bar or other component that displays a value as
- # a percentage.
- #
- percentString = ngettext("%d percent.",
- "%d percent.",
- percentValue) % percentValue
- speechValue = speechValue + " " + percentString
+
+ speechValue = speechValue + " " + messages.percentage(percentValue)
rolename = BrailleGenerator.getLocalizedRoleName(self.accessible)
if orientation:
diff --git a/src/orca/guilabels.py b/src/orca/guilabels.py
new file mode 100644
index 0000000..1376519
--- /dev/null
+++ b/src/orca/guilabels.py
@@ -0,0 +1,399 @@
+# Orca
+#
+# Copyright 2004-2009 Sun Microsystems Inc.
+# Copyright 2010-2013 The Orca Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Labels for Orca's GUIs. These have been put in their own module so that we
+can present them in the correct language when users change the language on the
+fly without having to reload a bunch of modules."""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
+ "Copyright (c) 2010-2013 The Orca Team"
+__license__ = "LGPL"
+
+from .orca_i18n import _, C_
+
+# Translators: Orca has had to implement its own caret navigation model to work
+# around issues in Gecko/Firefox. In some versions of Firefox, we must perform
+# a focus grab on each object being navigated in order for things to work as
+# expected; in other versions of Firefox, we must avoid doing so in order for
+# things# to work as expected. We cannot identify with certainty which situation
+# the user is in, so we must provide this as an option within Orca.
+CARET_NAVIGATION_GRAB_FOCUS = _("_Grab focus on objects when navigating")
+
+# Translators: When the user arrows up and down in HTML content, and Orca is
+# controlling the caret, the user might want Orca to always position the
+# cursor at the beginning of the line (as opposed to the position directly
+# above/below the current cursor position). Different users have different
+# preferences. This string is the label for a checkbox which allows users
+# to set the line-positioning behavior they want.
+CARET_NAVIGATION_START_OF_LINE = \
+ _("_Position cursor at start of line when navigating vertically")
+
+# Translators: If this checkbox is checked, then Orca will tell you when one of
+# your buddies is typing a message.
+CHAT_ANNOUNCE_BUDDY_TYPING = _("Announce when your _buddies are typing")
+
+# Translators: If this checkbox is checked, then Orca will provide the user with
+# chat room specific message histories rather than just a single history which
+# contains the latest messages from all the chat rooms that they are in.
+CHAT_SEPARATE_MESSAGE_HISTORIES = _("Provide chat room specific _message histories")
+
+# Translators: This is the label of a panel holding options for how messages in
+# this application's chat rooms should be spoken. The options are: Speak messages
+# from all channels (i.e. even if the chat application doesn't have focus); speak
+# messages from a channel only if it is the active channel; speak messages from
+# any channel, but only if the chat application has focus.
+CHAT_SPEAK_MESSAGES_FROM = _("Speak messages from")
+
+# Translators: This is the label of a radio button. If it is selected, Orca will
+# speak all new chat messages as they appear irrespective of whether or not the
+# chat application currently has focus. This is the default behaviour.
+CHAT_SPEAK_MESSAGES_ALL = _("All cha_nnels")
+
+# Translators: This is the label of a radio button. If it is selected, Orca will
+# speak all new chat messages as they appear if and only if the chat application
+# has focus. The string substituion is for the application name (e.g Pidgin).
+CHAT_SPEAK_MESSAGES_ALL_IF_FOCUSED = _("All channels when an_y %s window is active")
+
+# Translators: This is the label of a radio button. If it is selected, Orca will
+# only speak new chat messages for the currently active channel, irrespective of
+# whether the chat application has focus.
+CHAT_SPEAK_MESSAGES_ACTIVE = _("A channel only if its _window is active")
+
+# Translators: If this checkbox is checked, then Orca will speak the name of the
+# chat room prior to presenting an incoming message.
+CHAT_SPEAK_ROOM_NAME = _("_Speak Chat Room name")
+
+# Translators: This is a label which will appear in the list of available speech
+# engines as a special item. It refers to the default engine configured within
+# the speech subsystem. Apart from this item, the user will have a chance to
+# select a particular speech engine by its real name (Festival, IBMTTS, etc.)
+DEFAULT_SYNTHESIZER = _("Default Synthesizer")
+
+# Translators: This is the label for a spinbutton. This option allows the user
+# to specify the number of matched characters that must be present before Orca
+# speaks the line that contains the results from an application's Find toolbar.
+FIND_MINIMUM_MATCH_LENGTH = _("Minimum length of matched text:")
+
+# Translators: This is the label of a panel containing options for what Orca
+# presents when the user is in the Find toolbar of an application, e.g. Firefox.
+FIND_OPTIONS = _("Find Options")
+
+# Translators: This is the label for a checkbox. This option controls whether
+# the line that contains the match from an application's Find toolbar should
+# always be spoken, or only spoken if it is a different line than the line
+# which contained the last match.
+FIND_ONLY_SPEAK_CHANGED_LINES = _("Onl_y speak changed lines during find")
+
+# Translators: This is the label for a checkbox. This option controls whether or
+# not Orca will automatically speak the line that contains the match while the
+# user is performing a search from the Find toolbar of an application, e.g.
+# Firefox.
+FIND_SPEAK_RESULTS = _("Speak results during _find")
+
+# Translators: Function is a table column header where the cells in the column
+# are a sentence that briefly describes what action Orca will take if and when
+# the user invokes that keyboard command.
+KB_HEADER_FUNCTION = _("Function")
+
+# Translators: Key Binding is a table column header where the cells in the
+# column represent keyboard combinations the user can press to invoke Orca
+# commands.
+KB_HEADER_KEY_BINDING = _("Key Binding")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a blockquote.
+SN_HEADER_BLOCKQUOTE = C_("structural navigation", "Blockquote")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a button.
+SN_HEADER_BUTTON = C_("structural navigation", "Button")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the caption of a table.
+SN_HEADER_CAPTION = C_("structural navigation", "Caption")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the label of a check box.
+SN_HEADER_CHECK_BOX = C_("structural navigation", "Check Box")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the selected item in a combo box.
+SN_HEADER_COMBO_BOX = C_("structural navigation", "Combo Box")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the description of an element.
+SN_HEADER_DESCRIPTION = C_("structural navigation", "Description")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a heading.
+SN_HEADER_HEADING = C_("structural navigation", "Heading")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the label of a form field.
+SN_HEADER_LABEL = C_("structural navigation", "Label")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of a column which
+# contains the level of a heading. Level will be a "1" for <h1>, a "2" for <h2>,
+# and so on.
+SN_HEADER_LEVEL = C_("structural navigation", "Level")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a link.
+SN_HEADER_LINK = C_("structural navigation", "Link")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a list.
+SN_HEADER_LIST = C_("structural navigation", "List")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a list item.
+SN_HEADER_LIST_ITEM = C_("structural navigation", "List Item")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of an object.
+SN_HEADER_OBJECT = C_("structural navigation", "Object")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of a paragraph.
+SN_HEADER_PARAGRAPH = C_("structural navigation", "Paragraph")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the label of a radio button.
+SN_HEADER_RADIO_BUTTON = C_("structural navigation", "Radio Button")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the role of a widget. Examples include "heading", "paragraph",
+# "table", "combo box", etc.
+SN_HEADER_ROLE = C_("structural navigation", "Role")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the selected item of a form field.
+SN_HEADER_SELETED_ITEM = C_("structural navigation", "Selected Item")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the state of a widget. Examples include "checked"/"not checked",
+# "selected"/"not selected", "visited/not visited", etc.
+SN_HEADER_STATE = C_("structural navigation", "State")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the text of an entry.
+SN_HEADER_TEXT = C_("structural navigation", "Text")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the URI of a link.
+SN_HEADER_URI = C_("structural navigation", "URI")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title for a column which
+# contains the value of a form field.
+SN_HEADER_VALUE = C_("structural navigation", "Value")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_BLOCKQUOTE = C_("structural navigation", "Blockquotes")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_BUTTON = C_("structural navigation", "Buttons")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_CHECK_BOX = C_("structural navigation", "Check Boxes")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_COMBO_BOX = C_("structural navigation", "Combo Boxes")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_ENTRY = C_("structural navigation", "Entries")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_FORM_FIELD = C_("structural navigation", "Form Fields")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_HEADING = C_("structural navigation", "Headings")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+# Level will be a "1" for <h1>, a "2" for <h2>, and so on.
+SN_TITLE_HEADING_AT_LEVEL = C_("structural navigation", "Headings at Level %d")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+# A 'large object' is a logical chunk of text, such as a paragraph, a list,
+# a table, etc.
+SN_TITLE_LARGE_OBJECT = C_("structural navigation", "Large Objects")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_LINK = C_("structural navigation", "Links")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_LIST = C_("structural navigation", "Lists")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_LIST_ITEM = C_("structural navigation", "List Items")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_PARAGRAPH = C_("structural navigation", "Paragraphs")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_RADIO_BUTTON = C_("structural navigation", "Radio Buttons")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_TABLE = C_("structural navigation", "Tables")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_UNVISITED_LINK = C_("structural navigation", "Unvisited Links")
+
+# Translators: Orca has a command that presents a list of structural navigation
+# objects in a dialog box so that users can navigate more quickly than they
+# could with native keyboard navigation. This is the title of such a dialog box.
+SN_TITLE_VISITED_LINK = C_("structural navigation", "Visited Links")
+
+# Translators: This is the title of a panel holding options for how to navigate
+# HTML content (e.g., Orca caret navigation, positioning of caret, structural
+# navigation, etc.).
+PAGE_NAVIGATION = _("Page Navigation")
+
+# Translators: When the user loads a new web page, they can optionally have Orca
+# automatically start reading the page from beginning to end. This is the label
+# of a checkbox in which users can indicate their preference.
+READ_PAGE_UPON_LOAD = \
+ _("Automatically start speaking a page when it is first _loaded")
+
+# Translators: This string will appear in the list of available voices for the
+# current speech engine. "%s" will be replaced by the name of the current speech
+# engine, such as "Festival default voice" or "IBMTTS default voice". It refers
+# to the default voice configured for given speech engine within the speech
+# subsystem. Apart from this item, the list will contain the names of all
+# available "real" voices provided by the speech engine.
+SPEECH_DEFAULT_VOICE = _("%s default voice")
+
+# Translators this label refers to the name of particular speech synthesis
+# system. (http://devel.freebsoft.org/speechd)
+SPEECH_DISPATCHER = _("Speech Dispatcher")
+
+# Translators: This is a label for an option to tell Orca whether or not it
+# should speak the coordinates of the current spread sheet cell. Coordinates are
+# the row and column position within the spread sheet (i.e. A1, B1, C2 ...)
+SPREADSHEET_SPEAK_CELL_COORDINATES = _("Speak spread sheet cell coordinates")
+
+# Translators: This is a label for an option for whether or not to speak the
+# header of a table cell in document content.
+TABLE_ANNOUNCE_CELL_HEADER = _("Announce cell _header")
+
+# Translators: This is the title of a panel containing options for specifying
+# how to navigate tables in document content.
+TABLE_NAVIGATION = _("Table Navigation")
+
+# Translators: This is a label for an option to tell Orca to skip over empty/
+# blank cells when navigating tables in document content.
+TABLE_SKIP_BLANK_CELLS = _("Skip _blank cells")
+
+# Translators: This is a label for an option to tell Orca whether or not it
+# should speak table cell coordinates in document content.
+TABLE_SPEAK_CELL_COORDINATES = _("Speak _cell coordinates")
+
+# Translators: This is a label for an option to tell Orca whether or not it
+# should speak the span size of a table cell (e.g., how many rows and columns
+# a particular table cell spans in a table).
+TABLE_SPEAK_CELL_SPANS = _("Speak _multiple cell spans")
+
+# Translators: Gecko native caret navigation is where Firefox itself controls
+# how the arrow keys move the caret around HTML content. It's often broken, so
+# Orca needs to provide its own support. As such, Orca offers the user the
+# ability to switch between the Firefox mode and the Orca mode. This is the
+# label of a checkbox in which users can indicate their default preference.
+USE_CARET_NAVIGATION = _("Use _Orca Caret Navigation")
+
+# Translators: Orca provides keystrokes to navigate HTML content in a structural
+# manner: go to previous/next header, list item, table, etc. This is the label
+# of a checkbox in which users can indicate their default preference.
+USE_STRUCTURAL_NAVIGATION = _("Use Orca _Structural Navigation")
diff --git a/src/orca/input_event.py b/src/orca/input_event.py
index 3098328..c3ad695 100644
--- a/src/orca/input_event.py
+++ b/src/orca/input_event.py
@@ -33,9 +33,9 @@ import unicodedata
from . import debug
from . import keynames
+from . import messages
from . import orca_state
from . import settings
-from .orca_i18n import C_
KEYBOARD_EVENT = "keyboard"
BRAILLE_EVENT = "braille"
@@ -339,21 +339,9 @@ class KeyboardEvent(InputEvent):
return ''
if not locked:
- # Translators: This string is used to present the state of a
- # locking key, such as Caps Lock. If Caps Lock is "off", then
- # letters typed will appear in lowercase; if Caps Lock is "on",
- # they will instead appear in uppercase. This string is also
- # applied to Num Lock and potentially will be applied to similar
- # keys in the future.
- return C_("locking key state", "off")
-
- # Translators: This string is used to present the state of a
- # locking key, such as Caps Lock. If Caps Lock is "off", then
- # letters typed will appear in lowercase; if Caps Lock is "on",
- # they will instead appear in uppercase. This string is also
- # applied to Num Lock and potentially will be applied to similar
- # keys in the future.
- return C_("locking key state", "on")
+ return messages.LOCKING_KEY_STATE_OFF
+
+ return messages.LOCKING_KEY_STATE_ON
def getKeyName(self):
"""Returns the string to be used for presenting the key to the user."""
diff --git a/src/orca/liveregions.py b/src/orca/liveregions.py
index 5fb4aa0..9ba816b 100644
--- a/src/orca/liveregions.py
+++ b/src/orca/liveregions.py
@@ -1,12 +1,12 @@
import bisect
-from gi.repository import GLib
-from . import orca_state
-import pyatspi
-from . import speech
import copy
+import pyatspi
import time
+from gi.repository import GLib
-from .orca_i18n import _
+from . import messages
+from . import orca_state
+from . import speech
# define 'live' property types
LIVE_OFF = -1
@@ -261,24 +261,16 @@ class LiveRegionManager:
if cur_priority == LIVE_OFF or cur_priority == LIVE_NONE:
self._politenessOverrides[(uri, objectid)] = LIVE_POLITE
- # Translators: sets the live region politeness level to polite
- #
- utterances.append(_('setting live region to polite'))
+ utterances.append(messages.LIVE_REGIONS_LEVEL_POLITE)
elif cur_priority == LIVE_POLITE:
self._politenessOverrides[(uri, objectid)] = LIVE_ASSERTIVE
- # Translators: sets the live region politeness level to assertive
- #
- utterances.append(_('setting live region to assertive'))
+ utterances.append(messages.LIVE_REGIONS_LEVEL_ASSERTIVE)
elif cur_priority == LIVE_ASSERTIVE:
self._politenessOverrides[(uri, objectid)] = LIVE_RUDE
- # Translators: sets the live region politeness level to rude
- #
- utterances.append(_('setting live region to rude'))
+ utterances.append(messages.LIVE_REGIONS_LEVEL_RUDE)
elif cur_priority == LIVE_RUDE:
self._politenessOverrides[(uri, objectid)] = LIVE_OFF
- # Translators: sets the live region politeness level to off
- #
- utterances.append(_('setting live region to off'))
+ utterances.append(messages.LIVE_REGIONS_LEVEL_OFF)
speech.speak(utterances)
@@ -294,10 +286,7 @@ class LiveRegionManager:
def reviewLiveAnnouncement(self, msgnum):
"""Speak the given number cached message"""
if msgnum > len(self.msg_cache):
- # Tranlators: this tells the user that a cached message
- # is not available.
- #
- self._script.presentMessage(_('no live message saved'))
+ self._script.presentMessage(messages.LIVE_REGIONS_NO_MESSAGE)
else:
self._script.presentMessage(self.msg_cache[-msgnum])
@@ -312,9 +301,7 @@ class LiveRegionManager:
# The user is currently monitoring live regions but now wants to
# change all live region politeness on page to LIVE_OFF
if self.monitoring:
- # Translators: This lets the user know that all live regions
- # have been turned off.
- self._script.presentMessage(_("All live regions set to off"))
+ self._script.presentMessage(messages.LIVE_REGIONS_ALL_OFF)
self.msg_queue.clear()
# First we'll save off a copy for quick restoration
@@ -339,11 +326,7 @@ class LiveRegionManager:
else:
for key, value in list(self._restoreOverrides.items()):
self._politenessOverrides[key] = value
- # Translators: This lets the user know that all live regions
- # have been restored to their original politeness level.
- self._script.presentMessage(
- _("live regions politeness levels restored"))
-
+ self._script.presentMessage(messages.LIVE_REGIONS_ALL_RESTORED)
# Toggle our flag
self.monitoring = True
@@ -382,9 +365,7 @@ class LiveRegionManager:
# We will only output useful information
#
if results or liveprioritystr != 'none':
- # Translators: output the politeness level
- #
- results.append(_('politeness level %s') %liveprioritystr)
+ results.append(messages.LIVE_REGIONS_LEVEL % liveprioritystr)
return results
diff --git a/src/orca/messages.py b/src/orca/messages.py
index e642b6d..cddf96d 100644
--- a/src/orca/messages.py
+++ b/src/orca/messages.py
@@ -45,12 +45,65 @@ BLANK = _("blank")
# Translators: This refers to font weight.
BOLD = _("bold")
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user when a new bookmark has been entered into the list
+# of bookmarks.
+BOOKMARK_ENTERED = _("bookmark entered")
+
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user to indicate the comparative locations of the current
+# object and the bookmarked object could not be determined.
+BOOKMARK_COMPARISON_UNKNOWN = _('comparison unknown')
+
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user to indicate the current object is the same object
+# pointed to by a given bookmark.
+BOOKMARK_IS_CURRENT_OBJECT = _("bookmark is current object")
+
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user to indicate the current object's parent and the
+# bookmarked object's parent are the same.
+BOOKMARK_PARENT_IS_SAME = _("bookmark and current object have same parent")
+
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user to indicate the current object and the bookmarked
+# object share a common ancestor.
+BOOKMARK_SHARED_ANCESTOR = _("shared ancestor %s")
+
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user when the active list of bookmarks have been saved to
+# disk.
+BOOKMARKS_SAVED = _("bookmarks saved")
+
+# Translators: Orca has a feature in which users can store/save a particular
+# location in an application window and return to it later by pressing a
+# keystroke. These stored/saved locations are "bookmarks". This string is
+# presented to the user when an error was encountered, preventing the active
+# list of bookmarks being saved to disk.
+BOOKMARKS_SAVED_FAILURE = _("bookmarks could not be saved")
+
# Translators: Orca normally intercepts all keyboard commands and only passes
# them along to the current application when they are not Orca commands. This
# command causes the next command issued to be passed along to the current
# application, bypassing Orca's interception of it.
BYPASS_MODE_ENABLED = _("Bypass mode enabled.")
+# Translators: this is an indication that Orca is unable to obtain the display/
+# results area of the calculator being used (e.g. gcalctool).
+CALCULATOR_DISPLAY_NOT_FOUND = _("Unable to get calculator display")
+
# Translators: Orca uses Speech Dispatcher to present content to users via
# text-to-speech. Speech Dispatcher has a feature to control how capital
# letters are presented: Do nothing at all, say the word 'capital' prior to
@@ -111,9 +164,100 @@ CAPITALIZATION_SPELL_BRIEF = C_("capitalization style", "spell")
# to get into a GUI.
CAPITALIZATION_SPELL_FULL = _("Capitalization style set to spell.")
+# Translators: Gecko native caret navigation is where Firefox (or Thunderbird)
+# itself controls how the arrow keys move the caret around HTML content. It's
+# often broken, so Orca needs to provide its own support. As such, Orca offers
+# the user the ability to toggle which application is controlling the caret.
+CARET_CONTROL_GECKO = _("Gecko is controlling the caret.")
+
+# Translators: Gecko native caret navigation is where Firefox (or Thunderbird)
+# itself controls how the arrow keys move the caret around HTML content. It's
+# often broken, so Orca needs to provide its own support. As such, Orca offers
+# the user the ability to toggle which application is controlling the caret.
+CARET_CONTROL_ORCA = _("Orca is controlling the caret.")
+
# Translators: this is the name of a cell in a spreadsheet.
CELL = _("Cell %s")
+# Translators: In chat applications, it is often possible to see that a "buddy"
+# is typing currently (e.g. via a keyboard icon or status text). Some users like
+# to have this typing status announced by Orca; others find that announcment
+# unpleasant. Therefore, it is a setting in Orca. This string to be translated
+# is presented when the value of the setting is toggled.
+CHAT_BUDDY_TYPING_OFF = _("Do not announce when your buddies are typing.")
+
+# Translators: In chat applications, it is often possible to see that a "buddy"
+# is typing currently (e.g. via a keyboard icon or status text). Some users like
+# to have this typing status announced by Orca; others find that announcment
+# unpleasant. Therefore, it is a setting in Orca. This string to be translated
+# is presented when the value of the setting is toggled.
+CHAT_BUDDY_TYPING_ON = _("announce when your buddies are typing.")
+
+# Translators: In chat applcations, Orca automatically presents incoming
+# messages in speech and braille. If a user is in multiple conversations or
+# channels at the same time, it can be confusing to know what room or channel
+# a given message came from just from hearing/reading it. This string to be
+# translated is presented to the user to clarify where an incoming message
+# came from. The name of the chat room is the string substitution.
+CHAT_MESSAGE_FROM_ROOM = _("Message from chat room %s")
+
+# Translators: This message is presented to inform the user that a new chat
+# conversation has been added to the existing conversations. The "tab" here
+# refers to the tab which contains the label for a GtkNotebook page. The
+# label on the tab is the string substitution.
+CHAT_NEW_TAB = _("New chat tab %s")
+
+# Translators: In chat applcations, Orca automatically presents incoming
+# messages in speech and braille. If a user is in multiple conversations or
+# channels at the same time, it can be confusing to know what room or channel
+# a given message came from just from hearing/reading it. For this reason, Orca
+# has an option to present the name of the room first ("#a11y <joanie> hello!"
+# instead of "<joanie> hello!"). This string to be translated is presented when
+# the value of the setting is toggled.
+CHAT_ROOM_NAME_PREFIX_OFF = _("Do not speak chat room name.")
+
+# Translators: In chat applcations, Orca automatically presents incoming
+# messages in speech and braille. If a user is in multiple conversations or
+# channels at the same time, it can be confusing to know what room or channel
+# a given message came from just from hearing/reading it. For this reason, Orca
+# has an option to present the name of the room first ("#a11y <joanie> hello!"
+# instead of "<joanie> hello!"). This string to be translated is presented when
+# the value of the setting is toggled.
+CHAT_ROOM_NAME_PREFIX_ON = _("speak chat room name.")
+
+# Translators: Orca has a command to review previous chat room messages in
+# speech and braille. Some users prefer to have this message history combined
+# (e.g. the last ten messages which came in, no matter what room they came
+# from). Other users prefer to have specific room history (e.g. the last ten
+# messages from #a11y). Therefore, this is a setting in Orca. This string to be
+# translated is presented when the value of the setting is toggled.
+CHAT_SEPARATE_HISTORIES_OFF = \
+ _("Do not provide chat room specific message histories.")
+
+# Translators: Orca has a command to review previous chat room messages in
+# speech and braille. Some users prefer to have this message history combined
+# (e.g. the last ten messages which came in, no matter what room they came
+# from). Other users prefer to have specific room history (e.g. the last ten
+# messages from #a11y). Therefore, this is a setting in Orca. This string to be
+# translated is presented when the value of the setting is toggled.
+CHAT_SEPARATE_HISTORIES_ON = _("Provide chat room specific message histories.")
+
+# Translators: The "default" button in a dialog box is the button that gets
+# activated when Enter is pressed anywhere within that dialog box.
+DEFAULT_BUTTON_IS = _("Default button is %s")
+
+# Translators: This string is part of the presentation of an item that includes
+# one or several consequtive subscripted characters. For example, 'X' followed
+# by 'subscript 2' followed by 'subscript 3' should be presented to the user as
+# 'X subscript 23'.
+DIGITS_SUBSCRIPT = _(" subscript %s")
+
+# Translators: This string is part of the presentation of an item that includes
+# one or several consequtive superscripted characters. For example, 'X' followed
+# by 'superscript 2' followed by 'superscript 3' should be presented to the user
+# as 'X superscript 23'.
+DIGITS_SUPERSCRIPT = _(" superscript %s")
+
# Translators: when the user selects (highlights) or unselects text in a
# document, Orca will speak information about what they have selected or
# unselected. This message is presented when the user selects the entire
@@ -171,6 +315,16 @@ DYNAMIC_ROW_HEADER_CLEARED = _("Dynamic row header cleared.")
# spreadsheet is blank/empty.
EMPTY = _("empty")
+# Translators: This is the size of a file in kilobytes
+FILE_SIZE_KB = _("%.2f kilobytes")
+
+# Translators: This is the size of a file in megabytes
+FILE_SIZE_MB = _("%.2f megabytes")
+
+# Translators: This message is presented to the user after performing a file
+# search to indicate there were no matches.
+FILES_NOT_FOUND = _("No files found.")
+
# Translators: the 'flat review' feature of Orca allows the blind user to
# explore the text in a window in a 2D fashion. That is, Orca treats all
# the text from all objects in a window (e.g., buttons, labels, etc.) as a
@@ -213,6 +367,13 @@ FLAT_REVIEW_STOP = _("Leaving flat review.")
# (e.g., "=sum(a1:d1)")
HAS_FORMULA = _("has formula")
+# Translators: The following string is spoken to let the user know that he/she
+# is on a link within an image map. An image map is an image/graphic which has
+# been divided into regions. Each region can be clicked on and has an associated
+# link. Please see http://en.wikipedia.org/wiki/Imagemap for more information
+# and examples.
+IMAGE_MAP_LINK = _("image map link")
+
# Translators: Orca has an "echo" setting which allows the user to configure
# what is spoken in response to a key press. Given a user who typed "Hello
# world.":
@@ -369,6 +530,11 @@ KEY_ECHO_WORD_AND_SENTENCE_BRIEF = C_("key echo", "word and sentence")
# echo and can cycle through the various levels quickly via a command.
KEY_ECHO_WORD_AND_SENTENCE_FULL = _("Key echo set to word and sentence.")
+# Translators: Inaccessible means that the application cannot be read by Orca.
+# This usually means the application is not friendly to the assistive technology
+# infrastructure.
+INACCESSIBLE = _("inaccessible")
+
# Translators: This brief message indicates that indentation and
# justification will be spoken.
INDENTATION_JUSTIFICATION_OFF_BRIEF = \
@@ -410,6 +576,32 @@ LEARN_MODE_START_SPEECH = \
"press 2. To view Orca's documentation, press F1. " \
"To exit learn mode, press the escape key.")
+# Translators: when the user selects (highlights) or unselects text in a
+# document, Orca will speak information about what they have selected or
+# unselected. This message is presented when the user selects from the
+# current location to the end of the line by pressing Shift+Down.
+LINE_SELECTED_DOWN = _("line selected down from cursor position")
+
+# Translators: when the user selects (highlights) or unselects text in a
+# document, Orca will speak information about what they have selected or
+# unselected. This message is presented when the user selects from the
+# current location to the start of the line by pressing Shift+Up.
+LINE_SELECTED_UP = _("line selected up from cursor position")
+
+# Translators: when the user selects (highlights) or unselects text in a
+# document, Orca will speak information about what they have selected or
+# unselected. This message is presented when the user unselects previously
+# selected text from the current location to the end of the paragraph by
+# pressing Shift+Down.
+LINE_UNSELECTED_DOWN = _("line unselected down from cursor position")
+
+# Translators: when the user selects (highlights) or unselects text in a
+# document, Orca will speak information about what they have selected or
+# unselected. This message is presented when the user unselects previously
+# selected text from the current location to the start of the paragraph by
+# pressing Shift+Up.
+LINE_UNSELECTED_UP = _("line unselected up from cursor position")
+
# Translators: Orca has a "Learn Mode" that will allow the user to type any key
# on the keyboard and hear what the effects of that key would be. The effects
# might be what Orca would do if it had a handler for the particular key
@@ -433,14 +625,132 @@ LINE_SELECTED_RIGHT = _("line selected to end from previous cursor position")
# Translators: this indicates that this piece of text is a hypertext link.
LINK = _("link")
+# Translators: this is an indication that a given link points to an object
+# that is on the same page.
+LINK_SAME_PAGE = _("same page")
+
+# Translators: this is an indication that a given link points to an object
+# that is at the same site (but not on the same page as the link).
+LINK_SAME_SITE = _("same site")
+
+# Translators: this is an indication that a given link points to an object
+# that is at a different site than that of the link.
+LINK_DIFFERENT_SITE = _("different site")
+
+# Translators: this refers to a link to a file, where the first item is the
+# protocol (ftp, ftps, or file) and the second item the name of the file being
+# linked to.
+LINK_TO_FILE = _("%(uri)s link to %(file)s")
+
+# Translators: this message conveys the protocol of a link eg. http, mailto.
+LINK_WITH_PROTOCOL = _("%s link")
+
# Translators: The following string instructs the user how to navigate amongst
# the list of commands presented in learn mode, as well as how to exit the list
# when finished.
-LIST_SHORTCUTS_NAVIGATION = \
+LIST_NAVIGATION = \
_("Use Up and Down Arrow to navigate the list. Press Escape to exit.")
# Translators: A live region is an area of a web page that is periodically
# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user that Orca's live region's "politeness" level has changed to
+# "off" for all of the live regions.
+LIVE_REGIONS_ALL_OFF = _("All live regions set to off")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user that Orca's live region's "politeness" level for all live
+# regions has been restored to their original values.
+LIVE_REGIONS_ALL_RESTORED = _("live regions politeness levels restored")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user of the "politeness" level for the current live region.
+LIVE_REGIONS_LEVEL = _("politeness level %s")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user that Orca's live region's "politeness" level has changed for
+# the current live region.
+LIVE_REGIONS_LEVEL_ASSERTIVE = _("setting live region to assertive")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user that Orca's live region's "politeness" level has changed for
+# the current live region.
+LIVE_REGIONS_LEVEL_OFF = _("setting live region to off")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user that Orca's live region's "politeness" level has changed for
+# the current live region.
+LIVE_REGIONS_LEVEL_POLITE = _("setting live region to polite")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# The "politeness" level is an indication of when the user wishes to be notified
+# about a change to live region content. Examples include: never ("off"), when
+# idle ("polite"), and when there is a change ("assertive"). Orca has several
+# features to facilitate accessing live regions. This message is presented to
+# inform the user that Orca's live region's "politeness" level has changed for
+# the current live region.
+LIVE_REGIONS_LEVEL_RUDE = _("setting live region to rude")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# Orca has several features to facilitate accessing live regions. This message
+# is presented in response to a command that toggles whether or not Orca pays
+# attention to changes in live regions. Note that turning off monitoring of live
+# events is NOT the same as turning the politeness level to "off". The user can
+# opt to have no notifications presented (politeness level of "off") and still
+# manually review recent updates to live regions via Orca commands for doing so
+# -- as long as the monitoring of live regions is enabled.
+LIVE_REGIONS_MONITORING_OFF = _("Live regions monitoring off")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# Orca has several features to facilitate accessing live regions. This message
+# is presented in response to a command that toggles whether or not Orca pays
+# attention to changes in live regions. Note that turning off monitoring of live
+# events is NOT the same as turning the politeness level to "off". The user can
+# opt to have no notifications presented (politeness level of "off") and still
+# manually review recent updates to live regions via Orca commands for doing so
+# -- as long as the monitoring of live regions is enabled.
+LIVE_REGIONS_MONITORING_ON = _("Live regions monitoring on")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
+# Orca has several features to facilitate accessing live regions. This message
+# is presented to inform the user that a cached message is not available for the
+# the current live region.
+LIVE_REGIONS_NO_MESSAGE = _("no live message saved")
+
+# Translators: A live region is an area of a web page that is periodically
+# updated, e.g. stock ticker. http://www.w3.org/TR/wai-aria/terms#def_liveregion
# Orca has several features to facilitate accessing live regions. This message
# is presented to inform the user that Orca's live region features have been
# turned off.
@@ -456,6 +766,20 @@ LOCATION_NOT_FOUND_BRIEF = C_("location", "Not found")
# for some reason Orca cannot identify/find the current location.
LOCATION_NOT_FOUND_FULL = _("Could not find current location.")
+# Translators: This string is used to present the state of a locking key, such
+# as Caps Lock. If Caps Lock is "off", then letters typed will appear in
+# lowercase; if Caps Lock is "on", they will instead appear in uppercase. This
+# string is also applied to Num Lock and potentially will be applied to similar
+# keys in the future.
+LOCKING_KEY_STATE_OFF = C_("locking key state", "off")
+
+# Translators: This string is used to present the state of a locking key, such
+# as Caps Lock. If Caps Lock is "off", then letters typed will appear in
+# lowercase; if Caps Lock is "on", they will instead appear in uppercase. This
+# string is also applied to Num Lock and potentially will be applied to similar
+# keys in the future.
+LOCKING_KEY_STATE_ON = C_("locking key state", "on")
+
# Translators: This is to inform the user of the presence of the red squiggly
# line which indicates that a given word is not spelled correctly.
MISSPELLED = _("misspelled")
@@ -470,6 +794,12 @@ MISSPELLED_WORD = _("Misspelled word: %s")
# containing the misspelled word in the document. This is known as the context.
MISSPELLED_WORD_CONTEXT = _("Context is %s")
+# Translators: Hovering the mouse over certain objects on a web page causes a
+# new object to appear such as a pop-up menu. Orca has a command will move the
+# user to the object which just appeared as a result of the user hovering the
+# mouse. If this command fails, Orca will present this message.
+MOUSE_OVER_NOT_FOUND = _("Mouse over object not found.")
+
# Translators: Orca has a command that presents a list of structural navigation
# objects in a dialog box so that users can navigate more quickly than they
# could with native keyboard navigation. This is a message that will be
@@ -477,6 +807,24 @@ MISSPELLED_WORD_CONTEXT = _("Context is %s")
# from getting these objects.
NAVIGATION_DIALOG_ERROR = _("Error: Could not create list of objects.")
+# 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 = _("Nesting level %d")
+
+# Translators: Orca has a command that moves the mouse pointer to the current
+# location on a web page. If moving the mouse pointer caused an item to appear
+# such as a pop-up menu, we want to present that fact.
+NEW_ITEM_ADDED = _("New item has been added")
+
+# Translators: This is intended to be a short phrase to present the fact that no
+# no accessible component has keyboard focus.
+NO_FOCUS = _("No focus")
+
+# Translators: This message presents the fact that no accessible application has
+# has keyboard focus.
+NO_FOCUSED_APPLICATION = _("No application has focus.")
+
# Translators: This is for navigating document content by moving from anchor to
# anchor. (An anchor is a named spot that one can jump to.) This is a detailed
# message which will be presented to the user if no more anchors can be found.
@@ -587,6 +935,60 @@ NO_MORE_UNVISITED_LINKS = _("No more unvisited links.")
# the user if no more visited links can be found.
NO_MORE_VISITED_LINKS = _("No more visited links.")
+# Translators: This message alerts the user to the fact that what will be
+# presented next came from a notification.
+NOTIFICATION = _("Notification")
+
+# Translators: This is a brief message presented to the user when the bottom of
+# the list of notifications is reached.
+NOTIFICATION_LIST_BOTTOM = C_("notification", "Bottom")
+
+# Translators: This message is presented to the user to confirm the list of
+# notifications mode is being exited.
+NOTIFICATION_LIST_EXIT = _("Exiting list notification messages mode.")
+
+# Translators: This is a brief message presented to the user when the top of the
+# list of notifications is reached.
+NOTIFICATION_LIST_TOP = C_("notification", "Top")
+
+# Translators: This is a tutorial message for the notification list mode.
+NOTIFICATION_LIST_HELP = _("Press h for help.\n")
+
+# Translators: The following string instructs the user how to navigate within
+# the list notifications mode.
+NOTIFICATION_LIST_TUTORIAL = \
+ _("Use Up, Down, Home or End to navigate in the list.\n"\
+ "Press Escape to exit.\n"\
+ "Press Space to repeat the last message read.\n"\
+ "Press one digit to read a specific message.\n")
+
+# Translators: This message is presented to the user when the notifications list
+# is empty.
+NOTIFICATION_NO_MESSAGES = _("No notification messages")
+
+# Translators: This brief message is presented to indicate the state of widgets
+# (checkboxes, push buttons, toggle buttons) on a toolbar which are associated
+# with text formatting (bold, italics, underlining, justification, etc.).
+OFF = _("off")
+
+# Translators: This brief message is presented to indicate the state of widgets
+# (checkboxes, push buttons, toggle buttons) on a toolbar which are associated
+# with text formatting (bold, italics, underlining, justification, etc.).
+ON = _("on")
+
+# Translators: This message is presented to the user when a web page or similar
+# item has started loading.
+PAGE_LOADING_START = _("Loading. Please wait.")
+
+# Translators: This message is presented to the user when a web page or similar
+# item has finished loading.
+PAGE_LOADING_END = _("Finished loading.")
+
+# Translators: This message is presented to the user when a web page or similar
+# item has finished loading. The string substitution is for the name of the
+# object which has just finished loading (most likely the page's title).
+PAGE_LOADING_END_NAMED = _("Finished loading %s.")
+
# Translators: when the user selects (highlights) or unselects text in a
# document, Orca will speak information about what they have selected or
# unselected. This message is presented when the user selects from the
@@ -637,6 +1039,10 @@ PARAGRAPH_UNSELECTED_DOWN = _("paragraph unselected down from cursor position")
# pressing Ctrl+Shift+UP.
PARAGRAPH_UNSELECTED_UP = _("paragraph unselected up from cursor position")
+# Translators: This message is an indication of the position of the focused
+# slide and the total number of slides in the presentation.
+PRESENTATION_SLIDE_POSITION = _("slide %(position)d of %(count)d")
+
# Translators: This is a detailed message which will be presented as the user
# cycles amongst his/her saved profiles. A "profile" is a collection of settings
# which apply to a given task, such as a "Spanish" profile which would use
@@ -704,6 +1110,14 @@ PUNCTUATION_SOME_BRIEF = C_("spoken punctuation", "Some")
# spoken, or Some will be spoken.
PUNCTUATION_SOME_FULL = _("Punctuation level set to some.")
+# Translators: This message is presented to indicate that a search has begun
+# or is still taking place.
+SEARCHING = _("Searching.")
+
+# Translators: This message is presented to indicate a search executed by the
+# user has been completed.
+SEARCH_COMPLETE = _("Search complete.")
+
# Translators: This message is presented to the user when Orca's preferences
# have been reloaded.
SETTINGS_RELOADED = _("Orca user settings reloaded.")
@@ -728,6 +1142,12 @@ SPEECH_HIGHER = _("higher.")
# Translators: This string announces speech pitch change.
SPEECH_LOWER = _("lower.")
+# Translators: We replace the ellipses (both manual and UTF-8) with a spoken
+# string. The extra space you see at the beginning is because we need the
+# speech synthesis engine to speak the new string well. For example, "Open..."
+# turns into "Open dot dot dot".
+SPOKEN_ELLIPSIS = _(" dot dot dot")
+
# Translators: This message is presented to the user when Orca is launched.
START_ORCA = _("Welcome to Orca.")
@@ -773,6 +1193,17 @@ STRUCTURAL_NAVIGATION_KEYS_ON = _("Structural navigation keys on.")
# user if the desired structural navigation object could not be found.
STRUCTURAL_NAVIGATION_NOT_FOUND = C_("structural navigation", "Not found")
+# Translators: This message describes the (row, col) position of a table cell.
+TABLE_CELL_COORDINATES = _("Row %(row)d, column %(column)d.")
+
+# Translators: This message is presented to indicate the user is in the last
+# cell of a table in a document.
+TABLE_END = _("End of table")
+
+# Translators: This message is presented when a user is navigating within a
+# table and then navigates out of it.
+TABLE_LEAVING = _("leaving table.")
+
# Translators: When users are navigating a table, they sometimes want the entire
# row of a table read; other times they want just the current cell presented.
# This string is a message presented to the user when this setting is toggled.
@@ -783,6 +1214,11 @@ TABLE_MODE_CELL = _("Speak cell")
# This string is a message presented to the user when this setting is toggled.
TABLE_MODE_ROW = _("Speak row")
+# Translators: a uniform table is one in which each table cell occupies one row
+# and one column (i.e. a perfect grid). In contrast, a non-uniform table is one
+# in which at least one table cell occupies more than one row and/or column.
+TABLE_NON_UNIFORM = _("Non-uniform")
+
# Translators: This is for navigating document content by moving from table cell
# to table cell. If the user gives a table navigation command but is not in a
# table, presents this message.
@@ -796,6 +1232,14 @@ TABLE_REORDERED_COLUMNS = _("Columns reordered")
# have been reordered.
TABLE_REORDERED_ROWS = _("Rows reordered")
+# Translators: this is in reference to a column in a table. The substitution
+# is the index (e.g. the first column is "column 1").
+TABLE_COLUMN = _("column %d")
+
+# Translators: this is in reference to a column in a table. If the user is in
+# the first column of a table with five columns, the position is "column 1 of 5"
+TABLE_COLUMN_DETAILED = _("column %(index)d of %(total)d")
+
# Translators: This is for navigating document content by moving from table cell
# to table cell. This is the message presented when the user attempts to move to
# the cell below the current cell and is already in the last row.
@@ -806,6 +1250,14 @@ TABLE_COLUMN_BOTTOM = _("Bottom of column.")
# the cell above the current cell and is already in the first row.
TABLE_COLUMN_TOP = _("Top of column.")
+# Translators: this is in reference to a row in a table. The substitution is
+# the index (e.g. the first row is "row 1").
+TABLE_ROW = _("row %d")
+
+# Translators: this is in reference to a row in a table. If the user is in the
+# the first row of a table with five rows, the position is "row 1 of 5"
+TABLE_ROW_DETAILED = _("row %(index)d of %(total)d")
+
# Translators: This is for navigating document content by moving from table cell
# to table cell. This is the message presented when the user attempts to move to
# the left of the current cell and is already in the first column.
@@ -863,3 +1315,175 @@ WRAPPING_TO_BOTTOM = _("Wrapping to bottom.")
# to the top and continue looking downwards. We need to inform the user when
# this is taking place.
WRAPPING_TO_TOP = _("Wrapping to top.")
+
+# Translators, normally layered panes and tables have items in them. Thus it is
+# noteworthy when this is not the case. This message is presented to the user to
+# indicate the current layered pane or table contains zero items.
+ZERO_ITEMS = _("0 items")
+
+def cellSpan(rowspan, colspan):
+ spanString = ""
+ if (colspan > 1) and (rowspan > 1):
+ # Translators: The cell here refers to a cell within a table within a
+ # document. We need to announce when the cell occupies or "spans" more
+ # than a single row and/or column.
+ spanString = ngettext("Cell spans %d row",
+ "Cell spans %d rows",
+ rowspan) % rowspan
+
+ # Translators: this represents the number of columns in a table.
+ spanString += ngettext(" %d column",
+ " %d columns",
+ colspan) % colspan
+ elif (colspan > 1):
+ # Translators: The cell here refers to a cell within a table within a
+ # document. We need to announce when the cell occupies or "spans" more
+ # than a single row and/or column.
+ spanString = ngettext("Cell spans %d column",
+ "Cell spans %d columns",
+ colspan) % colspan
+ elif (rowspan > 1):
+ # Translators: The cell here refers to a cell within a table within a
+ # document. We need to announce when the cell occupies or "spans" more
+ # than a single row and/or column.
+ spanString = ngettext("Cell spans %d row",
+ "Cell spans %d rows",
+ rowspan) % rowspan
+
+ return spanString
+
+def charactersTooLong(count):
+ # Translators: People can enter a string of text that is too wide to be
+ # fully displayed in a spreadsheet cell. This message will be spoken if
+ # such a cell is encountered.
+ return ngettext("%d character too long",
+ "%d characters too long",
+ count) % count
+
+def dialogCountBraille(count):
+ # Translators: This message informs the user how many unfocused alert and
+ # dialog windows a newly (re)focused application has. It is added at the
+ # end of a braille message containing the app which just claimed focus.
+ return ngettext("(%d dialog)", "(%d dialogs)", count) % count
+
+def dialogCountSpeech(count):
+ # Translators: This message informs the user how many unfocused alert and
+ # dialog windows a newly (re)focused application has. It is added at the
+ # end of a spoken message containing the app which just claimed focus.
+ return ngettext("%d unfocused dialog", "%d unfocused dialogs", count) % count
+
+def fileSizeBytes(size):
+ # Translators: This is the size of a file in bytes
+ return ngettext("%d byte", "%d bytes", size) % size
+
+def filesFound(count):
+ # Translators: This message informs the user who many files were found as
+ # a result of a search.
+ return ngettext("%d file found", "%d files found", count) % count
+
+def formCount(count):
+ # Translators: This message presents the number of forms in a document.
+ return ngettext("%d form", "%d forms", count) % count
+
+def headingCount(count):
+ # Translators: This message presents the number of headings in a document.
+ return ngettext("%d heading", "%d headings", count) % count
+
+def itemCount(count):
+ # Translators: This message presents the number of items in a layered pane
+ # or table.
+ return ngettext("%d item", "%d items", count) % count
+
+def itemsFound(count):
+ # Translators: Orca has several commands that search for, and present a list
+ # of, objects based on one or more criteria. This is a message that will be
+ # presented to the user to indicate how many matching items were found.
+ return ngettext("%d item found", "%d items found", count) % count
+
+def listItemCount(count):
+ # Translators: This message describes a bulleted or numbered list.
+ return ngettext("List with %d item", "List with %d items", count) % count
+
+def messagesCount(count):
+ # Translators: This message is presented to inform the user of the number of
+ # messages in a list.
+ return ngettext("%d message.\n", "%d messages.\n", count) % count
+
+def percentage(value):
+ # Translators: This message is presented to inform the user of the value of
+ # a slider, progress bar, or other such component.
+ return ngettext("%d percent.", "%d percent.", value) % value
+
+def percentRead(value):
+ # Translators: This message announces the percentage of the document that
+ # has been read. The value is calculated by knowing the index of the current
+ # position divided by the total number of objects on the page.
+ return ngettext ("%d percent of document read",
+ "%d percent of document read",
+ value) % value
+
+def repeatedCharCount(repeatChar, count):
+ # Translators: Orca will tell you how many characters are repeated on a line
+ # of text. For example: "22 space characters". The %d is the number and the
+ # %s is the spoken word for the character.
+ return ngettext("%(count)d %(repeatChar)s character",
+ "%(count)d %(repeatChar)s characters",
+ count) % {"count" : count, "repeatChar": repeatChar}
+
+def selectedItemsCount(selected, total):
+ return ngettext("%(index)d of %(total)d item selected",
+ "%(index)d of %(total)d items selected",
+ total) % {"index" : selected, "total" : total}
+
+def shortcutsFoundOrca(count):
+ # Translators: This message is presented when the user is in a list of
+ # shortcuts associated with Orca commands which are not specific to the
+ # current application. It appears as the title of the dialog containing
+ # the list.
+ return ngettext("%d Orca default shortcut found.",
+ "%d Orca default shortcuts found.",
+ count) % count
+
+def shortcutsFoundApp(count, appName):
+ # Translators: This message is presented when the user is in a list of
+ # shortcuts associated with Orca commands specific to the current
+ # application. It appears as the title of the dialog containing the list.
+ return ngettext("%(count)d Orca shortcut for %(application)s found.",
+ "%(count)d Orca shortcuts for %(application)s found.",
+ count) % {"count" : count, "application" : appName}
+
+def spacesCount(count):
+ # Translators: This message is presented to inform the user of the number of
+ # space characters in a string.
+ return ngettext("%d space", "%d spaces", count) % count
+
+def tabsCount(count):
+ # Translators: This message is presented to inform the user of the number of
+ # tab characters in a string.
+ return ngettext("%d tab", "%d tabs", count) % count
+
+def tableCount(count):
+ # Translators: This message presents the number of tables in a document.
+ return ngettext("%d table", "%d tables", count) % count
+
+def tableSize(nRows, nColumns):
+ # Translators: this represents the number of rows in a table.
+ rowString = ngettext("table with %d row",
+ "table with %d rows",
+ nRows) % nRows
+ # Translators: this represents the number of columns in a table.
+ colString = ngettext("%d column",
+ "%d columns",
+ nColumns) % nColumns
+
+ return rowString + " " + colString
+
+def unvisitedLinkCount(count):
+ # Translators: This message presents the number of unvisited links in a
+ # document.
+ return ngettext("%d unvisited link", "%d unvisited links", count) % count
+
+def visitedLinkCount(count):
+ # Translators: This message presents the number of visited links in a
+ # document.
+ return ngettext("%d visited link", "%d visited links", count) % count
diff --git a/src/orca/notification_messages.py b/src/orca/notification_messages.py
index b0839af..57ee1cd 100644
--- a/src/orca/notification_messages.py
+++ b/src/orca/notification_messages.py
@@ -25,15 +25,13 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2010 Informal Informatica LTDA."
__license__ = "LGPL"
-from . import settings
import pyatspi
+
+from . import cmdnames
+from . import debug
from . import input_event
+from . import messages
from . import orca_state
-from . import debug
-
-from .orca_i18n import _
-from .orca_i18n import C_
-from .orca_i18n import ngettext
# to store the messages generated by the notification daemon
notificationMessages = []
@@ -75,26 +73,17 @@ def enableNotificationMessageListMode(script=None, inputEvent=None):
inputEventHandlers["repeatLastNotificationMessageHandler"] = \
input_event.InputEventHandler(
repeatLastNotificationMessage,
- # Translators: Orca can present the last notification message
- # to the user when the user presses a shortcut key.
- #
- _("Present last notification message."))
+ cmdnames.NOTIFICATION_MESSAGES_LAST)
inputEventHandlers["repeatPreviousNotificationMessageHandler"] = \
input_event.InputEventHandler(
repeatPreviousNotificationMessage,
- # Translators: Orca can present the previous notification message
- # to the user when the user presses a shortcut key.
- #
- _("Present previous notification message."))
+ cmdnames.NOTIFICATION_MESSAGES_PREVIOUS)
inputEventHandlers["enableNotificationMessageListModeHandler"] = \
input_event.InputEventHandler(
enableNotificationMessageListMode,
- # Translators: Orca can enable the notification messages
- # list mode when the user presses a shortcut key.
- #
- _("Present notification messages list"))
+ cmdnames.NOTIFICATION_MESSAGES_LIST)
def _showMessage(msg):
orca_state.activeScript.presentMessage(msg)
@@ -119,11 +108,7 @@ def size():
def _messagesPresent():
if size() <= 0:
- # Translators: This is a brief message presented to the user
- # the list of notifications is empty.
- #
- msg = _("No notification messages")
- _showMessage(msg)
+ _showMessage(messages.NOTIFICATION_NO_MESSAGES)
return False
return True
@@ -150,18 +135,10 @@ def _showNotificationMessage(index):
if index < 1:
index = 1
- # Translators: This is a brief message presented to the user when
- # when the top of a list of notifications is reached.
- #
- msg = C_("notification", "Top")
- _showMessage(msg)
+ _showMessage(messages.NOTIFICATION_LIST_TOP)
elif index > size():
index = size()
- # Translators: This is a brief message presented to the user when
- # when the bottom of a list of notifications is reached.
- #
- msg = C_("notification", "Bottom")
- _showMessage(msg)
+ _showMessage(messages.NOTIFICATION_LIST_BOTTOM)
indexNotificationMessages = index
index = size() - index
@@ -177,14 +154,7 @@ def exitListNotificationMessagesMode():
global listNotificationMessagesModeEnabled
listNotificationMessagesModeEnabled = False
- # Translators: Orca has a "List notification messages Mode" that allows
- # the user to list the latest notification messages received.
- # Escape exits this mode.
- # This string is the prompt which will be presented to the user
- # in both speech and braille upon exiting this mode.
- #
- message = _("Exiting list notification messages mode.")
- _showMessage(message)
+ _showMessage(messages.NOTIFICATION_LIST_EXIT)
def listNotificationMessages(event):
""" When list notification messages mode is enabled, this function
@@ -234,21 +204,9 @@ def listNotificationMessages(event):
return consumed
def _help(longHelp = False):
-
- # Translators: This message inform to the user the number of
- # messages in the list.
- msg = ngettext("%d message.\n", "%d messages.\n", int(size())) % (size())
- # Translators: This is a help message.
- msg += _("Press h for help.\n")
+ msg = messages.messagesCount(size())
+ msg += messages.NOTIFICATION_LIST_HELP
if longHelp:
- # Translators: The following string instructs the user how to navigate
- # amongst the list of commands presented in list notification
- # messages mode as well as how to exit the list.
- #
- msg += \
- _("Use Up, Down, Home or End to navigate in the list.\n"\
- "Press Escape to exit.\n"\
- "Press Space to repeat the last message read.\n"\
- "Press one digit to read a specific message.\n")
+ msg += messages.NOTIFICATION_LIST_TUTORIAL
_showMessage(msg)
diff --git a/src/orca/object_properties.py b/src/orca/object_properties.py
new file mode 100644
index 0000000..80dafbd
--- /dev/null
+++ b/src/orca/object_properties.py
@@ -0,0 +1,85 @@
+# Orca
+#
+# Copyright 2004-2009 Sun Microsystems Inc.
+# Copyright 2010-2013 The Orca Team
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the
+# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
+# Boston MA 02110-1301 USA.
+
+"""Propeerties of accessible objects. These have been put in their own module
+so that we can present them in the correct language when users change the
+language on the fly without having to reload a bunch of modules."""
+
+__id__ = "$Id$"
+__version__ = "$Revision$"
+__date__ = "$Date$"
+__copyright__ = "Copyright (c) 2004-2009 Sun Microsystems Inc." \
+ "Copyright (c) 2010-2013 The Orca Team"
+__license__ = "LGPL"
+
+from .orca_i18n import _, C_
+
+# 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
+# heading level, where the single character is to indicate 'heading'.
+ROLE_HEADING_LEVEL_BRAILLE = _("h%d")
+
+# Translators: The %(level)d is in reference to a heading level in HTML (e.g.,
+# For <h3>, the level is 3) and the %(role)s is in reference to a previously
+# translated rolename for the heading.
+ROLE_HEADING_LEVEL_SPEECH = _("%(role)s level %(level)d")
+
+# Translators: This is an alternative name for the parent object of a series
+# of icons.
+ROLE_ICON_PANEL = _("Icon panel")
+
+# Translators: This is a state which applies to the orientation of widgets
+# such as sliders and scroll bars.
+STATE_HORIZONTAL = _("horizontal")
+
+# Translators: This is a state which applies to the orientation of widgets
+# such as sliders and scroll bars.
+STATE_VERTICAL = _("vertical")
+
+# Translators: This is a state which applies to a check box.
+STATE_CHECKED = _("checked")
+
+# Translators: This is a state which applies to a check box.
+STATE_NOT_CHECKED = _("not checked")
+
+# Translators: This is a state which applies to a check box.
+STATE_PARTIALLY_CHECKED = _("partially checked")
+
+# Translators: This is a state which applies to a toggle button.
+STATE_PRESSED = _("pressed")
+
+# Translators: This is a state which applies to a toggle button.
+STATE_NOT_PRESSED = _("not pressed")
+
+# Translators: This is a state which applies to a radio button.
+STATE_SELECTED_RADIO_BUTTON = C_("radiobutton", "selected")
+
+# Translators: This is a state which applies to a radio button.
+STATE_UNSELECTED_RADIO_BUTTON = C_("radiobutton", "not selected")
+
+# Translators: This is a state which applies to a table cell.
+STATE_UNSELECTED_TABLE_CELL = C_("tablecell", "not selected")
+
+# Translators: This is a state which applies to a link.
+STATE_VISITED = C_("link state", "visited")
+
+# Translators: This is a state which applies to a link.
+STATE_UNVISITED = C_("link state", "unvisited")
diff --git a/src/orca/orca.py b/src/orca/orca.py
index d492d9e..225fc5a 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -69,7 +69,6 @@ from . import settings_manager
from . import speech
from .input_event import BrailleEvent
from .input_event import KeyboardEvent
-from .orca_i18n import ngettext
_eventManager = event_manager.getManager()
_scriptManager = script_manager.getManager()
diff --git a/src/orca/orca_i18n.py.in b/src/orca/orca_i18n.py.in
index 88ef423..23b5b80 100644
--- a/src/orca/orca_i18n.py.in
+++ b/src/orca/orca_i18n.py.in
@@ -78,12 +78,13 @@ def setLocaleForMessages(newLocale=None):
def setLocaleForNames(newLocale=None):
modules = ['orca.chnames', 'orca.keynames', 'orca.phonnames',
- 'orca.text_attribute_names']
+ 'orca.text_attribute_names', 'orca.object_properties']
for module in modules:
setModuleLocale(module, newLocale)
def setLocaleForGUI(newLocale=None):
modules = ['orca.orca_gtkbuilder', 'orca.orca_gui_prefs',
- 'orca.app_gui_prefs']
+ 'orca.app_gui_prefs', 'orca.guilabels',
+ 'orca.brltablenames']
for module in modules:
setModuleLocale(module, newLocale)
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 149dadc..cd8b770 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -33,16 +33,15 @@ import math
import pyatspi
import re
+from . import chnames
from . import debug
from . import keynames
from . import input_event
+from . import messages
from . import mouse_review
from . import orca_state
from . import settings
-from .orca_i18n import _
-from .orca_i18n import ngettext
-
#############################################################################
# #
# Utilities #
@@ -2379,15 +2378,7 @@ class Utilities:
if (not respectPunctuation) \
or (isPunctChar and (style <= level)):
repeatChar = chnames.getCharacterName(segment[0])
- # Translators: Orca will tell you how many characters
- # are repeated on a line of text. For example: "22
- # space characters". The %d is the number and the %s
- # is the spoken word for the character.
- #
- repeatSegment = ngettext("%(count)d %(repeatChar)s character",
- "%(count)d %(repeatChar)s characters",
- count) \
- % {"count" : count, "repeatChar": repeatChar}
+ repeatSegment = messages.repeatedCharCount(repeatChar, count)
line = "%s %s" % (line, repeatSegment)
else:
line += segment
@@ -2456,10 +2447,7 @@ class Utilities:
else:
continue
- # Translators: this indicates that this piece of
- # text is a hypertext link.
- #
- linkString = " " + _("link")
+ linkString = " " + messages.LINK
# If the link was not followed by a whitespace or punctuation
# character, then add in a space to make it more presentable.
@@ -2544,22 +2532,12 @@ class Utilities:
for number in superscripted:
new = [str(self.SUPERSCRIPT_DIGITS.index(d)) for d in number]
- # Translators: This string is part of the presentation of an
- # item that includes one or several consequtive superscripted
- # characters, e.g. 'X' followed by 'superscript 2' followed by
- # 'superscript 3' should be presented as 'X superscript 23'.
- #
- newString = _(" superscript %s") % "".join(new)
+ newString = messages.DIGITS_SUPERSCRIPT % "".join(new)
string = re.sub(number, newString, string)
for number in subscripted:
new = [str(self.SUBSCRIPT_DIGITS.index(d)) for d in number]
- # Translators: This string is part of the presentation of an
- # item that includes one or several consequtive subscripted
- # characters, e.g. 'X' followed by 'subscript 2' followed by
- # 'subscript 3', should be presented as 'X subscript 23.'
- #
- newString = _(" subscript %s") % "".join(new)
+ newString = messages.DIGITS_SUBSCRIPT % "".join(new)
string = re.sub(number, newString, string)
return string
@@ -2695,9 +2673,7 @@ class Utilities:
sequence = newSequence
except:
if sequence.endswith(" "):
- # Translators: this is the spoken word for the space character
- #
- sequence += _("space")
+ sequence += chnames.getCharacterName(" ")
sequence = sequence.replace("<", "")
sequence = sequence.replace(">", " ").strip()
diff --git a/src/orca/scripts/apps/evolution/script.py b/src/orca/scripts/apps/evolution/script.py
index 5987d4b..c25318d 100644
--- a/src/orca/scripts/apps/evolution/script.py
+++ b/src/orca/scripts/apps/evolution/script.py
@@ -29,6 +29,7 @@ __license__ = "LGPL"
import pyatspi
+import orca.cmdnames as cmdnames
import orca.debug as debug
import orca.scripts.default as default
import orca.keybindings as keybindings
@@ -41,7 +42,6 @@ import orca.speech as speech
import orca.speechserver as speechserver
import orca.settings as settings
import orca.settings_manager as settings_manager
-from orca.orca_i18n import _
from .formatting import Formatting
from .speech_generator import SpeechGenerator
@@ -121,7 +121,7 @@ class Script(default.Script):
self.inputEventHandlers["sayAllHandler"] = \
input_event.InputEventHandler(
Script.sayAll,
- _("Speaks entire document."))
+ cmdnames.SAY_ALL)
def isActivatableEvent(self, event):
"""Returns True if the given event is one that should cause this
diff --git a/src/orca/scripts/apps/gcalctool/script.py b/src/orca/scripts/apps/gcalctool/script.py
index 9579b52..81d8a80 100644
--- a/src/orca/scripts/apps/gcalctool/script.py
+++ b/src/orca/scripts/apps/gcalctool/script.py
@@ -25,16 +25,16 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
__license__ = "LGPL"
+import pyatspi
+
import orca.scripts.default as default
import orca.input_event as input_event
+import orca.messages as messages
import orca.orca_state as orca_state
import orca.speech as speech
-import pyatspi
from .speech_generator import SpeechGenerator
-from orca.orca_i18n import _ # for gettext support
-
########################################################################
# #
# The GCalcTool script class. #
@@ -79,11 +79,7 @@ class Script(default.Script):
objs = self.utilities.descendantsWithRole(
event.source, pyatspi.ROLE_EDITBAR)
if len(objs) == 0:
- # Translators: this is an indication that Orca is unable to
- # obtain the display of the gcalctool calculator, which is
- # the area where calculation results are presented.
- #
- contents = _("Unable to get calculator display")
+ contents = messages.CALCULATOR_DISPLAY_NOT_FOUND
speech.speak(contents)
self.displayBrailleMessage(contents)
else:
diff --git a/src/orca/scripts/apps/gnome-search-tool/script.py
b/src/orca/scripts/apps/gnome-search-tool/script.py
index 92703c0..9730819 100644
--- a/src/orca/scripts/apps/gnome-search-tool/script.py
+++ b/src/orca/scripts/apps/gnome-search-tool/script.py
@@ -26,10 +26,10 @@ __copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
__license__ = "LGPL"
import orca.debug as debug
+import orca.messages as messages
import orca.scripts.default as default
-from orca.orca_i18n import _ # for gettext support
-from orca.orca_i18n import ngettext # for gettext support
+from orca.orca_i18n import _
import pyatspi
import time
@@ -97,7 +97,7 @@ class Script(default.Script):
currentTime = time.time()
if not self.startTime or \
(currentTime > (self.startTime + self.searchInterval)):
- self.presentMessage(_("Searching."))
+ self.presentMessage(messages.SEARCHING)
self.startTime = time.time()
return True
@@ -166,7 +166,7 @@ class Script(default.Script):
+ "search completed.")
self.searching = False
- self.presentMessage(_("Search complete."))
+ self.presentMessage(messages.SEARCH_COMPLETE)
sensitive = self.fileTable.getState().contains( \
pyatspi.STATE_SENSITIVE)
if sensitive:
@@ -174,12 +174,10 @@ class Script(default.Script):
fileCount = self.fileTable.queryTable().nRows
except NotImplementedError:
fileCount = 0
- noFilesString = ngettext("%d file found",
- "%d files found",
- fileCount) % fileCount
+ noFilesString = messages.filesFound(fileCount)
self.presentMessage(noFilesString)
else:
- self.presentMessage(_("No files found."))
+ self.presentMessage(messages.FILES_NOT_FOUND)
# Pass the event onto the parent class to be handled in the default way.
#
diff --git a/src/orca/scripts/apps/gtk-window-decorator/script.py
b/src/orca/scripts/apps/gtk-window-decorator/script.py
index 0718112..ef147fb 100644
--- a/src/orca/scripts/apps/gtk-window-decorator/script.py
+++ b/src/orca/scripts/apps/gtk-window-decorator/script.py
@@ -25,12 +25,11 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
__license__ = "LGPL"
+import orca.messages as messages
import orca.scripts.default as default
import orca.speech as speech
import pyatspi
-from orca.orca_i18n import _
-
########################################################################
# #
# The gtk-window-decorator script class. #
@@ -82,11 +81,7 @@ class Script(default.Script):
text = obj.name
if not found:
- # Translators: inaccessible means that the application cannot
- # be read by Orca. This usually means the application is not
- # friendly to the assistive technology infrastructure.
- #
- text += ". " + _("inaccessible")
+ text += ". " + messages.INACCESSIBLE
self.displayBrailleMessage(text)
speech.stop()
diff --git a/src/orca/scripts/apps/metacity/script.py b/src/orca/scripts/apps/metacity/script.py
index 6e3fcb2..4dc2ba2 100644
--- a/src/orca/scripts/apps/metacity/script.py
+++ b/src/orca/scripts/apps/metacity/script.py
@@ -25,6 +25,7 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
__license__ = "LGPL"
+import orca.messages as messages
import orca.scripts.default as default
import orca.speech as speech
import pyatspi
@@ -113,11 +114,7 @@ class Script(default.Script):
if text.startswith(_("Workspace ")) or text.startswith(_("Desk ")):
pass
elif not found:
- # Translators: inaccessible means that the application cannot
- # be read by Orca. This usually means the application is not
- # friendly to the assistive technology infrastructure.
- #
- text += ". " + _("inaccessible")
+ text += ". " + messages.INACCESSIBLE
self.displayBrailleMessage(text)
speech.speak(text)
diff --git a/src/orca/scripts/apps/nautilus/script.py b/src/orca/scripts/apps/nautilus/script.py
index 686136b..6f5d7ae 100644
--- a/src/orca/scripts/apps/nautilus/script.py
+++ b/src/orca/scripts/apps/nautilus/script.py
@@ -27,12 +27,10 @@ __license__ = "LGPL"
import pyatspi
import orca.debug as debug
+import orca.messages as messages
import orca.scripts.default as default
import orca.speech as speech
-from orca.orca_i18n import ngettext
-from orca.orca_i18n import C_
-
########################################################################
# #
# The nautilus script class. #
@@ -136,9 +134,7 @@ class Script(default.Script):
except NotImplementedError:
itemCount = -1
if itemCount != -1:
- itemCountString = " " + ngettext("%d item",
- "%d items",
- itemCount) % itemCount
+ itemCountString = " " + messages.itemCount(itemCount)
break
return itemCountString
diff --git a/src/orca/scripts/apps/notification-daemon/script.py
b/src/orca/scripts/apps/notification-daemon/script.py
index c442077..d9a7240 100644
--- a/src/orca/scripts/apps/notification-daemon/script.py
+++ b/src/orca/scripts/apps/notification-daemon/script.py
@@ -25,11 +25,12 @@ __date__ = ""
__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
__license__ = "LGPL"
+import pyatspi
+
+import orca.messages as messages
import orca.scripts.default as default
import orca.speech as speech
-import pyatspi
-from orca.orca_i18n import _
########################################################################
# #
@@ -58,8 +59,6 @@ class Script(default.Script):
a = self.utilities.descendantsWithRole(event.source, pyatspi.ROLE_LABEL)
print(a)
texts = [self.utilities.displayedText(acc) for acc in a]
- # Translators: This denotes a notification to the user of some sort.
- #
- text = _('Notification %s') % ' '.join(texts)
+ text = '%s %s' % (messages.NOTIFICATION, ' '.join(texts))
speech.speak(text, None, True)
diff --git a/src/orca/scripts/apps/notify-osd/script.py b/src/orca/scripts/apps/notify-osd/script.py
index 2d0944e..87492f8 100644
--- a/src/orca/scripts/apps/notify-osd/script.py
+++ b/src/orca/scripts/apps/notify-osd/script.py
@@ -25,13 +25,12 @@ __date__ = ""
__copyright__ = "Copyright (c) 2009 Eitan Isaacson"
__license__ = "LGPL"
+import orca.messages as messages
import orca.scripts.default as default
import orca.settings as settings
import orca.speech as speech
import orca.notification_messages as notification_messages
-from orca.orca_i18n import _
-
########################################################################
# #
# The notify-osd script class. #
@@ -80,9 +79,7 @@ class Script(default.Script):
utterances = []
message = ""
if value < 0:
- # Translators: This denotes a notification to the user of some sort.
- #
- utterances.append(_('Notification'))
+ utterances.append(messages.NOTIFICATION)
utterances.append(self.voices.get(settings.SYSTEM_VOICE))
message = '%s %s' % (event.source.name, event.source.description)
utterances.append(message)
diff --git a/src/orca/scripts/apps/packagemanager/script.py b/src/orca/scripts/apps/packagemanager/script.py
index dd83bbb..fa306f6 100644
--- a/src/orca/scripts/apps/packagemanager/script.py
+++ b/src/orca/scripts/apps/packagemanager/script.py
@@ -31,6 +31,7 @@ from gi.repository import Gtk
import pyatspi
import orca.scripts.default as default
+import orca.messages as messages
import orca.orca as orca
import orca.orca_state as orca_state
import orca.settings as settings
@@ -218,19 +219,13 @@ class Script(default.Script):
return
if event.detail1 == 1 and not self._isBusy:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- msg = _("Loading. Please wait.")
+ msg = messages.PAGE_LOADING_START
speech.speak(msg)
self.displayBrailleMessage(
msg, flashTime=settings.brailleFlashTime)
self._isBusy = True
elif event.detail1 == 0 and self._isBusy:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- msg = _("Finished loading.")
+ msg = messages.PAGE_LOADING_END
speech.speak(msg)
self.displayBrailleMessage(
msg, flashTime=settings.brailleFlashTime)
diff --git a/src/orca/scripts/apps/pidgin/script.py b/src/orca/scripts/apps/pidgin/script.py
index 1bb141f..bde1859 100644
--- a/src/orca/scripts/apps/pidgin/script.py
+++ b/src/orca/scripts/apps/pidgin/script.py
@@ -28,11 +28,10 @@ __license__ = "LGPL"
import pyatspi
+import orca.messages as messages
import orca.scripts.default as default
import orca.speech as speech
-from orca.orca_i18n import _
-
from .chat import Chat
from .script_utilities import Utilities
from .speech_generator import SpeechGenerator
@@ -141,7 +140,7 @@ class Script(default.Script):
if nameFound:
child = event.source[-1]
if child.name:
- line = _("New chat tab %s") % child.name
+ line = messages.CHAT_NEW_TAB % child.name
speech.speak(line)
def onNameChanged(self, event):
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index 9421e34..177f34f 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -40,8 +40,10 @@ __license__ = "LGPL"
from gi.repository import Gtk
import pyatspi
+import orca.cmdnames as cmdnames
import orca.debug as debug
import orca.scripts.default as default
+import orca.guilabels as guilabels
import orca.keybindings as keybindings
import orca.input_event as input_event
import orca.messages as messages
@@ -50,8 +52,6 @@ import orca.orca_state as orca_state
import orca.speech as speech
import orca.settings as settings
import orca.settings_manager as settings_manager
-from orca.orca_i18n import _
-from orca.orca_i18n import ngettext
from .speech_generator import SpeechGenerator
from .braille_generator import BrailleGenerator
@@ -218,79 +218,44 @@ class Script(default.Script):
"""
default.Script.setupInputEventHandlers(self)
- self.inputEventHandlers.update(\
+ self.inputEventHandlers.update(
self.structuralNavigation.inputEventHandlers)
self.inputEventHandlers["presentInputLineHandler"] = \
input_event.InputEventHandler(
Script.presentInputLine,
- # Translators: this is the input line of a spreadsheet
- # (i.e., the place where enter formulas)
- #
- _("Presents the contents of the input line."))
+ cmdnames.PRESENT_INPUT_LINE)
self.inputEventHandlers["setDynamicColumnHeadersHandler"] = \
input_event.InputEventHandler(
Script.setDynamicColumnHeaders,
- # Translators: Orca allows you to dynamically define which
- # row of a spreadsheet or table counts as column headers.
- #
- _("Set the row to use as dynamic column headers " \
- "when speaking calc cells."))
+ cmdnames.DYNAMIC_COLUMN_HEADER_SET)
self.inputEventHandlers["clearDynamicColumnHeadersHandler"] = \
input_event.InputEventHandler(
Script.clearDynamicColumnHeaders,
- # Translators: Orca allows you to dynamically define which
- # row of a spreadsheet or table counts as column headers.
- #
- _("Clears the dynamic column headers."))
+ cmdnames.DYNAMIC_COLUMN_HEADER_CLEAR)
self.inputEventHandlers["setDynamicRowHeadersHandler"] = \
input_event.InputEventHandler(
Script.setDynamicRowHeaders,
- # Translators: Orca allows you to dynamically define which
- # column of a spreadsheet or table counts as row headers.
- #
- _("Set the column to use as dynamic row headers " \
- "to use when speaking calc cells."))
+ cmdnames.DYNAMIC_ROW_HEADER_SET)
self.inputEventHandlers["clearDynamicRowHeadersHandler"] = \
input_event.InputEventHandler(
Script.clearDynamicRowHeaders,
- # Translators: Orca allows you to dynamically define which
- # column of a spreadsheet or table counts as row headers.
- #
- _("Clears the dynamic row headers"))
+ cmdnames.DYNAMIC_ROW_HEADER_CLEAR)
self.inputEventHandlers["panBrailleLeftHandler"] = \
input_event.InputEventHandler(
Script.panBrailleLeft,
- # Translators: a refreshable braille display is an
- # external hardware device that presents braille
- # character to the user. There are a limited number
- # of cells on the display (typically 40 cells). Orca
- # provides the feature to build up a longer logical
- # line and allow the user to press buttons on the
- # braille display so they can pan left and right over
- # this line.
- #
- _("Pans the braille display to the left."),
+ cmdnames.PAN_BRAILLE_LEFT,
False) # Do not enable learn mode for this action
self.inputEventHandlers["panBrailleRightHandler"] = \
input_event.InputEventHandler(
Script.panBrailleRight,
- # Translators: a refreshable braille display is an
- # external hardware device that presents braille
- # character to the user. There are a limited number
- # of cells on the display (typically 40 cells). Orca
- # provides the feature to build up a longer logical
- # line and allow the user to press buttons on the
- # braille display so they can pan left and right over
- # this line.
- #
- _("Pans the braille display to the right."),
+ cmdnames.PAN_BRAILLE_RIGHT,
False) # Do not enable learn mode for this action
def getAppKeyBindings(self):
@@ -350,11 +315,7 @@ class Script(default.Script):
grid = Gtk.Grid()
grid.set_border_width(12)
- # Translators: If checked, then Orca will speak the coordinates
- # of the current spread sheet cell. Coordinates are the row and
- # column position within the spread sheet (i.e. A1, B1, C2 ...)
- #
- label = _("Speak spread sheet cell coordinates")
+ label = guilabels.SPREADSHEET_SPEAK_CELL_COORDINATES
value = script_settings.speakSpreadsheetCoordinates
self.speakSpreadsheetCoordinatesCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
@@ -364,10 +325,7 @@ class Script(default.Script):
tableFrame = Gtk.Frame()
grid.attach(tableFrame, 0, 1, 1, 1)
- # Translators: this is the title of a panel containing options
- # for specifying how to navigate tables in document content.
- #
- label = Gtk.Label(label="<b>%s</b>" % _("Table Navigation"))
+ label = Gtk.Label(label="<b>%s</b>" % guilabels.TABLE_NAVIGATION)
label.set_use_markup(True)
tableFrame.set_label_widget(label)
@@ -377,41 +335,28 @@ class Script(default.Script):
tableGrid = Gtk.Grid()
tableAlignment.add(tableGrid)
- # Translators: this is an option to tell Orca whether or not it
- # should speak table cell coordinates in document content.
- #
- label = _("Speak _cell coordinates")
+ label = guilabels.TABLE_SPEAK_CELL_COORDINATES
value = _settingsManager.getSetting('speakCellCoordinates')
self.speakCellCoordinatesCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakCellCoordinatesCheckButton.set_active(value)
tableGrid.attach(self.speakCellCoordinatesCheckButton, 0, 0, 1, 1)
- # Translators: this is an option to tell Orca whether or not it
- # should speak the span size of a table cell (e.g., how many
- # rows and columns a particular table cell spans in a table).
- #
- label = _("Speak _multiple cell spans")
+ label = guilabels.TABLE_SPEAK_CELL_SPANS
value = _settingsManager.getSetting('speakCellSpan')
self.speakCellSpanCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakCellSpanCheckButton.set_active(value)
tableGrid.attach(self.speakCellSpanCheckButton, 0, 1, 1, 1)
- # Translators: this is an option for whether or not to speak
- # the header of a table cell in document content.
- #
- label = _("Announce cell _header")
+ label = guilabels.TABLE_ANNOUNCE_CELL_HEADER
value = _settingsManager.getSetting('speakCellHeaders')
self.speakCellHeadersCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakCellHeadersCheckButton.set_active(value)
tableGrid.attach(self.speakCellHeadersCheckButton, 0, 2, 1, 1)
- # Translators: this is an option to allow users to skip over
- # empty/blank cells when navigating tables in document content.
- #
- label = _("Skip _blank cells")
+ label = guilabels.TABLE_SKIP_BLANK_CELLS
value = _settingsManager.getSetting('skipBlankCells')
self.skipBlankCellsCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
@@ -749,25 +694,10 @@ class Script(default.Script):
if not self.utilities.isSameObject(oldAncestor, newAncestor):
if oldTable:
- # We've left a table. Announce this fact.
- #
- self.presentMessage(_("leaving table."))
+ self.presentMessage(messages.TABLE_LEAVING)
if newTable:
- nRows = newTable.nRows
- nColumns = newTable.nColumns
- # Translators: this represents the number of rows in a table.
- #
- rowString = ngettext("table with %d row",
- "table with %d rows",
- nRows) % nRows
- # Translators: this represents the number of columns in a table.
- #
- colString = ngettext("%d column",
- "%d columns",
- nColumns) % nColumns
-
- line = rowString + " " + colString
- self.presentMessage(line)
+ self.presentMessage(
+ messages.tableSize(newTable.nRows, newTable.nColumns))
if not newTable:
self.lastCell = [None, -1]
@@ -1201,38 +1131,7 @@ class Script(default.Script):
speech.speak(word, voice)
if self.endOfLink(obj, word, startOffset, endOffset):
- speech.speak(_("link"))
-
- def isSetupDialog(self, obj):
- """ Check to see if this object is in the Setup dialog by walking
- back up the object hierarchy until we get to the dialog object and
- checking to see if it has a name that starts with "Welcome to
- StarOffice".
-
- Arguments:
- - obj: an Accessible object that implements the AccessibleText
- interface
-
- Returns an indication of whether this object is in the Setup dialog.
- """
-
- found = False
- while obj and obj.getRole() != pyatspi.ROLE_APPLICATION:
- # Translators: this is the title of the window that
- # you get when starting StarOffice. The translated
- # form has to match what StarOffice/OpenOffice is
- # using. We hate keying off stuff like this, but
- # we're forced to do so in this case.
- #
- if obj.getRole() == pyatspi.ROLE_DIALOG and \
- (obj.name and obj.name.startswith(_("Welcome to StarOffice"))):
- debug.println(self.debugLevel,
- "StarOffice.isSetupDialog: True.")
- found = True
-
- obj = obj.parent
-
- return found
+ speech.speak(messages.LINK)
def speakSetupLabel(self, label):
"""Speak this Setup dialog label.
@@ -1257,58 +1156,6 @@ class Script(default.Script):
for label in allLabels:
self.speakSetupLabel(label)
- def __isAvailableFieldsPanel(self, event):
- """If we are in the sbase Table Wizard, try to reduce the numerous
- utterances of "Available fields panel". See bug #465087 for more
- details.
-
- Arguments:
- - event: the object state change event.
- """
-
- # Translators: this represents a match with the name of the
- # "Available fields" list in the Tables wizard dialog in the
- # the OOo oobase database application. We're looking for the
- # accessible object name starting with "Available fields".
- # We really try to avoid doing this kind of thing, but
- # sometimes it is necessary and we apologize.
- #
- panelName = _("Available fields")
-
- isPanel = False
- if event.type == "object:state-changed:focused":
- rolesList = [pyatspi.ROLE_PANEL,
- pyatspi.ROLE_SCROLL_PANE,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- tmp = event.source.parent.parent
- if tmp.name.startswith(panelName):
- isPanel = True
-
- if not isPanel:
- rolesList = [pyatspi.ROLE_SCROLL_PANE,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- if event.source.parent.name.startswith(panelName):
- isPanel = True
-
- if not isPanel:
- rolesList = [pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- if event.source.name.startswith(panelName):
- isPanel = True
-
- return isPanel
-
def _speakWriterText(self, event, textToSpeak):
"""Called to speak the current line or paragraph of Writer text.
@@ -1411,102 +1258,6 @@ class Script(default.Script):
self.displayBrailleForObject(event.source)
return
- # Check to see if the object that just got focus is in the Setup
- # dialog. If it is, then check for a variety of scenerios.
- #
- if self.isSetupDialog(event.source):
-
- # Check for 1. License Agreement: Scroll Down button.
- #
- rolesList = [pyatspi.ROLE_PUSH_BUTTON,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- debug.println(self.debugLevel,
- "StarOffice.locusOfFocusChanged - Setup dialog: " \
- + "License Agreement screen: Scroll Down button.")
- self.handleSetupPanel(event.source.parent)
- self.presentMessage(_("Note that the Scroll Down button has " \
- "to be pressed numerous times."))
-
- # Check for 2. License Agreement: Accept button.
- #
- rolesList = [pyatspi.ROLE_UNKNOWN,
- pyatspi.ROLE_SCROLL_PANE,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- debug.println(self.debugLevel,
- "StarOffice.locusOfFocusChanged - Setup dialog: " \
- + "License Agreement screen: accept button.")
- self.presentMessage(
- _("License Agreement Accept button now has focus."))
-
- # Check for 3. Personal Data: Transfer Personal Data check box.
- #
- rolesList = [pyatspi.ROLE_CHECK_BOX,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- debug.println(self.debugLevel,
- "StarOffice.locusOfFocusChanged - Setup dialog: " \
- + "Personal Data: Transfer Personal Data check box.")
- self.handleSetupPanel(event.source.parent)
-
- # Check for 4. User name: First Name text field.
- #
- rolesList = [pyatspi.ROLE_TEXT,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- # Translators: this is the name of the field in the StarOffice
- # setup dialog that is asking for the first name of the user.
- # The translated form has to match what StarOffice/OpenOffice
- # is using. We hate keying off stuff like this, but we're
- # forced to in this case.
- #
- if self.utilities.hasMatchingHierarchy(event.source, rolesList) \
- and event.source.name == _("First name"):
- debug.println(self.debugLevel,
- "StarOffice.locusOfFocusChanged - Setup dialog: " \
- + "User name: First Name text field.")
-
- # Just speak the informative labels at the top of the panel
- # (and not the ones that have LABEL_FOR relationships).
- #
- panel = event.source.parent
- allLabels = self.utilities.descendantsWithRole(
- panel, pyatspi.ROLE_LABEL)
- for label in allLabels:
- relations = label.getRelationSet()
- hasLabelFor = False
- for relation in relations:
- if relation.getRelationType() \
- == pyatspi.RELATION_LABEL_FOR:
- hasLabelFor = True
- if not hasLabelFor:
- self.speakSetupLabel(label)
-
- # Check for 5. Registration: Register Now radio button.
- #
- rolesList = [pyatspi.ROLE_RADIO_BUTTON,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_OPTION_PANE,
- pyatspi.ROLE_DIALOG,
- pyatspi.ROLE_APPLICATION]
- if self.utilities.hasMatchingHierarchy(event.source, rolesList):
- debug.println(self.debugLevel,
- "StarOffice.locusOfFocusChanged - Setup dialog: " \
- + "Registration: Register Now radio button.")
- self.handleSetupPanel(event.source.parent)
-
# Check to see if we are editing a spread sheet cell. If so, just
# return to avoid uttering something like "Paragraph 0 paragraph".
#
@@ -1523,34 +1274,6 @@ class Script(default.Script):
+ "Calc: cell editor.")
return
- # Check to see if the focus has just moved to the Name Box combo
- # box in Calc. If so, then replace the non-existent name with a
- # simple one before falling through and calling the default
- # locusOfFocusChanged method, which in turn will result in our
- # _generateSpeechForComboBox() method being called.
- #
- rolesList = [pyatspi.ROLE_LIST,
- pyatspi.ROLE_COMBO_BOX,
- pyatspi.ROLE_TOOL_BAR,
- pyatspi.ROLE_PANEL,
- pyatspi.ROLE_ROOT_PANE,
- pyatspi.ROLE_FRAME,
- pyatspi.ROLE_APPLICATION]
-
- if self.utilities.hasMatchingHierarchy(event.source, rolesList) \
- and (not event.source.name or len(event.source.name) == 0):
- debug.println(self.debugLevel, "StarOffice.locusOfFocusChanged - " \
- + "Calc: name box.")
-
- self.updateBraille(newLocusOfFocus)
-
- # Translators: this is our made up name for the nameless field
- # in StarOffice/OpenOffice calc that allows you to type in a
- # cell coordinate (e.g., A4) and then move to it.
- #
- self.presentMessage(_("Move to cell"))
- return
-
# Check to see if this is a Calc: spread sheet cell. If it is then
# we don't want to speak "not selected" after giving the cell
# location and contents (which is what the default locusOfFocusChanged
@@ -1662,43 +1385,22 @@ class Script(default.Script):
details = debug.getAccessibleDetails(self.debugLevel, event.source)
debug.printObjectEvent(self.debugLevel, event, details)
- # Check to see if the Setup dialog window has just been activated.
- # If it has, then find the panel within it that has no name and
- # speak all the labels within that panel.
- #
- if self.isSetupDialog(event.source):
- debug.println(self.debugLevel,
- "StarOffice.onWindowActivated - Setup dialog: Welcome screen.")
-
- allPanels = self.utilities.descendantsWithRole(
- event.source.parent, pyatspi.ROLE_PANEL)
- for panel in allPanels:
- if not panel.name:
- allLabels = self.utilities.descendantsWithRole(
- panel, pyatspi.ROLE_LABEL)
- for label in allLabels:
- self.speakSetupLabel(label)
- else:
- # Clear our stored misspelled word history.
- #
- self.lastTextLength = -1
- self.lastBadWord = ''
- self.lastStartOff = -1
- self.lastEndOff = -1
+ # Clear our stored misspelled word history.
+ self.lastTextLength = -1
+ self.lastBadWord = ''
+ self.lastStartOff = -1
+ self.lastEndOff = -1
- # Let the default script do its thing.
- #
- default.Script.onWindowActivated(self, event)
+ default.Script.onWindowActivated(self, event)
- # Maybe it's the spellcheck dialog. Might as well try and see.
- # If it is, we want to speak the misspelled word and context
- # after we've spoken the window name.
- #
- if event.source \
- and event.source.getRole() == pyatspi.ROLE_DIALOG \
- and event.source.childCount \
- and event.source[0].getRole() == pyatspi.ROLE_OPTION_PANE:
- self.readMisspeltWord(event, event.source)
+ # Maybe it's the spellcheck dialog. Might as well try and see.
+ # If it is, we want to speak the misspelled word and context
+ # after we've spoken the window name.
+ if event.source \
+ and event.source.getRole() == pyatspi.ROLE_DIALOG \
+ and event.source.childCount \
+ and event.source[0].getRole() == pyatspi.ROLE_OPTION_PANE:
+ self.readMisspeltWord(event, event.source)
def onNameChanged(self, event):
"""Called whenever a property on an object changes.
@@ -1733,11 +1435,7 @@ class Script(default.Script):
if title:
title += "."
- # Translators: this is an indication of the position of the
- # focused Impress slide and the total number of slides in the
- # presentation.
- #
- msg = _("slide %(position)d of %(count)d") % \
+ msg = messages.PRESENTATION_SLIDE_POSITION % \
{"position" : position, "count" : count}
msg = self.utilities.appendString(title, msg)
self.presentMessage(msg)
@@ -1952,29 +1650,6 @@ class Script(default.Script):
or event.detail1 == 0):
return
- # Check to see if we are in the Presentation startup wizard. If so,
- # then speak the object that currently has focus.
- #
- if event.type.startswith("object:state-changed:sensitive") and \
- event.source.getRole() == pyatspi.ROLE_PANEL and \
- event.source.getState().contains(pyatspi.STATE_SENSITIVE):
- current = event.source.parent
- while current.getRole() != pyatspi.ROLE_APPLICATION:
- # Translators: this is the title of the window that
- # you get when using StarOffice Presentation Wizard. The
- # translated form has to match what
- # StarOffice/OpenOffice is using. We hate keying off
- # stuff like this, but we're forced to do so in this
- # case.
- #
- if current.getRole() == pyatspi.ROLE_DIALOG and \
- (current.name and \
- current.name.startswith(_("Presentation Wizard"))):
- self.locusOfFocusChanged(event, None,
- orca_state.locusOfFocus)
- break
- current = current.parent
-
# Prevent "object:state-changed:active" events from activating
# the find operation. See comment #18 of bug #354463.
#
@@ -2039,13 +1714,6 @@ class Script(default.Script):
None, event.source.parent, notifyScript=False)
return
- # If we are in the sbase Table Wizard, try to reduce the numerous
- # utterances of "Available fields panel". See bug #465087 for
- # more details.
- #
- if self.__isAvailableFieldsPanel(event):
- return
-
default.Script.onStateChanged(self, event)
def onSelectionChanged(self, event):
diff --git a/src/orca/scripts/apps/soffice/speech_generator.py
b/src/orca/scripts/apps/soffice/speech_generator.py
index e5c6174..f0eeb0e 100644
--- a/src/orca/scripts/apps/soffice/speech_generator.py
+++ b/src/orca/scripts/apps/soffice/speech_generator.py
@@ -30,8 +30,6 @@ import pyatspi
import orca.messages as messages
import orca.settings_manager as settings_manager
import orca.speech_generator as speech_generator
-from orca.orca_i18n import ngettext
-from orca.orca_i18n import _
from . import script_settings
@@ -210,13 +208,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
if role == pyatspi.ROLE_TOGGLE_BUTTON \
and obj.parent.getRole() == pyatspi.ROLE_TOOL_BAR:
if obj.getState().contains(pyatspi.STATE_CHECKED):
- # Translators: this represents the state of a check box
- #
- result.append(_("on"))
+ result.append(messages.ON)
else:
- # Translators: this represents the state of a check box
- #
- result.append(_("off"))
+ result.append(messages.OFF)
result.extend(acss)
elif role == pyatspi.ROLE_TOGGLE_BUTTON:
result.extend(speech_generator.SpeechGenerator._generateToggleState(
@@ -399,13 +393,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
tooLongCount += len(objectText) - i
break
if tooLongCount > 0:
- # Translators: people can enter a string of text that is
- # too wide for a spreadsheet cell. This string will be
- # spoken if such a cell is encountered.
- #
- result = [ngettext("%d character too long",
- "%d characters too long",
- tooLongCount) % tooLongCount]
+ result = [messages.charactersTooLong(tooLongCount)]
if result:
result.extend(acss)
return result
diff --git a/src/orca/scripts/apps/soffice/structural_navigation.py
b/src/orca/scripts/apps/soffice/structural_navigation.py
index b7dc80f..6af23b4 100644
--- a/src/orca/scripts/apps/soffice/structural_navigation.py
+++ b/src/orca/scripts/apps/soffice/structural_navigation.py
@@ -32,8 +32,6 @@ import orca.structural_navigation as structural_navigation
import orca.settings as settings
import orca.speech as speech
-from orca.orca_i18n import _
-
########################################################################
# #
# Custom Structural Navigation #
@@ -115,10 +113,7 @@ class StructuralNavigation(structural_navigation.StructuralNavigation):
if settings.speakCellCoordinates:
[row, col] = self.getCellCoordinates(cell)
- # Translators: this represents the (row, col) position of
- # a cell in a table.
- #
- self._script.presentMessage(_("Row %(row)d, column %(column)d.") \
+ self._script.presentMessage(messages.TABLE_CELL_COORDINATES \
% {"row" : row + 1, "column" : col + 1})
spanString = self._getCellSpanInfo(cell)
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 8f7f4b2..c14a040 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -42,6 +42,7 @@ import orca.debug as debug
import orca.eventsynthesizer as eventsynthesizer
import orca.find as find
import orca.flat_review as flat_review
+import orca.guilabels as guilabels
import orca.input_event as input_event
import orca.keybindings as keybindings
import orca.messages as messages
@@ -61,7 +62,6 @@ import orca.notification_messages as notification_messages
from orca.orca_i18n import _
from orca.orca_i18n import ngettext
-from orca.orca_i18n import C_
_settingsManager = settings_manager.getManager()
@@ -339,7 +339,7 @@ class Script(script.Script):
self.inputEventHandlers["panBrailleRightHandler"] = \
input_event.InputEventHandler(
Script.panBrailleRight,
- cmdnames.PAN_BRAILLE_LEFT,
+ cmdnames.PAN_BRAILLE_RIGHT,
False) # Do not enable learn mode for this action
self.inputEventHandlers["goBrailleHomeHandler"] = \
@@ -1039,13 +1039,7 @@ class Script(script.Script):
if not inputEvent or inputEvent.event_string == "1":
bound = self.getDefaultKeyBindings().getBoundBindings()
- # Translators: This message is presented when the user is in a list
- # of shortcuts associated with Orca commands which are not specific
- # to the current application. It appears as the title of the dialog
- # which contains the list.
- title = ngettext("%d Orca default shortcut found.",
- "%d Orca default shortcuts found.",
- len(bound)) % len(bound)
+ title = messages.shortcutsFoundOrca(len(bound))
else:
try:
appName = self.app.name
@@ -1054,14 +1048,7 @@ class Script(script.Script):
bound = self.getAppKeyBindings().getBoundBindings()
bound.extend(self.getToolkitKeyBindings().getBoundBindings())
- # Translators: This message is presented when the user is in a list
- # of shortcuts associated with Orca commands specific to the current
- # application. It appears at the title of the dialog which contains
- # the list.
- title = ngettext("%(count)d Orca shortcut for %(application)s found.",
- "%(count)d Orca shortcuts for %(application)s found.",
- len(bound)) % \
- {"count" : len(bound), "application" : appName}
+ title = messages.shortcutsFoundApp(len(bound), appName)
if not bound:
self.presentMessage(title)
@@ -1075,15 +1062,8 @@ class Script(script.Script):
kb.asString(True)) for kb in bound]
sorted(rows, key=lambda cmd: cmd[2])
- # Translators: Function is a table column header where the cells in the
- # column are a sentence that briefly describes what action Orca will
- # take if and when the user invokes that keyboard command.
- header1 = _("Function")
-
- # Translators: Key Binding is a table column header where the cells in the
- # column represent keyboard combinations the user can press to invoke Orca
- # commands.
- header2 = _("Key Binding")
+ header1 = guilabels.KB_HEADER_FUNCTION
+ header2 = guilabels.KB_HEADER_KEY_BINDING
commandlist.showUI(title, ("", header1, header2), rows, False)
return True
diff --git a/src/orca/scripts/toolkits/Gecko/bookmarks.py b/src/orca/scripts/toolkits/Gecko/bookmarks.py
index dc26a42..38bfe33 100644
--- a/src/orca/scripts/toolkits/Gecko/bookmarks.py
+++ b/src/orca/scripts/toolkits/Gecko/bookmarks.py
@@ -32,10 +32,9 @@ __license__ = "LGPL"
import pyatspi
import urllib.parse
-import orca.speech as speech
import orca.bookmarks as bookmarks
-
-from orca.orca_i18n import _
+import orca.messages as messages
+import orca.speech as speech
####################################################################
# #
@@ -57,9 +56,7 @@ class GeckoBookmarks(bookmarks.Bookmarks):
obj, characterOffset = self._script.getCaretContext()
path = self._objToPath()
self._bookmarks[index] = path, characterOffset
- # Translators: this announces that a bookmark has been entered
- #
- utterances = [(_('entered bookmark'))]
+ utterances = [(messages.BOOKMARK_ENTERED)]
utterances.extend(self._script.speechGenerator.generateSpeech(obj))
speech.speak(utterances)
@@ -101,18 +98,11 @@ class GeckoBookmarks(bookmarks.Bookmarks):
# Are they the same object?
if self._script.utilities.isSameObject(cur_obj, obj):
- # Translators: this announces that the current object is the same
- # object pointed to by the bookmark.
- #
- self._script.presentMessage(_('bookmark is current object'))
+ self._script.presentMessage(messages.BOOKMARK_IS_CURRENT_OBJECT)
return
# Are their parents the same?
elif self._script.utilities.isSameObject(cur_obj.parent, obj.parent):
- # Translators: this announces that the current object's parent and
- # the parent of the object pointed to by the bookmark are the same.
- #
- self._script.presentMessage(
- _('bookmark and current object have same parent'))
+ self._script.presentMessage(messages.BOOKMARK_PARENT_IS_SAME)
return
# Do they share a common ancestor?
@@ -127,17 +117,12 @@ class GeckoBookmarks(bookmarks.Bookmarks):
while p:
if bookmark_ancestors.count(p) > 0:
rolename = p.getLocalizedRoleName()
- # Translators: this announces that the bookmark and the current
- # object share a common ancestor
- #
- self._script.presentMessage(_('shared ancestor %s') % rolename)
+ self._script.presentMessage(
+ messages.BOOKMARK_SHARED_ANCESTOR % rolename)
return
p = p.parent
-
- # Translators: This announces that a comparison between the bookmark
- # and the current object can not be determined.
- #
- self._script.presentMessage(_('comparison unknown'))
+
+ self._script.presentMessage(messages.BOOKMARK_COMPARISON_UNKNOWN)
def saveBookmarks(self, inputEvent):
""" Save the bookmarks for this script. """
@@ -149,15 +134,9 @@ class GeckoBookmarks(bookmarks.Bookmarks):
try:
self.saveBookmarksToDisk(saved)
- # Translators: this announces that a bookmark has been saved to
- # disk
- #
- self._script.presentMessage(_('bookmarks saved'))
+ self._script.presentMessage(messages.BOOKMARKS_SAVED)
except IOError:
- # Translators: this announces that a bookmark could not be saved to
- # disk
- #
- self._script.presentMessage(_('bookmarks could not be saved'))
+ self._script.presentMessage(messages.BOOKMARKS_SAVED_FAILURE)
# Notify the observers
for o in self._saveObservers:
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 2c2c6d9..16760c4 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -47,13 +47,16 @@ import time
import urllib.parse
import orca.braille as braille
+import orca.cmdnames as cmdnames
import orca.debug as debug
import orca.scripts.default as default
import orca.eventsynthesizer as eventsynthesizer
+import orca.guilabels as guilabels
import orca.input_event as input_event
import orca.keybindings as keybindings
import orca.liveregions as liveregions
import orca.messages as messages
+import orca.object_properties as object_properties
import orca.orca as orca
import orca.orca_state as orca_state
import orca.settings as settings
@@ -379,238 +382,114 @@ class Script(default.Script):
self.inputEventHandlers["goNextCharacterHandler"] = \
input_event.InputEventHandler(
Script.goNextCharacter,
- # Translators: this is for navigating HTML content one
- # character at a time.
- #
- _("Goes to next character."))
+ cmdnames.CARET_NAVIGATION_NEXT_CHAR)
self.inputEventHandlers["goPreviousCharacterHandler"] = \
input_event.InputEventHandler(
Script.goPreviousCharacter,
- # Translators: this is for navigating HTML content one
- # character at a time.
- #
- _( "Goes to previous character."))
+ cmdnames.CARET_NAVIGATION_PREV_CHAR)
self.inputEventHandlers["goNextWordHandler"] = \
input_event.InputEventHandler(
Script.goNextWord,
- # Translators: this is for navigating HTML content one
- # word at a time.
- #
- _("Goes to next word."))
+ cmdnames.CARET_NAVIGATION_NEXT_WORD)
self.inputEventHandlers["goPreviousWordHandler"] = \
input_event.InputEventHandler(
Script.goPreviousWord,
- # Translators: this is for navigating HTML content one
- # word at a time.
- #
- _("Goes to previous word."))
+ cmdnames.CARET_NAVIGATION_PREV_WORD)
self.inputEventHandlers["goNextLineHandler"] = \
input_event.InputEventHandler(
Script.goNextLine,
- # Translators: this is for navigating HTML content one
- # line at a time.
- #
- _("Goes to next line."))
+ cmdnames.CARET_NAVIGATION_NEXT_LINE)
self.inputEventHandlers["goPreviousLineHandler"] = \
input_event.InputEventHandler(
Script.goPreviousLine,
- # Translators: this is for navigating HTML content one
- # line at a time.
- #
- _("Goes to previous line."))
+ cmdnames.CARET_NAVIGATION_PREV_LINE)
self.inputEventHandlers["goTopOfFileHandler"] = \
input_event.InputEventHandler(
Script.goTopOfFile,
- # Translators: this command will move the user to the
- # beginning of an HTML document.
- #
- _("Goes to the top of the file."))
+ cmdnames.CARET_NAVIGATION_FILE_START)
self.inputEventHandlers["goBottomOfFileHandler"] = \
input_event.InputEventHandler(
Script.goBottomOfFile,
- # Translators: this command will move the user to the
- # end of an HTML document.
- #
- _("Goes to the bottom of the file."))
+ cmdnames.CARET_NAVIGATION_FILE_END)
self.inputEventHandlers["goBeginningOfLineHandler"] = \
input_event.InputEventHandler(
Script.goBeginningOfLine,
- # Translators: this command will move the user to the
- # beginning of the line in an HTML document.
- #
- _("Goes to the beginning of the line."))
+ cmdnames.CARET_NAVIGATION_LINE_START)
self.inputEventHandlers["goEndOfLineHandler"] = \
input_event.InputEventHandler(
Script.goEndOfLine,
- # Translators: this command will move the user to the
- # end of the line in an HTML document.
- #
- _("Goes to the end of the line."))
+ cmdnames.CARET_NAVIGATION_LINE_END)
self.inputEventHandlers["expandComboBoxHandler"] = \
input_event.InputEventHandler(
Script.expandComboBox,
- # Translators: this is for causing a collapsed combo box
- # which was reached by Orca's caret navigation to be expanded.
- #
- _("Causes the current combo box to be expanded."))
+ cmdnames.CARET_NAVIGATION_EXPAND_COMBO_BOX)
self.inputEventHandlers["advanceLivePoliteness"] = \
input_event.InputEventHandler(
Script.advanceLivePoliteness,
- # Translators: this string refers to an Orca command which
- # advances the live region "politeness" setting from one
- # level to the next.
- #
- # The term "live region" refers to dynamically updated
- # content, typically on a web page, about which a user
- # likely wants to be notified. For instance, a stock
- # ticker on a financial site or a table of updated scores
- # on a sports site. In contast, a countdown timer or clock
- # on a web site is NOT a live region.
- #
- # The "politeness" level is an indication of when the user
- # wishes to be notified about a change to live region content,
- # e.g. never ("off"), when idle ("polite"), or when there is
- # a change ("assertive").
- #
- _("Advance live region politeness setting."))
+ cmdnames.LIVE_REGIONS_ADVANCE_POLITENESS)
self.inputEventHandlers["setLivePolitenessOff"] = \
input_event.InputEventHandler(
Script.setLivePolitenessOff,
- # Translators: this string refers to an Orca command which
- # turns changes the live region "politness" level to "off."
- #
- # The term "live region" refers to dynamically updated
- # content, typically on a web page, about which a user
- # likely wants to be notified. For instance, a stock
- # ticker on a financial site or a table of updated scores
- # on a sports site. In contast, a countdown timer or clock
- # on a web site is NOT a live region.
- #
- # The "politeness" level is an indication of when the user
- # wishes to be notified about a change to live region content,
- # e.g. never ("off"), when idle ("polite"), or when there is
- # a change ("assertive").
- #
- _("Set default live region politeness level to off."))
+ cmdnames.LIVE_REGIONS_SET_POLITENESS_OFF)
self.inputEventHandlers["monitorLiveRegions"] = \
input_event.InputEventHandler(
Script.monitorLiveRegions,
- # Translators: this string refers to an Orca command which
- # allows the user to toggle whether or not Orca pays attention
- # to changes in live regions. Note that turning off monitoring
- # of live events is NOT the same as turning the politeness level
- # to "off". The user can opt to have no notifications presented
- # (politeness level of "off") and still manually review recent
- # updates to live regions via Orca commands for doing so -- as
- # long as the monitoring of live regions is enabled.
- #
- _("Monitor live regions."))
+ cmdnames.LIVE_REGIONS_MONITOR)
self.inputEventHandlers["reviewLiveAnnouncement"] = \
input_event.InputEventHandler(
Script.reviewLiveAnnouncement,
- # Translators: this is for reviewing up to nine stored
- # previous live messages. Please see previous translator
- # notes for more information on live regions.
- #
- _("Review live region announcement."))
+ cmdnames.LIVE_REGIONS_REVIEW)
self.inputEventHandlers["goPreviousObjectInOrderHandler"] = \
input_event.InputEventHandler(
Script.goPreviousObjectInOrder,
- # Translators: this is for navigating between objects
- # (regardless of type) in HTML
- #
- _("Goes to the previous object."))
+ cmdnames.CARET_NAVIGATION_PREV_OBJECT)
self.inputEventHandlers["goNextObjectInOrderHandler"] = \
input_event.InputEventHandler(
Script.goNextObjectInOrder,
- # Translators: this is for navigating between objects
- # (regardless of type) in HTML
- #
- _("Goes to the next object."))
+ cmdnames.CARET_NAVIGATION_NEXT_OBJECT)
self.inputEventHandlers["toggleCaretNavigationHandler"] = \
input_event.InputEventHandler(
Script.toggleCaretNavigation,
- # Translators: Gecko native caret navigation is where
- # Firefox itself controls how the arrow keys move the caret
- # around HTML content. It's often broken, so Orca needs
- # to provide its own support. As such, Orca offers the user
- # the ability to switch between the Firefox mode and the
- # Orca mode.
- #
- _("Switches between Gecko native and Orca caret navigation."))
+ cmdnames.CARET_NAVIGATION_TOGGLE)
self.inputEventHandlers["sayAllHandler"] = \
input_event.InputEventHandler(
Script.sayAll,
- # Translators: the Orca "SayAll" command allows the
- # user to press a key and have the entire document in
- # a window be automatically spoken to the user. If
- # the user presses any key during a SayAll operation,
- # the speech will be interrupted and the cursor will
- # be positioned at the point where the speech was
- # interrupted.
- #
- _("Speaks entire document."))
+ cmdnames.SAY_ALL)
self.inputEventHandlers["panBrailleLeftHandler"] = \
input_event.InputEventHandler(
Script.panBrailleLeft,
- # Translators: a refreshable braille display is an
- # external hardware device that presents braille
- # character to the user. There are a limited number
- # of cells on the display (typically 40 cells). Orca
- # provides the feature to build up a longer logical
- # line and allow the user to press buttons on the
- # braille display so they can pan left and right over
- # this line.
- #
- _("Pans the braille display to the left."),
+ cmdnames.PAN_BRAILLE_LEFT,
False) # Do not enable learn mode for this action
self.inputEventHandlers["panBrailleRightHandler"] = \
input_event.InputEventHandler(
Script.panBrailleRight,
- # Translators: a refreshable braille display is an
- # external hardware device that presents braille
- # character to the user. There are a limited number
- # of cells on the display (typically 40 cells). Orca
- # provides the feature to build up a longer logical
- # line and allow the user to press buttons on the
- # braille display so they can pan left and right over
- # this line.
- #
- _("Pans the braille display to the right."),
+ cmdnames.PAN_BRAILLE_RIGHT,
False) # Do not enable learn mode for this action
self.inputEventHandlers["moveToMouseOverHandler"] = \
input_event.InputEventHandler(
Script.moveToMouseOver,
- # Translators: hovering the mouse over certain objects
- # on a web page causes a new object to appear such as
- # a pop-up menu. This command will move the user to the
- # object which just appeared as a result of the user
- # hovering the mouse. If the user is already in the
- # mouse over object, this command will hide the mouse
- # over and return the user to the object he/she was in.
- #
- _("Moves focus into and away from the current mouse over."))
+ cmdnames.MOUSE_OVER_MOVE)
def getListeners(self):
"""Sets up the AT-SPI event listeners for this script.
@@ -682,11 +561,7 @@ class Script(default.Script):
generalFrame = Gtk.Frame()
grid.attach(generalFrame, 0, 0, 1, 1)
- # Translators: this is the title of a panel holding options for
- # how to navigate HTML content (e.g., Orca caret navigation,
- # positioning of caret, etc.).
- #
- label = Gtk.Label(label="<b>%s</b>" % _("Page Navigation"))
+ label = Gtk.Label(label="<b>%s</b>" % guilabels.PAGE_NAVIGATION)
label.set_use_markup(True)
generalFrame.set_label_widget(label)
@@ -696,67 +571,35 @@ class Script(default.Script):
generalGrid = Gtk.Grid()
generalAlignment.add(generalGrid)
- # Translators: Gecko native caret navigation is where
- # Firefox itself controls how the arrow keys move the caret
- # around HTML content. It's often broken, so Orca needs
- # to provide its own support. As such, Orca offers the user
- # the ability to switch between the Firefox mode and the
- # Orca mode.
- #
- label = _("Use _Orca Caret Navigation")
+ label = guilabels.USE_CARET_NAVIGATION
value = script_settings.controlCaretNavigation
self.controlCaretNavigationCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.controlCaretNavigationCheckButton.set_active(value)
generalGrid.attach(self.controlCaretNavigationCheckButton, 0, 0, 1, 1)
- # Translators: Orca provides keystrokes to navigate HTML content
- # in a structural manner: go to previous/next header, list item,
- # table, etc.
- #
- label = _("Use Orca _Structural Navigation")
+ label = guilabels.USE_STRUCTURAL_NAVIGATION
value = self.structuralNavigation.enabled
self.structuralNavigationCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.structuralNavigationCheckButton.set_active(value)
generalGrid.attach(self.structuralNavigationCheckButton, 0, 1, 1, 1)
- # Translators: Orca has had to implement its own caret navigation
- # model to work around issues in Gecko/Firefox. In certain versions
- # of Firefox, we must perform a focus grab on each object being
- # navigated in order for things to work as expected; in other
- # versions of Firefox, we must avoid doing so in order for things
- # to work as expected. We cannot identify with certainty which
- # situation the user is in, so we must provide this as an option
- # within Orca.
- #
- label = _("_Grab focus on objects when navigating")
+ label = guilabels.CARET_NAVIGATION_GRAB_FOCUS
value = script_settings.grabFocusOnAncestor
self.grabFocusOnAncestorCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.grabFocusOnAncestorCheckButton.set_active(value)
generalGrid.attach(self.grabFocusOnAncestorCheckButton, 0, 2, 1, 1)
- # Translators: when the user arrows up and down in HTML content,
- # it is some times beneficial to always position the cursor at the
- # beginning of the line rather than guessing the position directly
- # above the current cursor position. This option allows the user
- # to decide the behavior they want.
- #
- label = \
- _("_Position cursor at start of line when navigating vertically")
+ label = guilabels.CARET_NAVIGATION_START_OF_LINE
value = script_settings.arrowToLineBeginning
self.arrowToLineBeginningCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.arrowToLineBeginningCheckButton.set_active(value)
generalGrid.attach(self.arrowToLineBeginningCheckButton, 0, 3, 1, 1)
- # Translators: when the user loads a new page in Firefox, they
- # can optionally tell Orca to automatically start reading a
- # page from beginning to end.
- #
- label = \
- _("Automatically start speaking a page when it is first _loaded")
+ label = guilabels.READ_PAGE_UPON_LOAD
value = script_settings.sayAllOnLoad
self.sayAllOnLoadCheckButton = Gtk.CheckButton.new_with_mnemonic(label)
self.sayAllOnLoadCheckButton.set_active(value)
@@ -765,10 +608,7 @@ class Script(default.Script):
tableFrame = Gtk.Frame()
grid.attach(tableFrame, 0, 1, 1, 1)
- # Translators: this is the title of a panel containing options
- # for specifying how to navigate tables in document content.
- #
- label = Gtk.Label(label="<b>%s</b>" % _("Table Navigation"))
+ label = Gtk.Label(label="<b>%s</b>" % guilabels.TABLE_NAVIGATION)
label.set_use_markup(True)
tableFrame.set_label_widget(label)
@@ -778,41 +618,28 @@ class Script(default.Script):
tableGrid = Gtk.Grid()
tableAlignment.add(tableGrid)
- # Translators: this is an option to tell Orca whether or not it
- # should speak table cell coordinates in document content.
- #
- label = _("Speak _cell coordinates")
+ label = guilabels.TABLE_SPEAK_CELL_COORDINATES
value = _settingsManager.getSetting('speakCellCoordinates')
self.speakCellCoordinatesCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakCellCoordinatesCheckButton.set_active(value)
tableGrid.attach(self.speakCellCoordinatesCheckButton, 0, 0, 1, 1)
- # Translators: this is an option to tell Orca whether or not it
- # should speak the span size of a table cell (e.g., how many
- # rows and columns a particular table cell spans in a table).
- #
- label = _("Speak _multiple cell spans")
+ label = guilabels.TABLE_SPEAK_CELL_SPANS
value = _settingsManager.getSetting('speakCellSpan')
self.speakCellSpanCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakCellSpanCheckButton.set_active(value)
tableGrid.attach(self.speakCellSpanCheckButton, 0, 1, 1, 1)
- # Translators: this is an option for whether or not to speak
- # the header of a table cell in document content.
- #
- label = _("Announce cell _header")
+ label = guilabels.TABLE_ANNOUNCE_CELL_HEADER
value = _settingsManager.getSetting('speakCellHeaders')
self.speakCellHeadersCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakCellHeadersCheckButton.set_active(value)
tableGrid.attach(self.speakCellHeadersCheckButton, 0, 2, 1, 1)
- # Translators: this is an option to allow users to skip over
- # empty/blank cells when navigating tables in document content.
- #
- label = _("Skip _blank cells")
+ label = guilabels.TABLE_SKIP_BLANK_CELLS
value = _settingsManager.getSetting('skipBlankCells')
self.skipBlankCellsCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
@@ -822,10 +649,7 @@ class Script(default.Script):
findFrame = Gtk.Frame()
grid.attach(findFrame, 0, 2, 1, 1)
- # Translators: this is the title of a panel containing options
- # for using Firefox's Find toolbar.
- #
- label = Gtk.Label(label="<b>%s</b>" % _("Find Options"))
+ label = Gtk.Label(label="<b>%s</b>" % guilabels.FIND_OPTIONS)
label.set_use_markup(True)
findFrame.set_label_widget(label)
@@ -835,23 +659,14 @@ class Script(default.Script):
findGrid = Gtk.Grid()
findAlignment.add(findGrid)
- # Translators: this is an option to allow users to have Orca
- # automatically speak the line that contains the match while
- # the user is still in Firefox's Find toolbar.
- #
- label = _("Speak results during _find")
+ label = guilabels.FIND_SPEAK_RESULTS
value = script_settings.speakResultsDuringFind
self.speakResultsDuringFindCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.speakResultsDuringFindCheckButton.set_active(value)
findGrid.attach(self.speakResultsDuringFindCheckButton, 0, 0, 1, 1)
- # Translators: this is an option which dictates whether the line
- # that contains the match from the Find toolbar should always
- # be spoken, or only spoken if it is a different line than the
- # line which contained the last match.
- #
- label = _("Onl_y speak changed lines during find")
+ label = guilabels.FIND_ONLY_SPEAK_CHANGED_LINES
value = script_settings.onlySpeakChangedLinesDuringFind
self.changedLinesOnlyCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
@@ -861,12 +676,8 @@ class Script(default.Script):
hgrid = Gtk.Grid()
findGrid.attach(hgrid, 0, 2, 1, 1)
- # Translators: this option allows the user to specify the number
- # of matched characters that must be present before Orca speaks
- # the line that contains the results from the Find toolbar.
- #
self.minimumFindLengthLabel = \
- Gtk.Label(label=_("Minimum length of matched text:"))
+ Gtk.Label(label=guilabels.FIND_MINIMUM_MATCH_LENGTH)
self.minimumFindLengthLabel.set_alignment(0, 0.5)
hgrid.attach(self.minimumFindLengthLabel, 0, 0, 1, 1)
@@ -1377,16 +1188,10 @@ class Script(default.Script):
default.Script.onTextInserted(self, event)
def _getCtrlShiftSelectionsStrings(self):
- return [
- # Translators: when the user selects (highlights) text in
- # a document, Orca will speak information about what they
- # have selected.
- #
- _("line selected down from cursor position"),
- _("line unselected down from cursor position"),
- _("line selected up from cursor position"),
- _("line unselected up from cursor position"),
- ]
+ return [messages.LINE_SELECTED_DOWN,
+ messages.LINE_UNSELECTED_DOWN,
+ messages.LINE_SELECTED_UP,
+ messages.LINE_UNSELECTED_UP]
def onTextSelectionChanged(self, event):
"""Called when an object's text selection changes.
@@ -1443,12 +1248,7 @@ class Script(default.Script):
and 0 < time.time() - self.lastMouseRoutingTime < 1 \
and event.type.startswith("object:children-changed:add"):
utterances = []
- # Translators: Orca has a command that moves the mouse
- # pointer to the current location on a web page. If
- # moving the mouse pointer caused an item to appear
- # such as a pop-up menu, we want to present that fact.
- #
- utterances.append(_("New item has been added"))
+ utterances.append(messages.NEW_ITEM_ADDED)
utterances.extend(
self.speechGenerator.generateSpeech(event.any_data,
force = True))
@@ -1731,27 +1531,15 @@ class Script(default.Script):
return
elif event.detail1:
- # A detail1=1 means the page has started loading.
- #
self._loadingDocumentContent = True
-
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- message = _("Loading. Please wait.")
+ message = messages.PAGE_LOADING_START
elif event.source.name:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- message = _("Finished loading %s.") % event.source.name
+ message = messages.PAGE_LOADING_END_NAMED % event.source.name
finishedLoading = True
else:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- message = _("Finished loading.")
+ message = messages.PAGE_LOADING_END
finishedLoading = True
if not _settingsManager.getSetting('onlySpeakDisplayedText'):
@@ -2195,14 +1983,8 @@ class Script(default.Script):
if heading:
level = self.getHeadingLevel(heading)
- # Translators: the 'h' below 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
- # heading level, where the single character is to indicate
- # 'heading'.
- #
- headingString = _("h%d" % level)
+ headingString = \
+ object_properties.ROLE_HEADING_LEVEL_BRAILLE % level
if not string.endswith(" "):
headingString = " " + headingString
if not isLastObject:
@@ -4552,13 +4334,7 @@ class Script(default.Script):
"""
if not self.lastMouseOverObject:
- # Translators: hovering the mouse over certain objects on a
- # web page causes a new object to appear such as a pop-up
- # menu. Orca has a command will move the user to the object
- # which just appeared as a result of the user hovering the
- # mouse. If this command fails, Orca will present this message.
- #
- self.presentMessage(_("Mouse over object not found."))
+ self.presentMessage(messages.MOUSE_OVER_NOT_FOUND)
return
if not self.inMouseOverObject:
@@ -5098,13 +4874,7 @@ class Script(default.Script):
break
if not found:
- # Translators: when the user is attempting to locate a
- # particular object and the top of the page or list is
- # reached without that object being found, we "wrap" to
- # the bottom and continue looking upwards. We need to
- # inform the user when this is taking place.
- #
- self.presentMessage(_("Wrapping to bottom."))
+ self.presentMessage(messages.WRAPPING_TO_BOTTOM)
[prevObj, prevOffset] = self.getBottomOfFile()
line = self.getLineContentsAtOffset(prevObj, prevOffset)
useful = self.getMeaningfulObjectsFromLine(line)
@@ -5166,13 +4936,7 @@ class Script(default.Script):
break
if not found:
- # Translators: when the user is attempting to locate a
- # particular object and the bottom of the page or list is
- # reached without that object being found, we "wrap" to the
- # top and continue looking downwards. We need to inform the
- # user when this is taking place.
- #
- self.presentMessage(_("Wrapping to top."))
+ self.presentMessage(messages.WRAPPING_TO_TOP)
[nextObj, nextOffset] = self.getTopOfFile()
line = self.getLineContentsAtOffset(nextObj, nextOffset)
useful = self.getMeaningfulObjectsFromLine(line)
@@ -5195,44 +4959,29 @@ class Script(default.Script):
if _settingsManager.getSetting('inferLiveRegions'):
self.liveMngr.advancePoliteness(orca_state.locusOfFocus)
else:
- # Translators: this announces to the user that live region
- # support has been turned off.
- #
- self.presentMessage(_("Live region support is off"))
+ self.presentMessage(messages.LIVE_REGIONS_OFF)
def monitorLiveRegions(self, inputEvent):
if not _settingsManager.getSetting('inferLiveRegions'):
_settingsManager.setSetting('inferLiveRegions', True)
- # Translators: this announces to the user that live region
- # are being monitored.
- #
- self.presentMessage(_("Live regions monitoring on"))
+ self.presentMessage(messages.LIVE_REGIONS_MONITORING_ON)
else:
_settingsManager.setSetting('inferLiveRegions', False)
- # Translators: this announces to the user that live region
- # are not being monitored.
- #
self.liveMngr.flushMessages()
- self.presentMessage(_("Live regions monitoring off"))
+ self.presentMessage(messages.LIVE_REGIONS_MONITORING_OFF)
def setLivePolitenessOff(self, inputEvent):
if _settingsManager.getSetting('inferLiveRegions'):
self.liveMngr.setLivePolitenessOff()
else:
- # Translators: this announces to the user that live region
- # support has been turned off.
- #
- self.presentMessage(_("Live region support is off"))
+ self.presentMessage(messages.LIVE_REGIONS_OFF)
def reviewLiveAnnouncement(self, inputEvent):
if _settingsManager.getSetting('inferLiveRegions'):
self.liveMngr.reviewLiveAnnouncement( \
int(inputEvent.event_string[1:]))
else:
- # Translators: this announces to the user that live region
- # support has been turned off.
- #
- self.presentMessage(_("Live region support is off"))
+ self.presentMessage(messages.LIVE_REGIONS_OFF)
def toggleCaretNavigation(self, inputEvent):
"""Toggles between Firefox native and Orca caret navigation."""
@@ -5241,26 +4990,12 @@ class Script(default.Script):
for keyBinding in self.__getArrowBindings().keyBindings:
self.keyBindings.removeByHandler(keyBinding.handler)
script_settings.controlCaretNavigation = False
- # Translators: Gecko native caret navigation is where
- # Firefox itself controls how the arrow keys move the caret
- # around HTML content. It's often broken, so Orca needs
- # to provide its own support. As such, Orca offers the user
- # the ability to switch between the Firefox mode and the
- # Orca mode.
- #
- string = _("Gecko is controlling the caret.")
+ string = messages.CARET_CONTROL_GECKO
else:
script_settings.controlCaretNavigation = True
for keyBinding in self.__getArrowBindings().keyBindings:
self.keyBindings.add(keyBinding)
- # Translators: Gecko native caret navigation is where
- # Firefox itself controls how the arrow keys move the caret
- # around HTML content. It's often broken, so Orca needs
- # to provide its own support. As such, Orca offers the user
- # the ability to switch between the Firefox mode and the
- # Orca mode.
- #
- string = _("Orca is controlling the caret.")
+ string = messages.CARET_CONTROL_ORCA
debug.println(debug.LEVEL_CONFIGURATION, string)
self.presentMessage(string)
diff --git a/src/orca/scripts/toolkits/Gecko/speech_generator.py
b/src/orca/scripts/toolkits/Gecko/speech_generator.py
index cac8dc0..6d2a792 100644
--- a/src/orca/scripts/toolkits/Gecko/speech_generator.py
+++ b/src/orca/scripts/toolkits/Gecko/speech_generator.py
@@ -32,10 +32,10 @@ __license__ = "LGPL"
import pyatspi
+import orca.messages as messages
+import orca.object_properties as object_properties
import orca.settings_manager as settings_manager
import orca.speech_generator as speech_generator
-from orca.orca_i18n import _
-from orca.orca_i18n import ngettext
_settingsManager = settings_manager.getManager()
@@ -126,14 +126,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
if args.get('role', obj.getRole()) == pyatspi.ROLE_LINK \
and obj.parent.getRole() == pyatspi.ROLE_IMAGE:
result = self._generateName(obj, **args)
- # Translators: The following string is spoken to let the user
- # know that he/she is on a link within an image map. An image
- # map is an image/graphic which has been divided into regions.
- # Each region can be clicked on and has an associated link.
- # Please see http://en.wikipedia.org/wiki/Imagemap for more
- # information and examples.
- #
- result.append(_("image map link"))
+ result.append(messages.IMAGE_MAP_LINK)
else:
result = speech_generator.SpeechGenerator.\
_generateDescription(self, obj, **args)
@@ -253,12 +246,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
if role == pyatspi.ROLE_HEADING:
level = self._script.getHeadingLevel(obj)
if level:
- # Translators: the %(level)d is in reference to a heading
- # level in HTML (e.g., For <h3>, the level is 3)
- # and the %(role)s is in reference to a previously
- # translated rolename for the heading.
- #
- result.append(_("%(role)s level %(level)d") % {
+ result.append(object_properties.ROLE_HEADING_LEVEL_SPEECH % {
'role': self.getLocalizedRoleName(obj, role),
'level': level})
else:
@@ -296,11 +284,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
acss = self.voice(speech_generator.SYSTEM)
role = args.get('role', obj.getRole())
if role == pyatspi.ROLE_LIST:
- # Translators: this represents a list in HTML.
- #
- result.append(ngettext("List with %d item",
- "List with %d items",
- obj.childCount) % obj.childCount)
+ result.append(messages.listItemCount(obj.childCount))
result.extend(acss)
else:
result.extend(
@@ -467,43 +451,17 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
headings, forms, tables, vlinks, uvlinks, percent = \
self._script.getPageSummary(obj)
if headings:
- # Translators: Announces the number of headings in the
- # web page that is currently being displayed.
- #
- result.append(ngettext \
- ('%d heading', '%d headings', headings) % headings)
+ result.append(messages.headingCount(headings))
if forms:
- # Translators: Announces the number of forms in the
- # web page that is currently being displayed.
- #
- result.append(ngettext('%d form', '%d forms', forms) % forms)
+ result.append(messages.formCount(forms))
if tables:
- # Translators: Announces the number of non-layout tables in the
- # web page that is currently being displayed.
- #
- result.append(ngettext('%d table', '%d tables', tables) % tables)
+ result.append(messages.tableCount(tables))
if vlinks:
- # Translators: Announces the number of visited links in the
- # web page that is currently being displayed.
- #
- result.append(ngettext \
- ('%d visited link', '%d visited links', vlinks) % vlinks)
+ result.append(messages.visitedLinkCount(vlinks))
if uvlinks:
- # Translators: Announces the number of unvisited links in the
- # web page that is currently being displayed.
- #
- result.append(ngettext \
- ('%d unvisited link', '%d unvisited links', uvlinks) % uvlinks)
+ result.append(messages.unvisitedLinkCount(uvlinks))
if percent is not None:
- # Translators: Announces the percentage of the document that has
- # been read. This is calculated by knowing the index of the
- # current position divided by the total number of objects on the
- # page.
- #
- result.append(ngettext \
- ('%d percent of document read',
- '%d percent of document read',
- percent) % percent)
+ result.append(messages.percentRead(percent))
if result:
result.extend(acss)
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
index fafaa5d..926d5ac 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
@@ -27,9 +27,9 @@ __license__ = "LGPL"
import pyatspi
+import orca.messages as messages
import orca.settings_manager as settings_manager
import orca.speech_generator as speech_generator
-from orca.orca_i18n import ngettext
_settingsManager = settings_manager.getManager()
@@ -92,12 +92,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
acss = self.voice(speech_generator.SYSTEM)
if obj and obj.getState().contains(pyatspi.STATE_EXPANDED) \
and obj.getRole() == pyatspi.ROLE_LABEL and obj.childCount:
- children = obj.childCount
- # Translators: this is the number of items in a layered
- # pane or table.
- #
- items = ngettext("%d item", "%d items", children) % children
- result.append(items)
+ result.append(messages.itemCount(obj.childCount))
result.extend(acss)
else:
result.extend(speech_generator.SpeechGenerator.\
diff --git a/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
b/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
index 69b6eb2..0c63386 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
@@ -29,10 +29,9 @@ __license__ = "LGPL"
import pyatspi
+import orca.object_properties as object_properties
import orca.braille_generator as braille_generator
-from orca.orca_i18n import _
-
########################################################################
# #
# Custom BrailleGenerator #
@@ -48,14 +47,7 @@ class BrailleGenerator(braille_generator.BrailleGenerator):
def __generateHeadingRole(self, obj):
result = []
level = self._script.utilities.headingLevel(obj)
- # Translators: the 'h' below 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
- # heading level, where the single character is to indicate
- # 'heading'.
- #
- result.append(_("h%d" % level))
+ result.append(object_properties.ROLE_HEADING_LEVEL_BRAILLE % level)
return result
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index 877a89f..0ec8d09 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -31,14 +31,16 @@ import pyatspi
import pyatspi.utils as utils
import orca.scripts.default as default
+import orca.cmdnames as cmdnames
+import orca.guilabels as guilabels
import orca.input_event as input_event
+import orca.messages as messages
import orca.orca as orca
import orca.settings as settings
import orca.settings_manager as settings_manager
import orca.speechserver as speechserver
import orca.orca_state as orca_state
import orca.speech as speech
-from orca.orca_i18n import _
from . import script_settings
from .structural_navigation import StructuralNavigation
@@ -98,44 +100,18 @@ class Script(default.Script):
self.inputEventHandlers["sayAllHandler"] = \
input_event.InputEventHandler(
Script.sayAll,
- # Translators: the Orca "SayAll" command allows the
- # user to press a key and have the entire document in
- # a window be automatically spoken to the user. If
- # the user presses any key during a SayAll operation,
- # the speech will be interrupted and the cursor will
- # be positioned at the point where the speech was
- # interrupted.
- #
- _("Speaks entire document."))
+ cmdnames.SAY_ALL)
self.inputEventHandlers["panBrailleLeftHandler"] = \
input_event.InputEventHandler(
Script.panBrailleLeft,
- # Translators: a refreshable braille display is an
- # external hardware device that presents braille
- # character to the user. There are a limited number
- # of cells on the display (typically 40 cells). Orca
- # provides the feature to build up a longer logical
- # line and allow the user to press buttons on the
- # braille display so they can pan left and right over
- # this line.
- #
- _("Pans the braille display to the left."),
+ cmdnames.PAN_BRAILLE_LEFT,
False) # Do not enable learn mode for this action
self.inputEventHandlers["panBrailleRightHandler"] = \
input_event.InputEventHandler(
Script.panBrailleRight,
- # Translators: a refreshable braille display is an
- # external hardware device that presents braille
- # character to the user. There are a limited number
- # of cells on the display (typically 40 cells). Orca
- # provides the feature to build up a longer logical
- # line and allow the user to press buttons on the
- # braille display so they can pan left and right over
- # this line.
- #
- _("Pans the braille display to the right."),
+ cmdnames.PAN_BRAILLE_RIGHT,
False) # Do not enable learn mode for this action
def getToolkitKeyBindings(self):
@@ -152,12 +128,7 @@ class Script(default.Script):
grid = Gtk.Grid()
grid.set_border_width(12)
- # Translators: when the user loads a new page in WebKit, they
- # can optionally tell Orca to automatically start reading a
- # page from beginning to end.
- #
- label = \
- _("Automatically start speaking a page when it is first _loaded")
+ label = guilabels.READ_PAGE_UPON_LOAD
self.sayAllOnLoadCheckButton = \
Gtk.CheckButton.new_with_mnemonic(label)
self.sayAllOnLoadCheckButton.set_active(script_settings.sayAllOnLoad)
@@ -339,20 +310,12 @@ class Script(default.Script):
return
if event.detail1:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- self.presentMessage(_("Loading. Please wait."))
+ self.presentMessage(messages.PAGE_LOADING_START)
elif event.source.name:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- self.presentMessage(_("Finished loading %s.") % event.source.name)
+ self.presentMessage(
+ messages.PAGE_LOADING_END_NAMED % event.source.name)
else:
- # Translators: this is in reference to loading a web page
- # or some other content.
- #
- self.presentMessage(_("Finished loading."))
+ self.presentMessage(messages.PAGE_LOADING_END)
def onTextSelectionChanged(self, event):
"""Called when an object's text selection changes.
diff --git a/src/orca/scripts/toolkits/WebKitGtk/speech_generator.py
b/src/orca/scripts/toolkits/WebKitGtk/speech_generator.py
index 4231ab7..7baf1a3 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/speech_generator.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/speech_generator.py
@@ -30,10 +30,10 @@ __license__ = "LGPL"
import pyatspi
import orca.keynames as keynames
+import orca.object_properties as object_properties
import orca.settings as settings
import orca.settings_manager as settings_manager
import orca.speech_generator as speech_generator
-from orca.orca_i18n import _
_settingsManager = settings_manager.getManager()
@@ -84,12 +84,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
role = pyatspi.ROLE_HEADING
level = self._script.utilities.headingLevel(obj)
if level:
- # Translators: the %(level)d is in reference to a heading
- # level in HTML (e.g., For <h3>, the level is 3)
- # and the %(role)s is in reference to a previously
- # translated rolename for the heading.
- #
- result.append(_("%(role)s level %(level)d") % {
+ result.append(object_properties.ROLE_HEADING_LEVEL_SPEECH % {
'role': self.getLocalizedRoleName(obj, role),
'level': level})
else:
diff --git a/src/orca/settings.py b/src/orca/settings.py
index c2ebac2..b798fe1 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -774,11 +774,6 @@ sounds = {}
# #
########################################################################
-# Translators: "blank" is a short word to mean the
-# user has navigated to an empty line.
-#
-speechBlankString = _("blank")
-
# 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
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index d271eb3..f3525d0 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -32,15 +32,12 @@ from gi.repository import Atspi, Atk
from . import debug
from . import generator
from . import messages
+from . import object_properties
from . import settings
from . import settings_manager
from . import sound
from . import text_attribute_names
-from .orca_i18n import _
-from .orca_i18n import ngettext
-from .orca_i18n import C_
-
class Pause:
"""A dummy class to indicate we want to insert a pause into an
utterance."""
@@ -477,18 +474,11 @@ class SpeechGenerator(generator.Generator):
link_uri_info = urllib.parse.urlparse(link_uri)
if link_uri_info[0] in ["ftp", "ftps", "file"]:
fileName = link_uri_info[2].split('/')
- # Translators: this refers to a link to a file, where
- # the first item is the protocol (ftp, ftps, or file)
- # and the second item the name of the file being linked
- # to.
- #
- result.append(_("%(uri)s link to %(file)s") \
+ result.append(messages.LINK_TO_FILE \
% {"uri" : link_uri_info[0],
"file" : fileName[-1]})
else:
- # Translators: this is the protocol of a link eg. http, mailto.
- #
- linkOutput = _("%s link") % link_uri_info[0]
+ linkOutput = messages.LINK_WITH_PROTOCOL % link_uri_info[0]
text = self._script.utilities.displayedText(obj)
if not text:
# If there's no text for the link, expose part of the
@@ -521,35 +511,21 @@ class SpeechGenerator(generator.Generator):
doc_uri_info = urllib.parse.urlparse(doc_uri)
if link_uri_info[1] == doc_uri_info[1]:
if link_uri_info[2] == doc_uri_info[2]:
- # Translators: this is an indication that a given
- # link points to an object that is on the same page.
- #
- result.append(_("same page"))
+ result.append(messages.LINK_SAME_PAGE)
else:
- # Translators: this is an indication that a given
- # link points to an object that is at the same site
- # (but not on the same page as the link).
- #
- result.append(_("same site"))
+ result.append(messages.LINK_SAME_SITE)
else:
# check for different machine name on same site
#
linkdomain = link_uri_info[1].split('.')
docdomain = doc_uri_info[1].split('.')
- if len(linkdomain) > 1 and docdomain > 1 \
+ if len(linkdomain) > 1 and len(docdomain) > 1 \
and linkdomain[-1] == docdomain[-1] \
and linkdomain[-2] == docdomain[-2]:
- # Translators: this is an indication that a given
- # link points to an object that is at the same site
- # (but not on the same page) as the link.
- #
- result.append(_("same site"))
+ result.append(messages.LINK_SAME_SITE)
else:
- # Translators: this is an indication that a given
- # link points to an object that is at a different
- # site than that of the link.
- #
- result.append(_("different site"))
+ result.append(messages.LINK_DIFFERENT_SITE)
+
if result:
result.extend(acss)
return result
@@ -577,17 +553,11 @@ class SpeechGenerator(generator.Generator):
if sizeString:
size = int(sizeString)
if size < 10000:
- # Translators: This is the size of a file in bytes
- #
- result.append(ngettext("%d byte", "%d bytes", size) % size)
+ result.append(messages.fileSizeBytes(size))
elif size < 1000000:
- # Translators: This is the size of a file in kilobytes
- #
- result.append(_("%.2f kilobytes") % (float(size) * .001))
+ result.append(messages.FILE_SIZE_KB % (float(size) * .001))
elif size >= 1000000:
- # Translators: This is the size of a file in megabytes
- #
- result.append(_("%.2f megabytes") % (float(size) * .000001))
+ result.append(messages.FILE_SIZE_MB % (float(size) * .000001))
if result:
result.extend(acss)
return result
@@ -783,10 +753,7 @@ class SpeechGenerator(generator.Generator):
if checkIfSelected \
and state and not state.contains(pyatspi.STATE_SELECTED):
- # Translators: this is in reference to a table cell being
- # selected or not.
- #
- result.append(C_("tablecell", "not selected"))
+ result.append(object_properties.STATE_UNSELECTED_TABLE_CELL)
result.extend(acss)
return result
@@ -813,9 +780,7 @@ class SpeechGenerator(generator.Generator):
index = self._script.utilities.cellIndex(obj)
col = table.getColumnAtIndex(index)
if col >= 0:
- # Translators: this is in references to a column in a
- # table.
- result.append(_("column %d") % (col + 1))
+ result.append(messages.TABLE_COLUMN % (col + 1))
if result:
result.extend(acss)
return result
@@ -842,9 +807,7 @@ class SpeechGenerator(generator.Generator):
index = self._script.utilities.cellIndex(obj)
row = table.getRowAtIndex(index)
if row >= 0:
- # Translators: this is in references to a row in a table.
- #
- result.append(_("row %d") % (row + 1))
+ result.append(messages.TABLE_ROW % (row + 1))
if result:
result.extend(acss)
return result
@@ -871,14 +834,10 @@ class SpeechGenerator(generator.Generator):
index = self._script.utilities.cellIndex(obj)
col = table.getColumnAtIndex(index)
row = table.getRowAtIndex(index)
- # Translators: this is in references to a column in a
- # table.
- result.append(_("column %(index)d of %(total)d") \
+ result.append(messages.TABLE_COLUMN_DETAILED \
% {"index" : (col + 1),
"total" : table.nColumns})
- # Translators: this is in reference to a row in a table.
- #
- result.append(_("row %(index)d of %(total)d") \
+ result.append(messages.TABLE_ROW_DETAILED \
% {"index" : (row + 1),
"total" : table.nRows})
if result:
@@ -911,10 +870,7 @@ class SpeechGenerator(generator.Generator):
row = table.getRowAtIndex(index)
col = table.getColumnAtIndex(index)
if row + 1 == table.nRows and col + 1 == table.nColumns:
- # Translators: This is to indicate to the user that
- # he/she is in the last cell of a table in a document.
- #
- result.append(_("End of table"))
+ result.append(messages.TABLE_END)
if result:
result.extend(acss)
return result
@@ -999,18 +955,13 @@ class SpeechGenerator(generator.Generator):
#
if key == "weight":
if int(attribute) > 400:
- attribStr += " "
- # Translators: bold as in the font sense.
- #
- attribStr += _("bold")
+ attribStr += " %s" % messages.BOLD
elif key == "underline":
if attribute != "none":
- attribStr += " "
- attribStr += localizedKey
+ attribStr += " %s" % localizedKey
elif key == "style":
if attribute != "normal":
- attribStr += " "
- attribStr += localizedValue
+ attribStr += " %s" % localizedValue
else:
attribStr += " "
attribStr += (localizedKey + " " + localizedValue)
@@ -1018,11 +969,7 @@ class SpeechGenerator(generator.Generator):
# Also check to see if this is a hypertext link.
#
if self._script.utilities.linkIndex(obj, textOffset) >= 0:
- attribStr += " "
- # Translators: this indicates that this piece of
- # text is a hypertext link.
- #
- attribStr += _("link")
+ attribStr += " %s" % messages.LINK
return attribStr
@@ -1175,11 +1122,7 @@ class SpeechGenerator(generator.Generator):
self._getTextInformation(obj)
if selected:
- # Translators: when the user selects (highlights) text in
- # a document, Orca lets them know this.
- #
- text = C_("text", "selected")
- result.append(text)
+ result.append(messages.TEXT_SELECTED)
result.extend(acss)
return result
@@ -1204,10 +1147,7 @@ class SpeechGenerator(generator.Generator):
[string, startOffset, endOffset] = \
textObj.getTextAtOffset(0, pyatspi.TEXT_BOUNDARY_LINE_START)
if startOffset == 0 and endOffset == len(string):
- # Translators: when the user selects (highlights) text in
- # a document, Orca lets them know this.
- #
- result = [C_("text", "selected")]
+ result = [messages.TEXT_SELECTED]
result.extend(acss)
return result
@@ -1245,24 +1185,12 @@ class SpeechGenerator(generator.Generator):
spaceCount += 1
offset += 1
if spaceCount:
- # Translators: this is the number of space characters on a line
- # of text.
- #
- utterance += ngettext("%d space",
- "%d spaces",
- spaceCount) % spaceCount + " "
-
+ utterance += "%s " % messages.spacesCount(spaceCount)
while (offset < len(line)) and line[offset] == '\t':
tabCount += 1
offset += 1
if tabCount:
- # Translators: this is the number of tab characters on a line
- # of text.
- #
- utterance += ngettext("%d tab",
- "%d tabs",
- tabCount) % tabCount + " "
-
+ utterance += "%s " % messages.tabsCount(tabCount)
if not (spaceCount or tabCount):
break
spaceCount = tabCount = 0
@@ -1325,12 +1253,7 @@ class SpeechGenerator(generator.Generator):
(value.currentValue
/ (value.maximumValue - value.minimumValue)) \
* 100.0
- # Translators: this is the percentage value of a progress bar.
- #
- percentage = ngettext("%d percent",
- "%d percent",
- percentValue) % percentValue
- result.append(percentage)
+ result.append(messages.percentage(percentValue))
if result:
result.extend(acss)
return result
@@ -1395,11 +1318,7 @@ class SpeechGenerator(generator.Generator):
childNodes = self._script.utilities.childNodes(obj)
children = len(childNodes)
if children:
- # Translators: this is the number of items in a layered
- # pane or table.
- #
- itemString = ngettext("%d item", "%d items", children) % children
- result.append(itemString)
+ result.append(messages.itemCount(children))
result.extend(acss)
return result
@@ -1423,10 +1342,7 @@ class SpeechGenerator(generator.Generator):
hasItems = True
break
if not hasItems:
- # Translators: this is the number of items in a layered pane
- # or table.
- #
- result.append(_("0 items"))
+ result.append(messages.ZERO_ITEMS)
result.extend(acss)
return result
@@ -1444,10 +1360,7 @@ class SpeechGenerator(generator.Generator):
result = []
acss = self.voice(SYSTEM)
if not obj.childCount:
- # Translators: this is the number of items in a layered pane
- # or table.
- #
- result.append(_("0 items"))
+ result.append(messages.ZERO_ITEMS)
result.extend(acss)
return result
@@ -1502,15 +1415,7 @@ class SpeechGenerator(generator.Generator):
selectedItems.append(child)
if state.contains(pyatspi.STATE_FOCUSED):
currentItem = child.getIndexInParent() + 1
- # Translators: this is a count of the number of selected icons
- # and the count of the total number of icons within an icon panel.
- # An example of an icon panel is the Nautilus folder view.
- #
- countString = ngettext("%(index)d of %(total)d item selected",
- "%(index)d of %(total)d items selected",
- childCount) \
- % {"index" : totalSelectedItems,
- "total" : childCount}
+ countString = messages.selectedItemsCount(totalSelectedItems, childCount)
result.append(countString)
result.extend(acss)
result.append(self._script.formatting.getString(
@@ -1559,12 +1464,7 @@ class SpeechGenerator(generator.Generator):
except:
alertAndDialogCount = 0
if alertAndDialogCount > 0:
- # Translators: this tells the user how many unfocused
- # alert and dialog windows that this application has.
- #
- result.append(ngettext("%d unfocused dialog",
- "%d unfocused dialogs",
- alertAndDialogCount) % alertAndDialogCount)
+ result.append(messages.dialogCountSpeech(alertAndDialogCount))
result.extend(acss)
return result
@@ -1648,10 +1548,7 @@ class SpeechGenerator(generator.Generator):
if args.get('role', obj.getRole()) == pyatspi.ROLE_ICON \
and args.get('formatType', None) \
in ['basicWhereAmI', 'detailedWhereAmI']:
- # Translators: this is an alternative name for the
- # parent object of a series of icons.
- #
- return [_("Icon panel")]
+ return [object_properties.ROLE_ICON_PANEL]
elif obj.parent.getRole() == pyatspi.ROLE_TABLE_CELL:
obj = obj.parent
return self._generateRoleName(obj.parent)
@@ -1806,11 +1703,7 @@ class SpeechGenerator(generator.Generator):
if button and button.getState().contains(pyatspi.STATE_SENSITIVE):
name = self._generateName(button)
if name:
- # Translators: The "default" button in a dialog box is the
- # button that gets activated when Enter is pressed anywhere
- # within that dialog box.
- #
- result.append(_("Default button is %s") % name[0])
+ result.append(messages.DEFAULT_BUTTON_IS % name[0])
return result
def generateDefaultButton(self, obj, **args):
@@ -1859,13 +1752,7 @@ class SpeechGenerator(generator.Generator):
alertAndDialogCount = \
self._script.utilities.unfocusedAlertAndDialogCount(obj)
if alertAndDialogCount > 0:
- # Translators: this tells the user how many unfocused
- # alert and dialog windows that this application has.
- #
- dialogs = []
- dialogs.append(ngettext("%d unfocused dialog",
- "%d unfocused dialogs",
- alertAndDialogCount) % alertAndDialogCount)
+ dialogs = [messages.dialogCountSpeech(alertAndDialogCount)]
dialogs.extend(acss)
result.append(dialogs)
return result
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index 1788eda..8a2ef9d 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -40,13 +40,13 @@ import re
from . import chnames
from . import debug
+from . import guilabels
from . import messages
from . import speechserver
from . import settings
from . import orca_state
from . import punctuation_settings
from .acss import ACSS
-from .orca_i18n import _
try:
import speechd
@@ -70,14 +70,7 @@ class SpeechServer(speechserver.SpeechServer):
_active_servers = {}
DEFAULT_SERVER_ID = 'default'
-
- # Translators: "Default Synthesizer" will appear in the list of available
- # speech engines as a special item. It refers to the default engine
- # configured within the speech subsystem. Apart from this item, the user
- # will have a chance to select a particular speech engine by its real
- # name, such as Festival, IBMTTS, etc.
- #
- _SERVER_NAMES = {DEFAULT_SERVER_ID: _("Default Synthesizer")}
+ _SERVER_NAMES = {DEFAULT_SERVER_ID: guilabels.DEFAULT_SYNTHESIZER}
KEY_NAMES = {
'_': 'underscore',
@@ -86,12 +79,8 @@ class SpeechServer(speechserver.SpeechServer):
'"': 'double-quote',
}
-
def getFactoryName():
- # Translators: this is the name of a speech synthesis system
- # called "Speech Dispatcher".
- #
- return _("Speech Dispatcher")
+ return guilabels.SPEECH_DISPATCHER
getFactoryName = staticmethod(getFactoryName)
def getSpeechServers():
@@ -166,16 +155,8 @@ class SpeechServer(speechserver.SpeechServer):
speechd.CallbackType.END: speechserver.SayAllContext.COMPLETED,
#speechd.CallbackType.INDEX_MARK:speechserver.SayAllContext.PROGRESS,
}
- # Translators: This string will appear in the list of
- # available voices for the current speech engine. %s will be
- # replaced by the name of the current speech engine, such as
- # "Festival default voice" or "IBMTTS default voice". It
- # refers to the default voice configured for given speech
- # engine within the speech subsystem. Apart from this item,
- # the list will contain the names of all available "real"
- # voices provided by the speech engine.
- #
- self._default_voice_name = _("%s default voice") % serverId
+
+ self._default_voice_name = guilabels.SPEECH_DEFAULT_VOICE % serverId
try:
self._init()
@@ -283,13 +264,7 @@ class SpeechServer(speechserver.SpeechServer):
Returns a text string with the punctuation symbols adjusted accordingly.
"""
- # Translators: we replace the ellipses (both manual and UTF-8)
- # with a spoken string. The extra space you see at the beginning
- # is because we need the speech synthesis engine to speak the
- # new string well. For example, "Open..." turns into
- # "Open dot dot dot".
- #
- spokenEllipsis = _(" dot dot dot") + " "
+ spokenEllipsis = messages.SPOKEN_ELLIPSIS + " "
newText = re.sub(ELLIPSIS, spokenEllipsis, oldText)
symbols = set(re.findall(PUNCTUATION, newText))
for symbol in symbols:
diff --git a/src/orca/structural_navigation.py b/src/orca/structural_navigation.py
index d1d2dfa..e7e2184 100644
--- a/src/orca/structural_navigation.py
+++ b/src/orca/structural_navigation.py
@@ -1,6 +1,7 @@
# Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
+# Copyright 2010-2013 The Orca Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -17,30 +18,29 @@
# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
# Boston MA 02110-1301 USA.
-"""Implements structural navigation. Right now this is only
-being implemented by Gecko; however it can be used in any
-script providing access to document content."""
+"""Implements structural navigation."""
__id__ = "$Id$"
__version__ = "$Revision$"
__date__ = "$Date$"
-__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
+__copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc." \
+ "Copyright (c) 2010-2013 The Orca Team"
__license__ = "LGPL"
import pyatspi
+from . import cmdnames
from . import debug
+from . import guilabels
from . import input_event
from . import keybindings
from . import messages
+from . import object_properties
from . import orca
from . import orca_gui_navlist
from . import orca_state
from . import settings
from . import speech
-from .orca_i18n import _
-from .orca_i18n import ngettext
-from .orca_i18n import C_
#############################################################################
# #
@@ -359,13 +359,7 @@ class StructuralNavigationObject:
title, columnHeaders, rowData = self._dialogData()
count = len(objects)
- # Translators: Orca has a command that presents a list of
- # structural navigation objects in a dialog box so that users
- # can navigate more quickly than they could with native keyboard
- # navigation. This is a message that will be presented to the
- # user to indicate how many items were found.
- result = ngettext("%d item found", "%d items found", count) % count
- title = "%s: %s" % (title, result)
+ title = "%s: %s" % (title, messages.itemsFound(count))
if not count:
script.presentMessage(title)
return
@@ -427,13 +421,7 @@ class StructuralNavigationObject:
title, columnHeaders, rowData = self._dialogData(arg=level)
count = len(objects)
- # Translators: Orca has a command that presents a list of
- # structural navigation objects in a dialog box so that users
- # can navigate more quickly than they could with native keyboard
- # navigation. This is a message that will be presented to the
- # user to indicate how many items were found.
- result = ngettext("%d item found", "%d items found", count) % count
- title = "%s: %s" % (title, result)
+ title = "%s: %s" % (title, messages.itemsFound(count))
if not count:
script.presentMessage(title)
return
@@ -675,14 +663,7 @@ class StructuralNavigation:
self.inputEventHandlers["toggleStructuralNavigationHandler"] = \
input_event.InputEventHandler(
self.toggleStructuralNavigation,
- # Translators: the structural navigation keys are designed
- # to move the caret around the document content by object
- # type. Thus H moves you to the next heading, Shift H to
- # the previous heading, T to the next table, and so on.
- # This feature needs to be toggle-able so that it does not
- # interfere with normal writing functions.
- #
- _("Toggles structural navigation keys."))
+ cmdnames.STRUCTURAL_NAVIGATION_TOGGLE)
for structuralNavigationObject in list(self.enabledObjects.values()):
self.inputEventHandlers.update(\
@@ -1244,28 +1225,11 @@ class StructuralNavigation:
nonUniformString = ""
nonUniform = self._isNonUniformTable(obj)
if nonUniform:
- # Translators: a uniform table is one in which each table
- # cell occupies one row and one column (i.e. a perfect grid)
- # In contrast, a non-uniform table is one in which at least
- # one table cell occupies more than one row and/or column.
- #
- nonUniformString = _("Non-uniform") + " "
+ nonUniformString = messages.TABLE_NON_UNIFORM + " "
table = obj.queryTable()
- nRows = table.nRows
- nColumns = table.nColumns
- # Translators: this represents the number of rows in a table.
- #
- rowString = ngettext("table with %d row",
- "table with %d rows",
- nRows) % nRows
- # Translators: this represents the number of columns in a table.
- #
- colString = ngettext("%d column",
- "%d columns",
- nColumns) % nColumns
-
- return (nonUniformString + rowString + " " + colString)
+ sizeString = messages.tableSize(table.nRows, table.nColumns)
+ return (nonUniformString + sizeString)
def _isNonUniformTable(self, obj):
"""Returns True if the obj is a non-uniform table (i.e. a table
@@ -1410,39 +1374,7 @@ class StructuralNavigation:
[row, col] = self.getCellCoordinates(obj)
rowspan = table.getRowExtentAt(row, col)
colspan = table.getColumnExtentAt(row, col)
- spanString = ""
- if (colspan > 1) and (rowspan > 1):
- # Translators: The cell here refers to a cell within a table
- # within a document. We need to announce when the cell occupies
- # or "spans" more than a single row and/or column.
- #
- spanString = ngettext("Cell spans %d row",
- "Cell spans %d rows",
- rowspan) % rowspan
-
- # Translators: this represents the number of columns in a table.
- #
- spanString += ngettext(" %d column",
- " %d columns",
- colspan) % colspan
- elif (colspan > 1):
- # Translators: The cell here refers to a cell within a table
- # within a document. We need to announce when the cell occupies
- # or "spans" more than a single row and/or column.
- #
- spanString = ngettext("Cell spans %d column",
- "Cell spans %d columns",
- colspan) % colspan
- elif (rowspan > 1):
- # Translators: The cell here refers to a cell within a table
- # within a document. We need to announce when the cell occupies
- # or "spans" more than a single row and/or column.
- #
- spanString = ngettext("Cell spans %d row",
- "Cell spans %d rows",
- rowspan) % rowspan
-
- return spanString
+ return messages.cellSpan(rowspan, colspan)
def getCellCoordinates(self, obj):
"""Returns the [row, col] of a ROLE_TABLE_CELL or [-1, -1]
@@ -1799,11 +1731,9 @@ class StructuralNavigation:
if role == pyatspi.ROLE_LINK:
if state.contains(pyatspi.STATE_VISITED):
- # Translators: this is a state which applies to a link.
- return C_("link state", "visited")
+ return object_properties.STATE_VISITED
else:
- # Translators: this is a state which applies to a link.
- return C_("link state", "unvisited")
+ return object_properties.STATE_UNVISITED
return ''
@@ -1864,15 +1794,10 @@ class StructuralNavigation:
# page).
bindings = {}
- # Translators: this is for navigating among anchors in a document.
- # An anchor is a named spot that one can jump to.
- #
- prevDesc = _("Goes to previous anchor.")
+ prevDesc = cmdnames.ANCHOR_PREV
bindings["previous"] = ["a", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among anchors in a document.
- # An anchor is a named spot that one can jump to.
- #
- nextDesc = _("Goes to next anchor.")
+
+ nextDesc = cmdnames.ANCHOR_NEXT
bindings["next"] = ["a", settings.NO_MODIFIER_MASK, nextDesc]
return bindings
@@ -1925,7 +1850,7 @@ class StructuralNavigation:
self._presentObject(obj, characterOffset)
else:
full = messages.NO_MORE_ANCHORS
- brief = C_("structural navigation", "Not found")
+ brief = messages.STRUCTURAL_NAVIGATION_NOT_FOUND
self._script.presentMessage(full, brief)
########################
@@ -1940,20 +1865,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among blockquotes in a
- # document.
- #
- prevDesc = _("Goes to previous blockquote.")
+ prevDesc = cmdnames.BLOCKQUOTE_PREV
bindings["previous"] = ["q", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among blockquotes in a
- # document.
- #
- nextDesc = _("Goes to next blockquote.")
+
+ nextDesc = cmdnames.BLOCKQUOTE_NEXT
bindings["next"] = ["q", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among blockquotes in a
- # document.
- #
- listDesc = _("Displays a list of blockquotes.")
+
+ listDesc = cmdnames.BLOCKQUOTE_LIST
bindings["list"] = ["q", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2014,22 +1932,12 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _blockquoteDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Blockquotes")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a blockquote element.
- columnHeaders = [C_("structural navigation", "Blockquote")]
+ columnHeaders = [guilabels.SN_HEADER_BLOCKQUOTE]
def rowData(obj):
return [self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_BLOCKQUOTE, columnHeaders, rowData
########################
# #
@@ -2043,20 +1951,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among buttons in a form
- # within a document.
- #
- prevDesc = _("Goes to previous button.")
+ prevDesc = cmdnames.BUTTON_PREV
bindings["previous"] = ["b", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among buttons in a form
- # within a document.
- #
- nextDesc = _("Goes to next button.")
+
+ nextDesc = cmdnames.BUTTON_NEXT
bindings["next"] = ["b", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among buttons in a form
- # within a document.
- #
- listDesc = _("Displays a list of buttons.")
+
+ listDesc = cmdnames.BUTTON_LIST
bindings["list"] = ["b", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2113,22 +2014,12 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _buttonDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Buttons")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a button.
- columnHeaders = [C_("structural navigation", "Button")]
+ columnHeaders = [guilabels.SN_HEADER_BUTTON]
def rowData(obj):
return [self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_BUTTON, columnHeaders, rowData
########################
# #
@@ -2142,20 +2033,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among check boxes in a form
- # within a document.
- #
- prevDesc = _("Goes to previous check box.")
+ prevDesc = cmdnames.CHECK_BOX_PREV
bindings["previous"] = ["x", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among check boxes in a form
- # within a document.
- #
- nextDesc = _("Goes to next check box.")
+
+ nextDesc = cmdnames.CHECK_BOX_NEXT
bindings["next"] = ["x", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among check boxes in a form
- # within a document.
- #
- listDesc = _("Displays a list of check boxes.")
+
+ listDesc = cmdnames.CHECK_BOX_LIST
bindings["list"] = ["x", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2212,29 +2096,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _checkBoxDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Check Boxes")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the label of a check box.
- columnHeaders = [C_("structural navigation", "Check Box")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the state of a widget. Examples
- # of state include "checked"/"not checked", "selected"/"not selected"
- columnHeaders.append(C_("structural navigation", "State"))
+ columnHeaders = [guilabels.SN_HEADER_CHECK_BOX]
+ columnHeaders.append(guilabels.SN_HEADER_STATE)
def rowData(obj):
return [self._getLabel(obj), self._getState(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_CHECK_BOX, columnHeaders, rowData
########################
# #
@@ -2248,23 +2116,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating a document in a
- # structural manner, where a 'large object' is a logical
- # chunk of text, such as a paragraph, a list, a table, etc.
- #
- prevDesc = _("Goes to previous large object.")
+ prevDesc = cmdnames.LARGE_OBJECT_PREV
bindings["previous"] = ["o", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating a document in a
- # structural manner, where a 'large object' is a logical
- # chunk of text, such as a paragraph, a list, a table, etc.
- #
- nextDesc = _("Goes to next large object.")
+
+ nextDesc = cmdnames.LARGE_OBJECT_NEXT
bindings["next"] = ["o", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating a document in a
- # structural manner, where a 'large object' is a logical
- # chunk of text, such as a paragraph, a list, a table, etc.
- #
- listDesc = _("Displays a list of large objects.")
+
+ listDesc = cmdnames.LARGE_OBJECT_LIST
bindings["list"] = ["o", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2329,29 +2187,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _chunkDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Large Objects")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of an object.
- columnHeaders = [C_("structural navigation", "Object")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the state of a widget. Examples
- # of roles include "heading", "paragraph", "table", "combo box", etc.
- columnHeaders.append(C_("structural navigation", "Role"))
+ columnHeaders = [guilabels.SN_HEADER_OBJECT]
+ columnHeaders.append(guilabels.SN_HEADER_ROLE)
def rowData(obj):
return [self._getText(obj), self._getRoleName(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_LARGE_OBJECT, columnHeaders, rowData
########################
# #
@@ -2365,20 +2207,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among combo boxes in a form
- # within a document.
- #
- prevDesc = _("Goes to previous combo box.")
+ prevDesc = cmdnames.COMBO_BOX_PREV
bindings["previous"] = ["c", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among combo boxes in a form
- # within a document.
- #
- nextDesc = _("Goes to next combo box.")
+
+ nextDesc = cmdnames.COMBO_BOX_NEXT
bindings["next"] = ["c", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among combo boxes in a form
- # within a document.
- #
- listDesc = _("Displays a list of combo boxes.")
+
+ listDesc = cmdnames.COMBO_BOX_LIST
bindings["list"] = ["c", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2435,28 +2270,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _comboBoxDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Combo Boxes")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the label of a combo box.
- columnHeaders = [C_("structural navigation", "Combo Box")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the selected item of a combo box.
- columnHeaders.append(C_("structural navigation", "Selected Item"))
+ columnHeaders = [guilabels.SN_HEADER_COMBO_BOX]
+ columnHeaders.append(guilabels.SN_HEADER_SELECTED_ITEM)
def rowData(obj):
return [self._getLabel(obj), self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_COMBO_BOX, columnHeaders, rowData
########################
# #
@@ -2470,20 +2290,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among text entries in a form
- # within a document.
- #
- prevDesc = _("Goes to previous entry.")
+ prevDesc = cmdnames.ENTRY_PREV
bindings["previous"] = ["e", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among text entries in a form
- # within a document.
- #
- nextDesc = _("Goes to next entry.")
+
+ nextDesc = cmdnames.ENTRY_NEXT
bindings["next"] = ["e", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among text entries in a form
- # within a document.
- #
- listDesc = _("Displays a list of entries.")
+
+ listDesc = cmdnames.ENTRY_LIST
bindings["list"] = ["e", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2552,28 +2365,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _entryDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Entries")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the label of an entry.
- columnHeaders = [C_("structural navigation", "Label")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of an entry.
- columnHeaders.append(C_("structural navigation", "Text"))
+ columnHeaders = [guilabels.SN_HEADER_LABEL]
+ columnHeaders.append(guilabels.SN_HEADER_TEXT)
def rowData(obj):
return [self._getLabel(obj), self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_ENTRY, columnHeaders, rowData
########################
# #
@@ -2587,20 +2385,15 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among fields in a form within
- # a document.
- #
- prevDesc = _("Goes to previous form field.")
+ prevDesc = cmdnames.FORM_FIELD_PREV
bindings["previous"] = ["Tab",
settings.ORCA_SHIFT_MODIFIER_MASK,
prevDesc]
- # Translators: this is for navigating among fields in a form within
- # a document.
- #
- nextDesc = _("Goes to next form field.")
+
+ nextDesc = cmdnames.FORM_FIELD_NEXT
bindings["next"] = ["Tab", settings.ORCA_MODIFIER_MASK, nextDesc]
- listDesc = _("Displays a list of form fields.")
+ listDesc = cmdnames.FORM_FIELD_LIST
bindings["list"] = ["f", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -2662,37 +2455,16 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _formFieldDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Form Fields")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the label of a form field.
- columnHeaders = [C_("structural navigation", "Label")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the state of a widget. Examples
- # of roles include "heading", "paragraph", "table", "combo box", etc.
- columnHeaders.append(C_("structural navigation", "Role"))
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the value of a form field.
- columnHeaders.append(C_("structural navigation", "Value"))
+ columnHeaders = [guilabels.SN_HEADER_LABEL]
+ columnHeaders.append(guilabels.SN_HEADER_ROLE)
+ columnHeaders.append(guilabels.SN_HEADER_VALUE)
def rowData(obj):
return [self._getLabel(obj),
self._getRoleName(obj),
self._getValue(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_FORM_FIELD, columnHeaders, rowData
########################
# #
@@ -2706,20 +2478,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating in a document by heading.
- # (e.g. <h1>)
- #
- prevDesc = _("Goes to previous heading.")
+ prevDesc = cmdnames.HEADING_PREV
bindings["previous"] = ["h", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating in a document by heading.
- # (e.g., <h1>)
- #
- nextDesc = _("Goes to next heading.")
+
+ nextDesc = cmdnames.HEADING_NEXT
bindings["next"] = ["h", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for creating a list of all of the headings
- # (e.g., <h1>) in a document as an alternative means of navigation.
- #
- listDesc = _("Displays a list of headings.")
+
+ listDesc = cmdnames.HEADING_LIST
bindings["list"] = ["h", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
prevAtLevelBindings = []
@@ -2727,25 +2492,17 @@ class StructuralNavigation:
listAtLevelBindings = []
minLevel, maxLevel = self._headingLevels()
for i in range(minLevel, maxLevel + 1):
- # Translators: this is for navigating in a document by heading.
- # (e.g. <h1> is a heading at level 1).
- #
- prevDesc = _("Goes to previous heading at level %d.") % i
+ prevDesc = cmdnames.HEADING_AT_LEVEL_PREV % i
prevAtLevelBindings.append([str(i),
settings.SHIFT_MODIFIER_MASK,
prevDesc])
- # Translators: this is for navigating in a document by heading.
- # (e.g. <h1> is a heading at level 1).
- #
- nextDesc = _("Goes to next heading at level %d.") % i
+
+ nextDesc = cmdnames.HEADING_AT_LEVEL_NEXT % i
nextAtLevelBindings.append([str(i),
settings.NO_MODIFIER_MASK,
nextDesc])
- # Translators: this is for creating a list of all of the headings
- # at a particular level (e.g. <h1> is a heading at level 1) in a
- #document as an alternative means of navigation.
- #
- listDesc = _("Displays a list of headings at level %d.") %i
+
+ listDesc = cmdnames.HEADING_AT_LEVEL_LIST %i
listAtLevelBindings.append([str(i),
settings.SHIFT_ALT_MODIFIER_MASK,
listDesc])
@@ -2824,36 +2581,17 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _headingDialogData(self, arg=None):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of document headings.
- columnHeaders = [C_("structural navigation", "Heading")]
+ columnHeaders = [guilabels.SN_HEADER_HEADING]
if not arg:
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Headings")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the level of document headings,
- # e.g. "1" for an <h1>, "2" for an <h2>, and so on.
- columnHeaders.append(C_("structural navigation", "Level"))
+ title = guilabels.SN_TITLE_HEADING
+ columnHeaders.append(guilabels.SN_HEADER_LEVEL)
def rowData(obj):
return [self._getText(obj), str(self._getHeadingLevel(obj))]
else:
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box. Level will be a "1" for <h1>,
- # a "2" for <h2>, and so on.
- title = C_("structural navigation", "Headings at Level %d") % arg
+ title = guilabels.SN_TITLE_HEADING_AT_LEVEL % arg
def rowData(obj):
return [self._getText(obj)]
@@ -2872,19 +2610,10 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating to the previous ARIA
- # role landmark. ARIA role landmarks are the W3C defined
- # HTML tag attribute 'role' used to identify important part
- # of webpage like banners, main context, search etc.
- #
- prevDesc = _("Goes to previous landmark.")
+ prevDesc = cmdnames.LANDMARK_PREV
bindings["previous"] = ["m", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating to the next ARIA
- # role landmark. ARIA role landmarks are the W3C defined
- # HTML tag attribute 'role' used to identify important part
- # of webpage like banners, main context, search etc.
- #
- nextDesc = _("Goes to next landmark.")
+
+ nextDesc = cmdnames.LANDMARK_NEXT
bindings["next"] = ["m", settings.NO_MODIFIER_MASK, nextDesc]
return bindings
@@ -2967,20 +2696,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among bulleted/numbered
- # lists in a document.
- #
- prevDesc = _("Goes to previous list.")
+ prevDesc = cmdnames.LIST_PREV
bindings["previous"] = ["l", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among bulleted/numbered
- # lists in a document.
- #
- nextDesc = _("Goes to next list.")
+
+ nextDesc = cmdnames.LIST_NEXT
bindings["next"] = ["l", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among bulleted/numbered
- # lists in a document.
- #
- listDesc = _("Displays a list of lists.")
+
+ listDesc = cmdnames.LIST_LIST
bindings["list"] = ["l", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3037,25 +2759,15 @@ class StructuralNavigation:
for child in obj:
if child.getRole() == pyatspi.ROLE_LIST_ITEM:
nItems += 1
- # Translators: this represents a list in HTML.
- #
- itemString = ngettext("List with %d item",
- "List with %d items",
- nItems) % nItems
- self._script.presentMessage(itemString)
+ self._script.presentMessage(messages.listItemCount(nItems))
nestingLevel = 0
parent = obj.parent
while parent.getRole() == pyatspi.ROLE_LIST:
nestingLevel += 1
parent = parent.parent
if nestingLevel:
- # 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).
- #
- self._script.presentMessage(_("Nesting level %d") % \
- nestingLevel)
+ self._script.presentMessage(
+ messages.NESTING_LEVEL % nestingLevel)
[obj, characterOffset] = self._getCaretPosition(obj)
self._setCaretPosition(obj, characterOffset)
self._presentLine(obj, characterOffset)
@@ -3065,22 +2777,12 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _listDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Lists")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a list element.
- columnHeaders = [C_("structural navigation", "List")]
+ columnHeaders = [guilabels.SN_HEADER_LIST]
def rowData(obj):
return [self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_LIST, columnHeaders, rowData
########################
# #
@@ -3094,21 +2796,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among bulleted/numbered list
- # items in a document.
- #
- prevDesc = _("Goes to previous list item.")
+ prevDesc = cmdnames.LIST_ITEM_PREV
bindings["previous"] = ["i", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among bulleted/numbered list
- # items in a document.
- #
- nextDesc = _("Goes to next list item.")
+
+ nextDesc = cmdnames.LIST_ITEM_NEXT
bindings["next"] = ["i", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among bulleted/numbered
- # lists in a document.
- #
- listDesc = _("Displays a list of list items.")
+ listDesc = cmdnames.LIST_ITEM_LIST
bindings["list"] = ["i", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3171,22 +2865,12 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _listItemDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "List Items")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a list item.
- columnHeaders = [C_("structural navigation", "List Item")]
+ columnHeaders = [guilabels.SN_HEADER_LIST_ITEM]
def rowData(obj):
return [self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_LIST_ITEM, columnHeaders, rowData
########################
# #
@@ -3200,18 +2884,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating between live regions
- #
- prevDesc = _("Goes to previous live region.")
+ prevDesc = cmdnames.LIVE_REGION_PREV
bindings["previous"] = ["d", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating between live regions
- #
- nextDesc = _("Goes to next live region.")
+
+ nextDesc = cmdnames.LIVE_REGION_NEXT
bindings["next"] = ["d", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating to the last live region
- # which made an announcement.
- #
- desc = _("Goes to the last live region which made an announcement.")
+
+ desc = cmdnames.LIVE_REGION_LAST
bindings["last"] = ["y", settings.NO_MODIFIER_MASK, desc]
return bindings
@@ -3288,17 +2967,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among paragraphs in a document.
- #
- prevDesc = _("Goes to previous paragraph.")
+ prevDesc = cmdnames.PARAGRAPH_PREV
bindings["previous"] = ["p", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among paragraphs in a document.
- #
- nextDesc = _("Goes to next paragraph.")
+
+ nextDesc = cmdnames.PARAGRAPH_NEXT
bindings["next"] = ["p", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among paragraphs in a document.
- #
- listDesc = _("Displays a list of paragraphs.")
+
+ listDesc = cmdnames.PARAGRAPH_LIST
bindings["list"] = ["p", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3359,22 +3034,12 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _paragraphDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Paragraphs")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a paragraph element.
- columnHeaders = [C_("structural navigation", "Paragraph")]
+ columnHeaders = [guilabels.SN_HEADER_PARAGRAPH]
def rowData(obj):
return [self._getText(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_PARAGRAPH, columnHeaders, rowData
########################
# #
@@ -3388,20 +3053,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among radio buttons in a
- # form within a document.
- #
- prevDesc = _("Goes to previous radio button.")
+ prevDesc = cmdnames.RADIO_BUTTON_PREV
bindings["previous"] = ["r", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among radio buttons in a
- # form within a document.
- #
- nextDesc = _("Goes to next radio button.")
+
+ nextDesc = cmdnames.RADIO_BUTTON_NEXT
bindings["next"] = ["r", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among radio buttons in a
- # form within a document.
- #
- listDesc = _("Displays a list of radio buttons.")
+
+ listDesc = cmdnames.RADIO_BUTTON_LIST
bindings["list"] = ["r", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3458,29 +3116,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _radioButtonDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Radio Buttons")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the label of a check box.
- columnHeaders = [C_("structural navigation", "Radio Button")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the state of a widget. Examples
- # of state include "checked"/"not checked", "selected"/"not selected"
- columnHeaders.append(C_("structural navigation", "State"))
+ columnHeaders = [guilabels.SN_HEADER_RADIO_BUTTON]
+ columnHeaders.append(guilabels.SN_HEADER_STATE)
def rowData(obj):
return [self._getLabel(obj), self._getState(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_RADIO_BUTTON, columnHeaders, rowData
########################
# #
@@ -3494,15 +3136,10 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among separators, such as the
- # <hr> tag, in a document.
- #
- prevDesc = _("Goes to previous separator.")
+ prevDesc = cmdnames.SEPARATOR_PREV
bindings["previous"] = ["s", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among separators, such as the
- # <hr> tag, in a document.
- #
- nextDesc = _("Goes to next separator.")
+
+ nextDesc = cmdnames.SEPARATOR_NEXT
bindings["next"] = ["s", settings.NO_MODIFIER_MASK, nextDesc]
return bindings
@@ -3561,17 +3198,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among tables in a document.
- #
- prevDesc = _("Goes to previous table.")
+ prevDesc = cmdnames.TABLE_PREV
bindings["previous"] = ["t", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among tables in a document.
- #
- nextDesc = _("Goes to next table.")
+
+ nextDesc = cmdnames.TABLE_NEXT
bindings["next"] = ["t", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among tables in a document.
- #
- listDesc = _("Displays a list of tables.")
+
+ listDesc = cmdnames.TABLE_LIST
bindings["list"] = ["t", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3631,30 +3264,14 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _tableDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Tables")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the caption of a table.
- columnHeaders = [C_("structural navigation", "Caption")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the type of a table element. The
- # type can be "layout" or "data".
- columnHeaders.append(C_("structural navigation", "Description"))
+ columnHeaders = [guilabels.SN_HEADER_CAPTION]
+ columnHeaders.append(guilabels.SN_HEADER_DESCRIPTION)
def rowData(obj):
return [self._getTableCaption(obj) or '',
self._getTableDescription(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_TABLE, columnHeaders, rowData
########################
# #
@@ -3668,29 +3285,22 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among table cells in a document.
- #
- desc = _("Goes left one cell.")
+ desc = cmdnames.TABLE_CELL_LEFT
bindings["left"] = ["Left", settings.SHIFT_ALT_MODIFIER_MASK, desc]
- # Translators: this is for navigating among table cells in a document.
- #
- desc = _("Goes right one cell.")
+
+ desc = cmdnames.TABLE_CELL_RIGHT
bindings["right"] = ["Right", settings.SHIFT_ALT_MODIFIER_MASK, desc]
- # Translators: this is for navigating among table cells in a document.
- #
- desc = _("Goes up one cell.")
+
+ desc = cmdnames.TABLE_CELL_UP
bindings["up"] = ["Up", settings.SHIFT_ALT_MODIFIER_MASK, desc]
- # Translators: this is for navigating among table cells in a document.
- #
- desc = _("Goes down one cell.")
+
+ desc = cmdnames.TABLE_CELL_DOWN
bindings["down"] = ["Down", settings.SHIFT_ALT_MODIFIER_MASK, desc]
- # Translators: this is for navigating among table cells in a document.
- #
- desc = _("Goes to the first cell in a table.")
+
+ desc = cmdnames.TABLE_CELL_FIRST
bindings["first"] = ["Home", settings.SHIFT_ALT_MODIFIER_MASK, desc]
- # Translators: this is for navigating among table cells in a document.
- #
- desc = _("Goes to the last cell in a table.")
+
+ desc = cmdnames.TABLE_CELL_LAST
bindings["last"] = ["End", settings.SHIFT_ALT_MODIFIER_MASK, desc]
return bindings
@@ -3747,10 +3357,7 @@ class StructuralNavigation:
if settings.speakCellCoordinates:
[row, col] = self.getCellCoordinates(cell)
- # Translators: this represents the (row, col) position of
- # a cell in a table.
- #
- self._script.presentMessage(_("Row %(row)d, column %(column)d.") \
+ self._script.presentMessage(messages.TABLE_CELL_COORDINATES \
% {"row" : row + 1, "column" : col + 1})
spanString = self._getCellSpanInfo(cell)
@@ -3769,20 +3376,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among unvisited links in a
- # document.
- #
- prevDesc = _("Goes to previous unvisited link.")
+ prevDesc = cmdnames.UNVISITED_LINK_PREV
bindings["previous"] = ["u", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among unvisited links in a
- # document.
- #
- nextDesc = _("Goes to next unvisited link.")
+
+ nextDesc = cmdnames.UNVISITED_LINK_NEXT
bindings["next"] = ["u", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among visited links in a
- # document.
- #
- listDesc = _("Displays a list of unvisited links.")
+
+ listDesc = cmdnames.UNVISITED_LINK_LIST
bindings["list"] = ["u", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3849,28 +3449,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _unvisitedLinkDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Unvisited Links")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a link.
- columnHeaders = [C_("structural navigation", "Link")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the URI of a link.
- columnHeaders.append(C_("structural navigation", "URI"))
+ columnHeaders = [guilabels.SN_HEADER_LINK]
+ columnHeaders.append(guilabels.SN_HEADER_URI)
def rowData(obj):
return [self._getText(obj), self._script.utilities.uri(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_UNVISITED_LINK, columnHeaders, rowData
########################
# #
@@ -3884,20 +3469,13 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among visited links in a
- # document.
- #
- prevDesc = _("Goes to previous visited link.")
+ prevDesc = cmdnames.VISITED_LINK_PREV
bindings["previous"] = ["v", settings.SHIFT_MODIFIER_MASK, prevDesc]
- # Translators: this is for navigating among visited links in a
- # document.
- #
- nextDesc = _("Goes to next visited link.")
+
+ nextDesc = cmdnames.VISITED_LINK_NEXT
bindings["next"] = ["v", settings.NO_MODIFIER_MASK, nextDesc]
- # Translators: this is for navigating among visited links in a
- # document.
- #
- listDesc = _("Displays a list of visited links.")
+
+ listDesc = cmdnames.VISITED_LINK_LIST
bindings["list"] = ["v", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -3956,28 +3534,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _visitedLinkDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Visited Links")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a link.
- columnHeaders = [C_("structural navigation", "Link")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the URI of a link.
- columnHeaders.append(C_("structural navigation", "URI"))
+ columnHeaders = [guilabels.SN_HEADER_LINK]
+ columnHeaders.append(guilabels.SN_HEADER_URI)
def rowData(obj):
return [self._getText(obj), self._script.utilities.uri(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_VISITED_LINK, columnHeaders, rowData
########################
# #
@@ -3991,8 +3554,7 @@ class StructuralNavigation:
"""
bindings = {}
- # Translators: this is for navigating among links in a document.
- listDesc = _("Displays a list of links.")
+ listDesc = cmdnames.LINK_LIST
bindings["list"] = ["k", settings.SHIFT_ALT_MODIFIER_MASK, listDesc]
return bindings
@@ -4053,34 +3615,13 @@ class StructuralNavigation:
self._script.presentMessage(full, brief)
def _linkDialogData(self):
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title of one such dialog box.
- title = C_("structural navigation", "Links")
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the text of a link.
- columnHeaders = [C_("structural navigation", "Link")]
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the URI of a link.
- columnHeaders.append(C_("structural navigation", "URI"))
-
- # Translators: Orca has a command that presents a list of structural
- # navigation objects in a dialog box so that users can navigate more
- # quickly than they could with native keyboard navigation. This is
- # the title for a column containing the state of a widget. Examples
- # of state include "checked"/"not checked", "selected"/"not selected"
- columnHeaders.append(C_("structural navigation", "State"))
+ columnHeaders = [guilabels.SN_HEADER_LINK]
+ columnHeaders.append(guilabels.SN_HEADER_URI)
+ columnHeaders.append(guilabels.SN_HEADER_STATE)
def rowData(obj):
return [self._getText(obj),
self._script.utilities.uri(obj),
self._getState(obj)]
- return title, columnHeaders, rowData
+ return guilabels.SN_TITLE_LINK, columnHeaders, rowData
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]