orca r4230 - branches/phase2/src/orca
- From: wwalker svn gnome org
- To: svn-commits-list gnome org
- Subject: orca r4230 - branches/phase2/src/orca
- Date: Tue, 16 Sep 2008 01:16:32 +0000 (UTC)
Author: wwalker
Date: Tue Sep 16 01:16:31 2008
New Revision: 4230
URL: http://svn.gnome.org/viewvc/orca?rev=4230&view=rev
Log:
Add various string constant files as well as ACSS definition.
Added:
branches/phase2/src/orca/acss.py (contents, props changed)
branches/phase2/src/orca/character_names.py (contents, props changed)
branches/phase2/src/orca/key_names.py (contents, props changed)
branches/phase2/src/orca/phonetic_names.py (contents, props changed)
branches/phase2/src/orca/rolenames.py (contents, props changed)
branches/phase2/src/orca/text_attribute_names.py (contents, props changed)
Added: branches/phase2/src/orca/acss.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/acss.py Tue Sep 16 01:16:31 2008
@@ -0,0 +1,96 @@
+# Copyright 2005-2008 Google Inc.
+# Portions Copyright 2007-2008, Sun Microsystems, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+#
+
+"""ACSS --- Aural CSS.
+
+Class ACSS defines a simple wrapper for holding ACSS voice
+definitions. Speech engines implement the code for converting
+ACSS definitions into engine-specific markup codes.
+
+"""
+
+__id__ = "$Id$"
+__author__ = "T. V. Raman"
+__copyright__ = "Copyright (c) 2005-2008 Google Inc."
+__license__ = "LGPL"
+
+class ACSS(dict):
+
+ """Holds ACSS representation of a voice."""
+
+ FAMILY = 'family'
+ RATE = 'rate'
+ GAIN = 'gain'
+ AVERAGE_PITCH = 'average-pitch'
+ PITCH_RANGE = 'pitch-range'
+ STRESS = 'stress'
+ RICHNESS = 'richness'
+ PUNCTUATIONS = 'punctuations'
+
+ # A value of None means use the engine's default value.
+ #
+ settings = {
+ FAMILY : None,
+ RATE : 50,
+ GAIN : 5,
+ AVERAGE_PITCH : 5,
+ PITCH_RANGE : 5,
+ STRESS : 5,
+ RICHNESS : 5,
+ PUNCTUATIONS : 'all'
+ }
+
+ def __init__(self, props=None):
+ """Create and initialize ACSS structure."""
+ dict.__init__(self)
+ props = props or {}
+ for k in props:
+ if k in ACSS.settings:
+ # Do a 'deep copy' of the family. Otherwise,
+ # the new ACSS shares the actual data with the
+ # props passed in. This can cause unexpected
+ # side effects.
+ #
+ if k == ACSS.FAMILY:
+ self[k] = {}
+ for j in props[k].keys():
+ self[k][j] = props[k][j]
+ else:
+ self[k] = props[k]
+
+ def __setitem__ (self, key, value):
+ """Update name when we change values."""
+ dict.__setitem__(self, key, value)
+
+ def __delitem__(self, key):
+ """Update name if we delete a key."""
+ dict.__delitem__(self, key)
+
+ def updateName(self):
+ """Update name based on settings."""
+
+ def name(self):
+ _name = 'acss-'
+ names = self.keys()
+ if names:
+ names.sort()
+ for k in names:
+ _name += "%s-%s:" % (k, self[k])
+ _name = _name[:-1]
+ return _name
Added: branches/phase2/src/orca/character_names.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/character_names.py Tue Sep 16 01:16:31 2008
@@ -0,0 +1,748 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2004-2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+
+"""Provides getCharacterName that maps punctuation marks and other
+individual characters into localized words."""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from orca_i18n import _ # for gettext support
+
+# __characterNames is a dictionary where the keys represent a unicode
+# character and the values represent the common term used for the
+# character.
+#
+__characterNames = {}
+
+# Translators: this is the spoken word for the space character
+#
+__characterNames[" "] = _("space")
+
+# Translators: this is the spoken word for the newline character
+#
+__characterNames["\n"] = _("newline")
+
+# Translators: this is the spoken word for the tab character
+#
+__characterNames["\t"] = _("tab")
+
+# Translators: this is the spoken word for the character '!' (U+0021)
+#
+__characterNames["!"] = _("exclaim")
+
+# Translators: this is the spoken word for the character '"' (U+0022)
+#
+__characterNames["\""] = _("quote")
+
+# Translators: this is the spoken word for the character '#' (U+0023)
+#
+__characterNames["#"] = _("number")
+
+# Translators: this is the spoken word for the character '$' (U+0024)
+#
+__characterNames["$"] = _("dollar")
+
+# Translators: this is the spoken word for the character '%' (U+0025)
+#
+__characterNames["%"] = _("percent")
+
+# Translators: this is the spoken word for the character '&' (U+0026)
+#
+__characterNames["&"] = _("and")
+
+# Translators: this is the spoken word for the character ''' (U+0027)
+#
+__characterNames["'"] = _("apostrophe")
+
+# Translators: this is the spoken word for the character '(' (U+0028)
+#
+__characterNames["("] = _("left paren")
+
+# Translators: this is the spoken word for the character ')' (U+0029)
+#
+__characterNames[")"] = _("right paren")
+
+# Translators: this is the spoken word for the character '*' (U+002a)
+#
+__characterNames["*"] = _("star")
+
+# Translators: this is the spoken word for the character '+' (U+002b)
+#
+__characterNames["+"] = _("plus")
+
+# Translators: this is the spoken word for the character ',' (U+002c)
+#
+__characterNames[","] = _("comma")
+
+# Translators: this is the spoken word for the character '-' (U+002d)
+#
+__characterNames["-"] = _("dash")
+
+# Translators: this is the spoken word for the character '.' (U+002e)
+#
+__characterNames["."] = _("dot")
+
+# Translators: this is the spoken word for the character '/' (U+002f)
+#
+__characterNames["/"] = _("slash")
+
+# Translators: this is the spoken word for the character ':' (U+003a)
+#
+__characterNames[":"] = _("colon")
+
+# Translators: this is the spoken word for the character ';' (U+003b)
+#
+__characterNames[";"] = _("semicolon")
+
+# Translators: this is the spoken word for the character '<Â' (U+003c)
+#
+__characterNames["<"] = _("less")
+
+# Translators: this is the spoken word for the character '=' (U+003d)
+#
+__characterNames["="] = _("equals")
+
+# Translators: this is the spoken word for the character '>Â' (U+003e)
+#
+__characterNames[">"] = _("greater")
+
+# Translators: this is the spoken word for the character '?' (U+003f)
+#
+__characterNames["?"] = _("question")
+
+# Translators: this is the spoken word for the character '@' (U+0040)
+#
+__characterNames["@"] = _("at")
+
+# Translators: this is the spoken word for the character '[' (U+005b)
+#
+__characterNames["["] = _("left bracket")
+
+# Translators: this is the spoken word for the character '\' (U+005c)
+#
+__characterNames["\\"] = _("backslash")
+
+# Translators: this is the spoken word for the character ']' (U+005d)
+#
+__characterNames["]"] = _("right bracket")
+
+# Translators: this is the spoken word for the character '^' (U+005e)
+#
+__characterNames["^"] = _("caret")
+
+# Translators: this is the spoken word for the character '_' (U+005f)
+#
+__characterNames["_"] = _("underline")
+
+# Translators: this is the spoken word for the character '`' (U+0060)
+#
+__characterNames["`"] = _("grave")
+
+# Translators: this is the spoken word for the character '{' (U+007b)
+#
+__characterNames["{"] = _("left brace")
+
+# Translators: this is the spoken word for the character '|' (U+007c)
+#
+__characterNames["|"] = _("vertical bar")
+
+# Translators: this is the spoken word for the character '}' (U+007d)
+#
+__characterNames["}"] = _("right brace")
+
+# Translators: this is the spoken word for the character '~' (U+007e)
+#
+__characterNames["~"] = _("tilde")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a1)
+#
+__characterNames[u'\u00a1'] = _("inverted exclamation point")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a2)
+#
+__characterNames[u'\u00a2'] = _("cents")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a3)
+#
+__characterNames[u'\u00a3'] = _("pounds")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a4)
+#
+__characterNames[u'\u00a4'] = _("currency sign")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a5)
+#
+__characterNames[u'\u00a5'] = _("yen")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a6)
+#
+__characterNames[u'\u00a6'] = _("broken bar")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a7)
+#
+__characterNames[u'\u00a7'] = _("section")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a8)
+#
+__characterNames[u'\u00a8'] = _("umlaut")
+
+# Translators: this is the spoken word for the character 'Â' (U+00a9)
+#
+__characterNames[u'\u00a9'] = _("copyright")
+
+# Translators: this is the spoken word for the character 'Â' (U+00aa)
+#
+__characterNames[u'\u00aa'] = _("superscript a")
+
+# Translators: this is the spoken word for the character 'Â' (U+00ab)
+#
+__characterNames[u'\u00ab'] = _("left double angle bracket")
+
+# Translators: this is the spoken word for the character 'Â' (U+00ac)
+#
+__characterNames[u'\u00ac'] = _("logical not")
+
+# Translators: this is the spoken word for the character 'Â' (U+00ad)
+#
+__characterNames[u'\u00ad'] = _("soft hyphen")
+
+# Translators: this is the spoken word for the character 'Â' (U+00ae)
+#
+__characterNames[u'\u00ae'] = _("registered")
+
+# Translators: this is the spoken word for the character 'Â' (U+00af)
+#
+__characterNames[u'\u00af'] = _("macron")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b0)
+#
+__characterNames[u'\u00b0'] = _("degrees")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b1)
+#
+__characterNames[u'\u00b1'] = _("plus or minus")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b2)
+#
+__characterNames[u'\u00b2'] = _("superscript 2")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b3)
+#
+__characterNames[u'\u00b3'] = _("superscript 3")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b4)
+#
+__characterNames[u'\u00b4'] = _("acute accent")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b5)
+#
+__characterNames[u'\u00b5'] = _("mu")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b6)
+#
+__characterNames[u'\u00b6'] = _("paragraph marker")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b7)
+#
+__characterNames[u'\u00b7'] = _("middle dot")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b8)
+#
+__characterNames[u'\u00b8'] = _("cedilla")
+
+# Translators: this is the spoken word for the character 'Â' (U+00b9)
+#
+__characterNames[u'\u00b9'] = _("superscript 1")
+
+# Translators: this is the spoken word for the character 'Â' (U+00ba)
+#
+__characterNames[u'\u00ba'] = _("ordinal")
+
+# Translators: this is the spoken word for the character 'Â' (U+00bb)
+#
+__characterNames[u'\u00bb'] = _("right double angle bracket")
+
+# Translators: this is the spoken word for the character 'Â' (U+00bc)
+#
+__characterNames[u'\u00bc'] = _("one fourth")
+
+# Translators: this is the spoken word for the character 'Â' (U+00bd)
+#
+__characterNames[u'\u00bd'] = _("one half")
+
+# Translators: this is the spoken word for the character 'Â' (U+00be)
+#
+__characterNames[u'\u00be'] = _("three fourths")
+
+# Translators: this is the spoken word for the character 'Â' (U+00bf)
+#
+__characterNames[u'\u00bf'] = _("inverted question mark")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e1)
+#
+__characterNames[u'\u00e1'] = _("a acute")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c0)
+#
+__characterNames[u'\u00c0'] = _("A GRAVE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c1)
+#
+__characterNames[u'\u00c1'] = _("A ACUTE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c2)
+#
+__characterNames[u'\u00c2'] = _("A CIRCUMFLEX")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c3)
+#
+__characterNames[u'\u00c3'] = _("A TILDE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c4)
+#
+__characterNames[u'\u00c4'] = _("A UMLAUT")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c5)
+#
+__characterNames[u'\u00c5'] = _("A RING")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c6)
+#
+__characterNames[u'\u00c6'] = _("A E")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c7)
+#
+__characterNames[u'\u00c7'] = _("C CEDILLA")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c8)
+#
+__characterNames[u'\u00c8'] = _("E GRAVE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00c9)
+#
+__characterNames[u'\u00c9'] = _("E ACUTE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ca)
+#
+__characterNames[u'\u00ca'] = _("E CIRCUMFLEX")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00cb)
+#
+__characterNames[u'\u00cb'] = _("E UMLAUT")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00cc)
+#
+__characterNames[u'\u00cc'] = _("I GRAVE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00cd)
+#
+__characterNames[u'\u00cd'] = _("I ACUTE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ce)
+#
+__characterNames[u'\u00ce'] = _("I CIRCUMFLEX")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00cf)
+#
+__characterNames[u'\u00cf'] = _("I UMLAUT")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d0)
+#
+__characterNames[u'\u00d0'] = _("ETH")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d1)
+#
+__characterNames[u'\u00d1'] = _("N TILDE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d2)
+#
+__characterNames[u'\u00d2'] = _("O GRAVE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d3)
+#
+__characterNames[u'\u00d3'] = _("O ACUTE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d4)
+#
+__characterNames[u'\u00d4'] = _("O CIRCUMFLEX")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d5)
+#
+__characterNames[u'\u00d5'] = _("O TILDE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d6)
+#
+__characterNames[u'\u00d6'] = _("O UMLAUT")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d7)
+#
+__characterNames[u'\u00d7'] = _("times")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d8)
+#
+__characterNames[u'\u00d8'] = _("O STROKE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00d9)
+#
+__characterNames[u'\u00d9'] = _("U GRAVE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00da)
+#
+__characterNames[u'\u00da'] = _("U ACUTE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00db)
+#
+__characterNames[u'\u00db'] = _("U CIRCUMFLEX")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00dc)
+#
+__characterNames[u'\u00dc'] = _("U UMLAUT")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00dd)
+#
+__characterNames[u'\u00dd'] = _("Y ACUTE")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00de)
+#
+__characterNames[u'\u00de'] = _("THORN")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00df)
+#
+__characterNames[u'\u00df'] = _("s sharp")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e0)
+#
+__characterNames[u'\u00e0'] = _("a grave")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e2)
+#
+__characterNames[u'\u00e2'] = _("a circumflex")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e3)
+#
+__characterNames[u'\u00e3'] = _("a tilde")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e4)
+#
+__characterNames[u'\u00e4'] = _("a umlaut")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e5)
+#
+__characterNames[u'\u00e5'] = _("a ring")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e6)
+#
+__characterNames[u'\u00e6'] = _("a e")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e7)
+#
+__characterNames[u'\u00e7'] = _("c cedilla")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e8)
+#
+__characterNames[u'\u00e8'] = _("e grave")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00e9)
+#
+__characterNames[u'\u00e9'] = _("e acute")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ea)
+#
+__characterNames[u'\u00ea'] = _("e circumflex")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00eb)
+#
+__characterNames[u'\u00eb'] = _("e umlaut")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ec)
+#
+__characterNames[u'\u00ec'] = _("i grave")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ed)
+#
+__characterNames[u'\u00ed'] = _("i acute")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ee)
+#
+__characterNames[u'\u00ee'] = _("i circumflex")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ef)
+#
+__characterNames[u'\u00ef'] = _("i umlaut")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f0)
+#
+__characterNames[u'\u00f0'] = _("eth")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f1)
+#
+__characterNames[u'\u00f1'] = _("n tilde")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f2)
+#
+__characterNames[u'\u00f2'] = _("o grave")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f3)
+#
+__characterNames[u'\u00f3'] = _("o acute")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f4)
+#
+__characterNames[u'\u00f4'] = _("o circumflex")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f5)
+#
+__characterNames[u'\u00f5'] = _("o tilde")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f6)
+#
+__characterNames[u'\u00f6'] = _("o umlaut")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f7)
+#
+__characterNames[u'\u00f7'] = _("divided by")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f8)
+#
+__characterNames[u'\u00f8'] = _("o stroke")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00fe)
+#
+__characterNames[u'\u00fe'] = _("thorn")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00fa)
+#
+__characterNames[u'\u00fa'] = _("u acute")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00f9)
+#
+__characterNames[u'\u00f9'] = _("u grave")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00fb)
+#
+__characterNames[u'\u00fb'] = _("u circumflex")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00fc)
+#
+__characterNames[u'\u00fc'] = _("u umlaut")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00fd)
+#
+__characterNames[u'\u00fd'] = _("y acute")
+
+# Translators: this is the spoken word for the character 'Ã' (U+00ff)
+#
+__characterNames[u'\u00ff'] = _("y umlaut")
+
+# Translators: this is the spoken word for the character 'Å' (U+0178)
+#
+__characterNames[u'\u0178'] = _("Y UMLAUT")
+
+# Translators: this is the spoken word for the character 'Æ' (U+0192)
+#
+__characterNames[u'\u0192'] = _("florin")
+
+# Translators: this is the spoken word for the character 'â' (U+2013)
+#
+__characterNames[u'\u2013'] = _("en dash")
+
+# Translators: this is the spoken word for the left single quote: â
+# (U+2018)
+#
+__characterNames[u'\u2018'] = _("left single quote")
+
+# Translators: this is the spoken word for the right single quote: â
+# (U+2019)
+#
+__characterNames[u'\u2019'] = _("right single quote")
+
+# Translators: this is the spoken word for the character 'â' (U+201c)
+#
+__characterNames[u'\u201c'] = _("left double quote")
+
+# Translators: this is the spoken word for the character 'â' (U+201d)
+#
+__characterNames[u'\u201d'] = _("right double quote")
+
+# Translators: this is the spoken word for the character 'â' (U+2020)
+#
+__characterNames[u'\u2020'] = _("dagger")
+
+# Translators: this is the spoken word for the character 'â' (U+2021)
+#
+__characterNames[u'\u2021'] = _("double dagger")
+
+# Translators: this is the spoken word for the character 'â' (U+2022)
+#
+__characterNames[u'\u2022'] = _("bullet")
+
+# Translators: this is the spoken word for the character 'â' (U+2023)
+#
+__characterNames[u'\u2023'] = _("triangular bullet")
+
+# Translators: this is the spoken word for the character 'â' (U+2030)
+#
+__characterNames[u'\u2030'] = _("per mille")
+
+# Translators: this is the spoken word for the character 'â' (U+2032)
+#
+__characterNames[u'\u2032'] = _("prime")
+
+# Translators: this is the spoken word for the character 'â' (U+2033)
+#
+__characterNames[u'\u2033'] = _("double prime")
+
+# Translators: this is the spoken word for the character 'â' (U+2043)
+#
+__characterNames[u'\u2043'] = _("hyphen bullet")
+
+# Translators: this is the spoken word for the character 'â' (U+20ac)
+#
+__characterNames[u'\u20ac'] = _("euro")
+
+# Translators: this is the spoken word for the character 'â' (U+2122)
+#
+__characterNames[u'\u2122'] = _("trademark")
+
+# Translators: this is the spoken word for the character 'â' (U+2248)
+#
+__characterNames[u'\u2248'] = _("almost equal to")
+
+# Translators: this is the spoken word for the character 'â' (U+2260)
+#
+__characterNames[u'\u2260'] = _("not equal to")
+
+# Translators: this is the spoken word for the character 'â' (U+2264)
+#
+__characterNames[u'\u2264'] = _("less than or equal to")
+
+# Translators: this is the spoken word for the character 'â' (U+2265)
+#
+__characterNames[u'\u2265'] = _("greater than or equal to")
+
+# Translators: this is the spoken word for the character 'â' (U+221a)
+#
+__characterNames[u'\u221a'] = _("square root")
+
+# Translators: this is the spoken word for the character 'â' (U+221b)
+#
+__characterNames[u'\u221b'] = _("cube root")
+
+# Translators: this is the spoken word for the character 'â' (U+221e)
+#
+__characterNames[u'\u221e'] = _("infinity")
+
+# Translators: this is the spoken word for the character 'â' (U+25a0)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u25a0'] = _("black square")
+
+# Translators: this is the spoken word for the character 'â' (U+25a1)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u25a1'] = _("white square")
+
+# Translators: this is the spoken word for the character 'â' (U+25c6)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u25c6'] = _("black diamond")
+
+# Translators: this is the spoken word for the character 'â' (U+25cb)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u25cb'] = _("white circle")
+
+# Translators: this is the spoken word for the character 'â' (U+25cf)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u25cf'] = _("black circle")
+
+# Translators: this is the spoken word for the character 'â' (U+25e6)
+#
+__characterNames[u'\u25e6'] = _("white bullet")
+
+# Translators: this is the spoken word for the character 'â' (U+2713)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u2713'] = _("check mark")
+
+# Translators: this is the spoken word for the character 'â' (U+2714)
+# It can be used as a bullet in a list.
+#
+__characterNames[u'\u2714'] = _("heavy check mark")
+
+# Translators: this is the spoken word for the character 'x' (U+2717)
+# This symbol is included here because it can be used as a bullet in
+# an OOo list. The goal is to inform the user of the appearance of
+# the bullet, while making it clear that it is a bullet and not simply
+# the typed letter 'x'. "Ballot x" might confuse the user. Hence the
+# use of "x-shaped bullet".
+#
+__characterNames[u'\u2717'] = _("x-shaped bullet")
+
+# Translators: this is the spoken word for the character 'â' (U+2794)
+# This symbol is included here because it can be used as a bullet in
+# an OOo list. The goal is to inform the user of the appearance of
+# the bullet without too much verbiage, hence simply "right-pointing arrow".
+#
+__characterNames[u'\u2974'] = _("right-pointing arrow")
+
+# Translators: this is the spoken word for the character 'â' (U+27a2)
+# This symbol is included here because it can be used as a bullet in an
+# OOo list. The goal is to inform the user of the appearance of the bullet
+# without too much verbiage, hence simply "right-pointing arrowhead".
+#
+__characterNames[u'\u27a2'] = _("right-pointing arrowhead")
+
+# Translators: StarOffice/OOo includes private-use unicode character U+E00A
+# as a bullet which looks like the black square: â (U+25A0). Therefore,
+# please use the same translation for this character.
+#
+__characterNames[u'\ue00a'] = _("black square")
+
+# Translators: StarOffice/OOo includes private-use unicode character U+E00C
+# as a bullet which looks like the black diamond: â (U+25C6). Therefore,
+# please use the same translation for this character.
+#
+__characterNames[u'\ue00c'] = _("black diamond")
+
+def getCharacterName(character):
+ """Given a character, return its name as people might refer to it
+ in ordinary conversation.
+
+ Arguments:
+ - character: the character to get the name for
+
+ Returns a string representing the name for the character
+ """
+
+ if not isinstance(character, unicode):
+ character = character.decode("UTF-8")
+
+ try:
+ return __characterNames[character]
+ except:
+ return character
+
+if __name__ == "__main__":
+ print __characterNames
+ print "Should be black diamond:", getCharacterName(u'\ue00c')
+ print "Should be foo:", getCharacterName("foo")
Added: branches/phase2/src/orca/key_names.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/key_names.py Tue Sep 16 01:16:31 2008
@@ -0,0 +1,264 @@
+# Copyright 2006-2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+
+"""Maps the names of keys from KeyboardEvents into localized words.
+"""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2006-2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import character_names
+
+from orca_i18n import _ # for gettext support
+
+# __keyNames is a dictionary where the keys represent a UTF-8
+# string for a keyboard key and the values represent the common
+# phrase used to describe the key.
+#
+__keyNames = {}
+
+# Translators: this is how someone would speak the name of the left shift key
+#
+__keyNames["Shift_L"] = _("left shift")
+
+# Translators: this is how someone would speak the name of the left alt key
+#
+__keyNames["Alt_L"] = _("left alt")
+
+# Translators: this is how someone would speak the name of the left ctrl key
+#
+__keyNames["Control_L"] = _("left control")
+
+# Translators: this is how someone would speak the name of the right shift key
+#
+__keyNames["Shift_R"] = _("right shift")
+
+# Translators: this is how someone would speak the name of the right alt key
+#
+__keyNames["Alt_R"] = _("right alt")
+
+# Translators: this is how someone would speak the name of the right ctrl key
+#
+__keyNames["Control_R"] = _("right control")
+
+# Translators: this is how someone would speak the name of the left meta key
+#
+__keyNames["Meta_L"] = _("left meta")
+
+# Translators: this is how someone would speak the name of the right meta key
+#
+__keyNames["Meta_R"] = _("right meta")
+
+# Translators: this is how someone would speak the name of the num lock key
+#
+__keyNames["Num_Lock"] = _("num lock")
+
+# Translators: this is how someone would speak the name of the caps lock key
+#
+__keyNames["Caps_Lock"] = _("caps lock")
+
+# Translators: this is how someone would speak the name of the scroll lock key
+#
+__keyNames["Scroll_Lock"] = _("scroll lock")
+
+# Translators: this is how someone would speak the name of the page up key
+#
+__keyNames["Page_Up"] = _("page up")
+
+# Translators: this is how someone would speak the name of the page up key
+#
+__keyNames["KP_Page_Up"] = _("page up")
+
+# Translators: this is how someone would speak the name of the page up key
+#
+__keyNames["Prior"] = _("page up")
+
+# Translators: this is how someone would speak the name of the page up key
+#
+__keyNames["KP_Prior"] = _("page up")
+
+# Translators: this is how someone would speak the name of the page down key
+#
+__keyNames["Page_Down"] = _("page down")
+
+# Translators: this is how someone would speak the name of the page down key
+#
+__keyNames["KP_Page_Down"] = _("page down")
+
+# Translators: this is how someone would speak the name of the page down key
+#
+__keyNames["Next"] = _("page down")
+
+# Translators: this is how someone would speak the name of the page down key
+#
+__keyNames["KP_Next"] = _("page down")
+
+# Translators: this is how someone would speak the name of the tab key
+#
+__keyNames["Tab"] = _("tab")
+
+# Translators: this is how someone would speak the name of the left tab key
+#
+__keyNames["ISO_Left_Tab"] = _("left tab")
+
+# Translators: this is how someone would speak the name of the F11 key
+#
+__keyNames["SunF36"] = _("F 11")
+
+# Translators: this is how someone would speak the name of the F12 key
+#
+__keyNames["SunF37"] = _("F 12")
+
+# Translators: this is the spoken word for the space character
+#
+__keyNames["space"] = _("space")
+
+# Translators: this is how someone would speak the name of the backspace key
+#
+__keyNames["BackSpace"] = _("backspace")
+
+# Translators: this is how someone would speak the name of the return key
+#
+__keyNames["Return"] = _("return")
+
+# Translators: this is how someone would speak the name of the enter key
+#
+__keyNames["KP_Enter"] = _("enter")
+
+# Translators: this is how someone would speak the name of the up arrow key
+#
+__keyNames["Up"] = _("up")
+
+# Translators: this is how someone would speak the name of the up arrow key
+#
+__keyNames["KP_Up"] = _("up")
+
+# Translators: this is how someone would speak the name of the down arrow key
+#
+__keyNames["Down"] = _("down")
+
+# Translators: this is how someone would speak the name of the down arrow key
+#
+__keyNames["KP_Down"] = _("down")
+
+# Translators: this is how someone would speak the name of the left arrow key
+#
+__keyNames["Left"] = _("left")
+
+# Translators: this is how someone would speak the name of the left arrow key
+#
+__keyNames["KP_Left"] = _("left")
+
+# Translators: this is how someone would speak the name of the right arrow key
+#
+__keyNames["Right"] = _("right")
+
+# Translators: this is how someone would speak the name of the right arrow key
+#
+__keyNames["KP_Right"] = _("right")
+
+# Translators: this is how someone would speak the name of the left super key
+#
+__keyNames["Super_L"] = _("left super")
+
+# Translators: this is how someone would speak the name of the right super key
+#
+__keyNames["Super_R"] = _("right super")
+
+# Translators: this is how someone would speak the name of the menu key
+#
+__keyNames["Menu"] = _("menu")
+
+# Translators: this is how someone would speak the name of the ISO shift key
+#
+__keyNames["ISO_Level3_Shift"] = _("ISO level 3 shift")
+
+# Translators: this is how someone would speak the name of the help key
+#
+__keyNames["Help"] = _("help")
+
+# Translators: this is how someone would speak the name of the multi key
+#
+__keyNames["Multi_key"] = _("multi")
+
+# Translators: this is how someone would speak the name of the mode switch key
+#
+__keyNames["Mode_switch"] = _("mode switch")
+
+# Translators: this is how someone would speak the name of the escape key
+#
+__keyNames["Escape"] = _("escape")
+
+# Translators: this is how someone would speak the name of the insert key
+#
+__keyNames["Insert"] = _("insert")
+
+# Translators: this is how someone would speak the name of the insert key
+#
+__keyNames["KP_Insert"] = _("insert")
+
+# Translators: this is how someone would speak the name of the delete key
+#
+__keyNames["Delete"] = _("delete")
+
+# Translators: this is how someone would speak the name of the delete key
+#
+__keyNames["KP_Delete"] = _("delete")
+
+# Translators: this is how someone would speak the name of the home key
+#
+__keyNames["Home"] = _("home")
+
+# Translators: this is how someone would speak the name of the home key
+#
+__keyNames["KP_Home"] = _("home")
+
+# Translators: this is how someone would speak the name of the end key
+#
+__keyNames["End"] = _("end")
+
+# Translators: this is how someone would speak the name of the end key
+#
+__keyNames["KP_End"] = _("end")
+
+# Translators: this is how someone would speak the name of the begin key
+#
+__keyNames["KP_Begin"] = _("begin")
+
+def getKeyName(key):
+ """Given a keyboard key, return its name as people might refer to it
+ in ordinary conversation.
+
+ Arguments:
+ - key: the key to get the name for
+
+ Returns a string representing the name for the key
+ """
+
+ if isinstance(key, unicode):
+ key = key.encode("UTF-8")
+
+ try:
+ return __keyNames[key]
+ except:
+ return character_names.getCharacterName(key)
+
+if __name__ == "__main__":
+ print __keyNames
+ print "Should be mode switch:", getKeyName("Mode_switch")
+ print "Should be foo:", getKeyName("foo")
Added: branches/phase2/src/orca/phonetic_names.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/phonetic_names.py Tue Sep 16 01:16:31 2008
@@ -0,0 +1,86 @@
+# Copyright 2006-2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+
+"""Provides getPhoneticName method that maps each letter of the
+alphabet into its localized phonetic equivalent."""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2006-2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from orca_i18n import _ # for gettext support
+
+# Translators: this is a structure to assist in the generation of
+# spoken military-style spelling. For example, 'abc' becomes 'alpha
+# bravo charlie'.
+#
+# It is a simple structure that consists of pairs of
+#
+# letter : word(s)
+#
+# where the letter and word(s) are separate by colons and each
+# pair is separated by commas. For example, we see:
+#
+# a : alpha, b : bravo, c : charlie,
+#
+# And so on. The complete set should consist of all the letters from
+# the alphabet for your language paired with the common
+# military/phonetic word(s) used to describe that letter.
+#
+# The Wikipedia entry
+# http://en.wikipedia.org/wiki/NATO_phonetic_alphabet has a few
+# interesting tidbits about local conventions in the sections
+# "Additions in German, Danish and Norwegian" and "Variants".
+#
+__phoneList = _("a : alpha, b : bravo, c : charlie, "
+ "d : delta, e : echo, f : foxtrot, "
+ "g : golf, h : hotel, i : india, "
+ "j : juliet, k : kilo, l : lima, "
+ "m : mike, n : november, o : oscar, "
+ "p : papa, q : quebec, r : romeo, "
+ "s : sierra, t : tango, u : uniform, "
+ "v : victor, w : whiskey, x : xray, "
+ "y : yankee, z : zulu")
+
+__phoneNames = {}
+
+for __pair in __phoneList.split(','):
+ __w = __pair.split(':')
+ __phoneNames [__w[0].strip()] = __w[1].strip()
+
+def getPhoneticName(character):
+ """Given a character, return its phonetic name, which is typically
+ the 'military' term used for the character.
+
+ Arguments:
+ - character: the character to get the military name for
+
+ Returns a string representing the military name for the character
+ """
+
+ if isinstance(character, unicode):
+ character = character.encode("UTF-8")
+
+ try:
+ return __phoneNames[character]
+ except:
+ return character
+
+if __name__ == "__main__":
+ print __phoneNames
+ print "Should be alpha:", getPhoneticName("a")
+ print "Should be foo:", getPhoneticName("foo")
Added: branches/phase2/src/orca/rolenames.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/rolenames.py Tue Sep 16 01:16:31 2008
@@ -0,0 +1,1359 @@
+# Copyright 2004-2008 Sun Microsystems Inc.
+# Copyright 2001, 2002 BAUM Retec, A.G.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+
+"""Provides methods that convert the role name of an Accessible
+object into localized strings for speech and braille."""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2004-2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+import logging
+log = logging.getLogger("orca.rolenames")
+
+import pyatspi
+
+import settings
+
+from orca_i18n import _ # for gettext support
+from orca_i18n import Q_ # to provide qualified translatable strings
+
+########################################################################
+# #
+# Rolenames derived from atk/atk/atkobject.c:role_items. #
+# #
+########################################################################
+
+# For backward compatability. The rolenames dictionary will have both
+# numerical AT_SPI role constants as well as role strings.
+#
+ROLE_INVALID = "invalid"
+ROLE_ACCEL_LABEL = "accelerator label"
+ROLE_ALERT = "alert"
+ROLE_ANIMATION = "animation"
+ROLE_ARROW = "arrow"
+ROLE_CALENDAR = "calendar"
+ROLE_CAPTION = "caption"
+ROLE_CANVAS = "canvas"
+ROLE_CHECK_BOX = "check box"
+ROLE_CHECK_MENU_ITEM = "check menu item"
+ROLE_COLOR_CHOOSER = "color chooser"
+ROLE_COLUMN_HEADER = "column header"
+ROLE_COMBO_BOX = "combo box"
+ROLE_DATE_EDITOR = "dateeditor"
+ROLE_DESKTOP_ICON = "desktop icon"
+ROLE_DESKTOP_FRAME = "desktop frame"
+ROLE_DIAL = "dial"
+ROLE_DIALOG = "dialog"
+ROLE_DIRECTORY_PANE = "directory pane"
+ROLE_DOCUMENT_FRAME = "document frame"
+ROLE_DRAWING_AREA = "drawing area"
+ROLE_ENTRY = "entry"
+ROLE_FILE_CHOOSER = "file chooser"
+ROLE_FILLER = "filler"
+ROLE_FONT_CHOOSER = "fontchooser"
+ROLE_FORM = "form"
+ROLE_FRAME = "frame"
+ROLE_GLASS_PANE = "glass pane"
+ROLE_HEADING = "heading"
+ROLE_HTML_CONTAINER = "html container"
+ROLE_ICON = "icon"
+ROLE_IMAGE = "image"
+ROLE_INTERNAL_FRAME = "internal frame"
+ROLE_INPUT_METHOD_WINDOW = "input method window"
+ROLE_LABEL = "label"
+ROLE_LAYERED_PANE = "layered pane"
+ROLE_LINK = "link"
+ROLE_LIST = "list"
+ROLE_LIST_ITEM = "list item"
+ROLE_MENU = "menu"
+ROLE_MENU_BAR = "menu bar"
+ROLE_MENU_ITEM = "menu item"
+ROLE_OPTION_PANE = "option pane"
+ROLE_PAGE_TAB = "page tab"
+ROLE_PAGE_TAB_LIST = "page tab list"
+ROLE_PANEL = "panel"
+ROLE_PASSWORD_TEXT = "password text"
+ROLE_POPUP_MENU = "popup menu"
+ROLE_PROGRESS_BAR = "progress bar"
+ROLE_PUSH_BUTTON = "push button"
+ROLE_RADIO_BUTTON = "radio button"
+ROLE_RADIO_MENU_ITEM = "radio menu item"
+ROLE_ROOT_PANE = "root pane"
+ROLE_ROW_HEADER = "row header"
+ROLE_SCROLL_BAR = "scroll bar"
+ROLE_SCROLL_PANE = "scroll pane"
+ROLE_SECTION = "section"
+ROLE_SEPARATOR = "separator"
+ROLE_SLIDER = "slider"
+ROLE_SPLIT_PANE = "split pane"
+ROLE_SPIN_BOX = "spinbox"
+ROLE_SPIN_BUTTON = "spin button"
+ROLE_STATUSBAR = "statusbar"
+ROLE_TABLE = "table"
+ROLE_TABLE_CELL = "table cell"
+ROLE_TABLE_COLUMN_HEADER = "table column header"
+ROLE_TABLE_ROW_HEADER = "table row header"
+ROLE_TEAR_OFF_MENU_ITEM = "tear off menu item"
+ROLE_TERMINAL = "terminal"
+ROLE_TEXT = "text"
+ROLE_TOGGLE_BUTTON = "toggle button"
+ROLE_TOOL_BAR = "tool bar"
+ROLE_TOOL_TIP = "tool tip"
+ROLE_TREE = "tree"
+ROLE_TREE_TABLE = "tree table"
+ROLE_UNKNOWN = "unknown"
+ROLE_VIEWPORT = "viewport"
+ROLE_WINDOW = "window"
+ROLE_HEADER = "header"
+ROLE_FOOTER = "footer"
+ROLE_PARAGRAPH = "paragraph"
+ROLE_APPLICATION = "application"
+ROLE_AUTOCOMPLETE = "autocomplete"
+ROLE_EDITBAR = "edit bar"
+ROLE_EMBEDDED = "embedded component"
+
+class Rolename:
+ """Provides localized forms of rolenames for speech and Braille.
+ """
+
+ def __init__(self, rolename, brailleShort, brailleLong, speech):
+ """Created a new rolename with the given parameters.
+
+ Arguments:
+ - rolename: the internationalized (e.g., machine) name for the role
+ - brailleShort: the localized short string for Braille display
+ - brailleLong: the localized long string for Braille display
+ - speech: the localized string to speak for speech
+ """
+ self.rolename = rolename
+ self.brailleShort = brailleShort
+ self.brailleLong = brailleLong
+ self.speech = speech
+
+ def __str__(self):
+ return "%s speech=%s brailleShort=%s brailleLong=%s" \
+ % (self.rolename,
+ self.speech,
+ self.brailleShort,
+ self.brailleLong)
+
+# [[[TODO: WDW - the AT-SPI also has getLocalizedRoleName, which might a
+# more appropriate thing to use, as it covers the situation where an app
+# has developed a brand new component with a brand new role. Logged as
+# buzilla bug 319780.]]]
+#
+rolenames = {}
+
+rolenames[ROLE_INVALID] = Rolename(\
+ ROLE_INVALID,
+ # Translators: short braille for the rolename of an invalid GUI object.
+ # We strive to keep it under three characters to preserve real estate.
+ #
+ _("???"),
+ # Translators: long braille for the rolename of an invalid object.
+ # We typically make these 'camel' case.
+ #
+ _("Invalid"),
+ # Translators: spoken words for the rolename of an invalid object.
+ #
+ _("invalid"))
+
+rolenames[ROLE_ACCEL_LABEL] = Rolename(
+ ROLE_ACCEL_LABEL,
+ # Translators: short braille for an accelerator (what you see in a menu).
+ # We strive to keep it under three characters to preserve real estate.
+ #
+ _("acc"),
+ # Translators: long braille for an accelerator (what you see in a menu).
+ # We typically make these 'camel' case.
+ #
+ _("Accelerator"),
+ # Translators: spoken words for an accelerator (what you see in a menu).
+ #
+ _("accelerator"))
+
+rolenames[ROLE_ALERT] = Rolename(
+ ROLE_ALERT,
+ # Translators: short braille for the rolename of an alert dialog.
+ # NOTE for all the short braille words: they we strive to keep them
+ # around three characters to preserve real estate on the braille
+ # display. The letters are chosen to make them unique across all
+ # other rolenames, and they typically act like an abbreviation.
+ #
+ _("alrt"),
+ # Translators: long braille for the rolename of an alert dialog.
+ # NOTE for all the long braille words: we typically make them
+ # 'camel' case -- multiple words are bunched together with no
+ # spaces between them and the first letter of each word is
+ # capitalized.
+ #
+ _("Alert"),
+ # Translators: spoken words for the rolename of an alert dialog.
+ # NOTE for all the spoken words: these are the words one would use
+ # when speaking.
+ #
+ _("alert"))
+
+rolenames[ROLE_ANIMATION] = Rolename(
+ ROLE_ANIMATION,
+ # Translators: short braille for the rolename of an animation widget.
+ #
+ _("anim"),
+ # Translators: long braille for the rolename of an animation widget.
+ #
+ _("Animation"),
+ # Translators: spoken words for the rolename of an animation widget.
+ #
+ _("animation"))
+
+rolenames[ROLE_ARROW] = Rolename(
+ ROLE_ARROW,
+ # Translators: short braille for the rolename of an arrow widget.
+ #
+ _("arw"),
+ # Translators: long braille for the rolename of an animation widget.
+ #
+ _("Arrow"),
+ # Translators: spoken words for the rolename of an animation widget.
+ #
+ _("arrow"))
+
+rolenames[ROLE_CALENDAR] = Rolename(
+ ROLE_CALENDAR,
+ # Translators: short braille for the rolename of a calendar widget.
+ #
+ _("cal"),
+ # Translators: long braille for the rolename of a calendar widget.
+ #
+ _("Calendar"),
+ # Translators: spoken words for the rolename of a calendar widget.
+ #
+ _("calendar"))
+
+rolenames[ROLE_CANVAS] = Rolename(
+ ROLE_CANVAS,
+ # Translators: short braille for the rolename of a canvas widget.
+ #
+ _("cnv"),
+ # Translators: long braille for the rolename of a canvas widget.
+ #
+ _("Canvas"),
+ # Translators: spoken words for the rolename of a canvas widget.
+ #
+ _("canvas"))
+
+rolenames[ROLE_CAPTION] = Rolename(
+ ROLE_CAPTION,
+ # Translators: short braille for the rolename of a caption (e.g.,
+ # table caption).
+ #
+ _("cptn"),
+ # Translators: long braille for the rolename of a caption (e.g.,
+ # table caption).
+ #
+ _("Caption"),
+ # Translators: spoken words for the rolename of a caption (e.g.,
+ # table caption).
+ #
+ _("caption"))
+
+rolenames[ROLE_CHECK_BOX] = Rolename(
+ ROLE_CHECK_BOX,
+ # Translators: short braille for the rolename of a checkbox.
+ #
+ _("chk"),
+ # Translators: long braille for the rolename of a checkbox.
+ #
+ _("CheckBox"),
+ # Translators: spoken words for the rolename of a checkbox.
+ #
+ _("check box"))
+
+rolenames[ROLE_CHECK_MENU_ITEM] = Rolename(
+ ROLE_CHECK_MENU_ITEM,
+ # Translators: short braille for the rolename of a check menu item.
+ #
+ _("chk"),
+ # Translators: long braille for the rolename of a check menu item.
+ #
+ _("CheckItem"),
+ # Translators: spoken words for the rolename of a check menu item.
+ #
+ _("check item"))
+
+rolenames[ROLE_COLOR_CHOOSER] = Rolename(
+ ROLE_COLOR_CHOOSER,
+ # Translators: short braille for the rolename of a color chooser.
+ #
+ _("clrchsr"),
+ # Translators: long braille for the rolename of a color chooser.
+ #
+ _("ColorChooser"),
+ # Translators: spoken words for the rolename of a color chooser.
+ #
+ _("color chooser"))
+
+rolenames[ROLE_COLUMN_HEADER] = Rolename(
+ ROLE_COLUMN_HEADER,
+ # Translators: short braille for the rolename of a column header.
+ #
+ _("colhdr"),
+ # Translators: long braille for the rolename of a column header.
+ #
+ _("ColumnHeader"),
+ # Translators: spoken words for the rolename of a column header.
+ #
+ _("column header"))
+
+rolenames[ROLE_COMBO_BOX] = Rolename(
+ ROLE_COMBO_BOX,
+ # Translators: short braille for the rolename of a combo box.
+ #
+ _("cbo"),
+ # Translators: long braille for the rolename of a combo box.
+ #
+ _("Combo"),
+ # Translators: spoken words for the rolename of a combo box.
+ #
+ _("combo box"))
+
+rolenames[ROLE_DATE_EDITOR] = Rolename(
+ ROLE_DATE_EDITOR,
+ # Translators: short braille for the rolename of a date editor.
+ #
+ _("dat"),
+ # Translators: long braille for the rolename of a date editor.
+ #
+ _("DateEditor"),
+ # Translators: spoken words for the rolename of a date editor.
+ #
+ _("date editor"))
+
+rolenames[ROLE_DESKTOP_ICON] = Rolename(
+ ROLE_DESKTOP_ICON,
+ # Translators: short braille for the rolename of a desktop icon.
+ #
+ _("icn"),
+ # Translators: long braille for the rolename of a desktop icon.
+ #
+ _("DesktopIcon"),
+ # Translators: spoken words for the rolename of a desktop icon.
+ #
+ _("desktop icon"))
+
+rolenames[ROLE_DESKTOP_FRAME] = Rolename(
+ ROLE_DESKTOP_FRAME,
+ # Translators: short braille for the rolename of a desktop frame.
+ #
+ _("frm"),
+ # Translators: long braille for the rolename of a desktop frame.
+ #
+ _("DesktopFrame"),
+ # Translators: spoken words for the rolename of a desktop frame.
+ #
+ _("desktop frame"))
+
+rolenames[ROLE_DIAL] = Rolename(
+ ROLE_DIAL,
+ # Translators: short braille for the rolename of a dial.
+ # You should attempt to treat it as an abbreviation of
+ # the translated word for "dial". It is OK to use an
+ # unabbreviated word as long as it is relatively short.
+ #
+ # ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+ #
+ Q_("shortbraille|dial"),
+ # Translators: long braille for the rolename of a dial.
+ #
+ _("Dial"),
+ # Translators: spoken words for the rolename of a dial.
+ #
+ _("dial"))
+
+rolenames[ROLE_DIALOG] = Rolename(
+ ROLE_DIALOG,
+ # Translators: short braille for the rolename of a dialog.
+ #
+ _("dlg"),
+ # Translators: long braille for the rolename of a dialog.
+ #
+ _("Dialog"),
+ # Translators: spoken words for the rolename of a dialog.
+ #
+ _("dialog"))
+
+rolenames[ROLE_DIRECTORY_PANE] = Rolename(
+ ROLE_DIRECTORY_PANE,
+ # Translators: short braille for the rolename of a directory pane.
+ #
+ _("dip"),
+ # Translators: long braille for the rolename of a directory pane.
+ #
+ _("DirectoryPane"),
+ # Translators: spoken words for the rolename of a directory pane.
+ #
+ _("directory pane"))
+
+rolenames[ROLE_DOCUMENT_FRAME] = Rolename(
+ ROLE_DOCUMENT_FRAME,
+ # Translators: short braille for the rolename of an HTML document frame.
+ #
+ _("html"),
+ # Translators: long braille for the rolename of an HTML document frame.
+ #
+ _("HtmlPane"),
+ # Translators: spoken words for the rolename of an HTML document frame.
+ #
+ _("html content"))
+
+rolenames[ROLE_DRAWING_AREA] = Rolename(
+ ROLE_DRAWING_AREA,
+ # Translators: short braille for the rolename of a drawing area.
+ #
+ _("draw"),
+ # Translators: long braille for the rolename of a drawing area.
+ #
+ _("DrawingArea"),
+ # Translators: spoken words for the rolename of a drawing area.
+ #
+ _("drawing area"))
+
+rolenames[ROLE_FILE_CHOOSER] = Rolename(
+ ROLE_FILE_CHOOSER,
+ # Translators: short braille for the rolename of a file chooser.
+ #
+ _("fchsr"),
+ # Translators: long braille for the rolename of a file chooser.
+ #
+ _("FileChooser"),
+ # Translators: spoken words for the rolename of a file chooser.
+ #
+ _("file chooser"))
+
+rolenames[ROLE_FILLER] = Rolename(
+ ROLE_FILLER,
+ # Translators: short braille for the rolename of a filler.
+ #
+ _("flr"),
+ # Translators: long braille for the rolename of a filler.
+ #
+ _("Filler"),
+ # Translators: spoken words for the rolename of a filler.
+ #
+ _("filler"))
+
+rolenames[ROLE_FONT_CHOOSER] = Rolename(
+ ROLE_FONT_CHOOSER,
+ # Translators: short braille for the rolename of a font chooser.
+ #
+ _("fnt"),
+ # Translators: long braille for the rolename of a font chooser.
+ #
+ _("FontChooser"),
+ # Translators: spoken words for the rolename of a font chooser.
+ #
+ _("font chooser"))
+
+rolenames[ROLE_FORM] = Rolename(
+ ROLE_FORM,
+ # Translators: short braille for the rolename of a form.
+ # You should attempt to treat it as an abbreviation of
+ # the translated word for "form". It is OK to use an
+ # unabbreviated word as long as it is relatively short.
+ #
+ # ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+ #
+ Q_("shortbraille|form"),
+ # Translators: long braille for the rolename of a form.
+ #
+ _("Form"),
+ # Translators: spoken words for the rolename of a form.
+ #
+ _("form"))
+
+rolenames[ROLE_FRAME] = Rolename(
+ ROLE_FRAME,
+ # Translators: short braille for the rolename of a frame.
+ #
+ _("frm"),
+ # Translators: long braille for the rolename of a frame.
+ #
+ _("Frame"),
+ # Translators: spoken words for the rolename of a frame.
+ #
+ _("frame"))
+
+rolenames[ROLE_GLASS_PANE] = Rolename(
+ ROLE_GLASS_PANE,
+ # Translators: short braille for the rolename of a glass pane.
+ #
+ _("gpn"),
+ # Translators: long braille for the rolename of a glass pane.
+ #
+ _("GlassPane"),
+ # Translators: spoken words for the rolename of a glass pane.
+ #
+ _("glass pane"))
+
+rolenames[ROLE_HEADING] = Rolename(
+ ROLE_HEADING,
+ # Translators: short braille for the rolename of a heading.
+ #
+ _("hdng"),
+ # Translators: long braille for the rolename of a heading.
+ #
+ _("Heading"),
+ # Translators: spoken words for the rolename of a heading.
+ #
+ _("heading"))
+
+rolenames[ROLE_HTML_CONTAINER] = Rolename(
+ ROLE_HTML_CONTAINER,
+ # Translators: short braille for the rolename of an html container.
+ #
+ _("html"),
+ # Translators: long braille for the rolename of an html container.
+ #
+ _("HtmlContainer"),
+ # Translators: spoken words for the rolename of an html container.
+ #
+ _("h t m l container"))
+
+rolenames[ROLE_ICON] = Rolename(
+ ROLE_ICON,
+ # Translators: short braille for the rolename of a icon.
+ #
+ _("icn"),
+ # Translators: long braille for the rolename of a icon.
+ #
+ _("Icon"),
+ # Translators: spoken words for the rolename of a icon.
+ #
+ _("icon"))
+
+rolenames[ROLE_IMAGE] = Rolename(
+ ROLE_IMAGE,
+ # Translators: short braille for the rolename of a image.
+ #
+ _("img"),
+ # Translators: long braille for the rolename of a image.
+ #
+ _("Image"),
+ # Translators: spoken words for the rolename of a image.
+ #
+ _("image"))
+
+rolenames[ROLE_INTERNAL_FRAME] = Rolename(
+ ROLE_INTERNAL_FRAME,
+ # Translators: short braille for the rolename of an internal frame.
+ #
+ _("ifrm"),
+ # Translators: long braille for the rolename of an internal frame.
+ #
+ _("InternalFrame"),
+ # Translators: spoken words for the rolename of an internal frame.
+ #
+ _("internal frame"))
+
+rolenames[ROLE_LABEL] = Rolename(
+ ROLE_LABEL,
+ # Translators: short braille for the rolename of a label.
+ #
+ _("lbl"),
+ # Translators: long braille for the rolename of a label.
+ #
+ _("Label"),
+ # Translators: spoken words for the rolename of a label.
+ #
+ _("label"))
+
+rolenames[ROLE_LAYERED_PANE] = Rolename(
+ ROLE_LAYERED_PANE,
+ # Translators: short braille for the rolename of a layered pane.
+ #
+ _("lyrdpn"),
+ # Translators: long braille for the rolename of a layered pane.
+ #
+ _("LayeredPane"),
+ # Translators: spoken words for the rolename of a layered pane.
+ #
+ _("layered pane"))
+
+rolenames[ROLE_LINK] = Rolename(
+ ROLE_LINK,
+ # Translators: short braille for the rolename of a link.
+ #
+ _("lnk"),
+ # Translators: long braille for the rolename of a link.
+ #
+ _("Link"),
+ # Translators: spoken words for the rolename of a link.
+ #
+ _("link"))
+
+rolenames[ROLE_LIST] = Rolename(
+ ROLE_LIST,
+ # Translators: short braille for the rolename of a list.
+ #
+ _("lst"),
+ # Translators: long braille for the rolename of a list.
+ #
+ _("List"),
+ # Translators: spoken words for the rolename of a list.
+ #
+ _("list"))
+
+rolenames[ROLE_LIST_ITEM] = Rolename(
+ ROLE_LIST_ITEM,
+ # Translators: short braille for the rolename of a list item.
+ #
+ _("lstitm"),
+ # Translators: long braille for the rolename of a list item.
+ #
+ _("ListItem"),
+ # Translators: spoken words for the rolename of a list item.
+ #
+ _("list item"))
+
+rolenames[ROLE_MENU] = Rolename(
+ ROLE_MENU,
+ # Translators: short braille for the rolename of a menu.
+ #
+ _("mnu"),
+ # Translators: long braille for the rolename of a menu.
+ #
+ _("Menu"),
+ # Translators: spoken words for the rolename of a menu.
+ #
+ _("menu"))
+
+rolenames[ROLE_MENU_BAR] = Rolename(
+ ROLE_MENU_BAR,
+ # Translators: short braille for the rolename of a menu bar.
+ #
+ _("mnubr"),
+ # Translators: long braille for the rolename of a menu bar.
+ #
+ _("MenuBar"),
+ # Translators: spoken words for the rolename of a menu bar.
+ #
+ _("menu bar"))
+
+rolenames[ROLE_MENU_ITEM] = Rolename(
+ ROLE_MENU_ITEM,
+ # Translators: short braille for the rolename of a menu item.
+ #
+ _("mnuitm"),
+ # Translators: long braille for the rolename of a menu item.
+ #
+ _("MenuItem"),
+ # Translators: spoken words for the rolename of a menu item.
+ #
+ _("menu item"))
+
+rolenames[ROLE_OPTION_PANE] = Rolename(
+ ROLE_OPTION_PANE,
+ # Translators: short braille for the rolename of an option pane.
+ #
+ _("optnpn"),
+ # Translators: long braille for the rolename of an option pane.
+ #
+ _("OptionPane"),
+ # Translators: spoken words for the rolename of an option pane.
+ #
+ _("option pane"))
+
+rolenames[ROLE_PAGE_TAB] = Rolename(
+ ROLE_PAGE_TAB,
+ # Translators: short braille for the rolename of a page tab.
+ #
+ _("pgt"),
+ # Translators: long braille for the rolename of a page tab.
+ #
+ _("Page"),
+ # Translators: spoken words for the rolename of a page tab.
+ #
+ _("page"))
+
+rolenames[ROLE_PAGE_TAB_LIST] = Rolename(
+ ROLE_PAGE_TAB_LIST,
+ # Translators: short braille for the rolename of a page tab list.
+ #
+ _("tblst"),
+ # Translators: long braille for the rolename of a page tab list.
+ #
+ _("TabList"),
+ # Translators: spoken words for the rolename of a page tab list.
+ #
+ _("tab list"))
+
+rolenames[ROLE_PANEL] = Rolename(
+ ROLE_PANEL,
+ # Translators: short braille for the rolename of a panel.
+ #
+ _("pnl"),
+ # Translators: long braille for the rolename of a panel.
+ #
+ _("Panel"),
+ # Translators: spoken words for the rolename of a panel.
+ #
+ _("panel"))
+
+rolenames[ROLE_PASSWORD_TEXT] = Rolename(
+ ROLE_PASSWORD_TEXT,
+ # Translators: short braille for the rolename of a password field.
+ #
+ _("pwd"),
+ # Translators: long braille for the rolename of a password field.
+ #
+ _("Password"),
+ # Translators: spoken words for the rolename of a password field.
+ #
+ _("password"))
+
+rolenames[ROLE_POPUP_MENU] = Rolename(
+ ROLE_POPUP_MENU,
+ # Translators: short braille for the rolename of a popup menu.
+ #
+ _("popmnu"),
+ # Translators: long braille for the rolename of a popup menu.
+ #
+ _("PopupMenu"),
+ # Translators: spoken words for the rolename of a popup menu.
+ #
+ _("popup menu"))
+
+rolenames[ROLE_PROGRESS_BAR] = Rolename(
+ ROLE_PROGRESS_BAR,
+ # Translators: short braille for the rolename of a progress bar.
+ #
+ _("pgbar"),
+ # Translators: long braille for the rolename of a progress bar.
+ #
+ _("Progress"),
+ # Translators: spoken words for the rolename of a progress bar.
+ #
+ _("progress bar"))
+
+rolenames[ROLE_PUSH_BUTTON] = Rolename(
+ ROLE_PUSH_BUTTON,
+ # Translators: short braille for the rolename of a push button.
+ #
+ _("btn"),
+ # Translators: long braille for the rolename of a push button.
+ #
+ _("Button"),
+ # Translators: spoken words for the rolename of a push button.
+ #
+ _("button"))
+
+rolenames[ROLE_RADIO_BUTTON] = Rolename(
+ ROLE_RADIO_BUTTON,
+ # Translators: short braille for the rolename of a radio button.
+ #
+ _("radio"),
+ # Translators: long braille for the rolename of a radio button.
+ #
+ _("RadioButton"),
+ # Translators: spoken words for the rolename of a radio button.
+ #
+ _("radio button"))
+
+rolenames[ROLE_RADIO_MENU_ITEM] = Rolename(
+ ROLE_RADIO_MENU_ITEM,
+ # Translators: short braille for the rolename of a radio menu item.
+ #
+ _("rdmnuitm"),
+ # Translators: long braille for the rolename of a radio menu item.
+ #
+ _("RadioItem"),
+ # Translators: spoken words for the rolename of a radio menu item.
+ #
+ _("radio menu item"))
+
+rolenames[ROLE_ROOT_PANE] = Rolename(
+ ROLE_ROOT_PANE,
+ # Translators: short braille for the rolename of a root pane.
+ #
+ _("rtpn"),
+ # Translators: long braille for the rolename of a root pane.
+ #
+ _("RootPane"),
+ # Translators: spoken words for the rolename of a root pane.
+ #
+ _("root pane"))
+
+rolenames[ROLE_ROW_HEADER] = Rolename(
+ ROLE_ROW_HEADER,
+ # Translators: short braille for the rolename of a row header.
+ #
+ _("rwhdr"),
+ # Translators: long braille for the rolename of a row header.
+ #
+ _("RowHeader"),
+ # Translators: spoken words for the rolename of a row header.
+ #
+ _("row header"))
+
+rolenames[ROLE_SCROLL_BAR] = Rolename(
+ ROLE_SCROLL_BAR,
+ # Translators: short braille for the rolename of a scroll bar.
+ #
+ _("scbr"),
+ # Translators: long braille for the rolename of a scroll bar.
+ #
+ _("ScrollBar"),
+ # Translators: spoken words for the rolename of a scroll bar.
+ #
+ _("scroll bar"))
+
+rolenames[ROLE_SCROLL_PANE] = Rolename(
+ ROLE_SCROLL_PANE,
+ # Translators: short braille for the rolename of a scroll pane.
+ #
+ _("scpn"),
+ # Translators: long braille for the rolename of a scroll pane.
+ #
+ _("ScrollPane"),
+ # Translators: spoken words for the rolename of a scroll pane.
+ #
+ _("scroll pane"))
+
+rolenames[ROLE_SECTION] = Rolename(
+ ROLE_SECTION,
+ # Translators: short braille for the rolename of a section (e.g., in html).
+ #
+ _("sctn"),
+ # Translators: long braille for the rolename of a section (e.g., in html).
+ #
+ _("Section"),
+ # Translators: spoken words for the rolename of a section (e.g., in html).
+ #
+ _("section"))
+
+rolenames[ROLE_SEPARATOR] = Rolename(
+ ROLE_SEPARATOR,
+ # Translators: short braille for the rolename of a separator.
+ #
+ _("seprtr"),
+ # Translators: long braille for the rolename of a separator.
+ #
+ _("Separator"),
+ # Translators: spoken words for the rolename of a separator.
+ #
+ _("separator"))
+
+rolenames[ROLE_SLIDER] = Rolename(
+ ROLE_SLIDER,
+ # Translators: short braille for the rolename of a slider.
+ #
+ _("sldr"),
+ # Translators: long braille for the rolename of a slider.
+ #
+ _("Slider"),
+ # Translators: spoken words for the rolename of a slider.
+ #
+ _("slider"))
+
+rolenames[ROLE_SPLIT_PANE] = Rolename(
+ ROLE_SPLIT_PANE,
+ # Translators: short braille for the rolename of a split pane.
+ #
+ _("spltpn"),
+ # Translators: long braille for the rolename of a split pane.
+ #
+ _("SplitPane"),
+ # Translators: spoken words for the rolename of a split pane.
+ #
+ _("split pane"))
+
+rolenames[ROLE_SPIN_BUTTON] = Rolename(
+ ROLE_SPIN_BUTTON,
+ # Translators: short braille for the rolename of a spin button.
+ #
+ _("spin"),
+ # Translators: long braille for the rolename of a spin button.
+ #
+ _("SpinButton"),
+ # Translators: spoken words for the rolename of a spin button.
+ #
+ _("spin button"))
+
+rolenames[ROLE_STATUSBAR] = Rolename(
+ ROLE_STATUSBAR,
+ # Translators: short braille for the rolename of a statusbar.
+ #
+ _("statbr"),
+ # Translators: long braille for the rolename of a statusbar.
+ #
+ _("StatusBar"),
+ # Translators: spoken words for the rolename of a statusbar.
+ #
+ _("status bar"))
+
+rolenames[ROLE_TABLE] = Rolename(
+ ROLE_TABLE,
+ # Translators: short braille for the rolename of a table.
+ #
+ _("tbl"),
+ # Translators: long braille for the rolename of a table.
+ #
+ _("Table"),
+ # Translators: spoken words for the rolename of a table.
+ #
+ _("table"))
+
+rolenames[ROLE_TABLE_CELL] = Rolename(
+ ROLE_TABLE_CELL,
+ # Translators: short braille for the rolename of a table cell.
+ #
+ _("cll"),
+ # Translators: long braille for the rolename of a table cell.
+ #
+ _("Cell"),
+ # Translators: spoken words for the rolename of a table cell.
+ #
+ _("cell"))
+
+rolenames[ROLE_TABLE_COLUMN_HEADER] = Rolename(
+ ROLE_TABLE_COLUMN_HEADER,
+ # Translators: short braille for the rolename of a table column header.
+ #
+ _("colhdr"),
+ # Translators: long braille for the rolename of a table column header.
+ #
+ _("ColumnHeader"),
+ # Translators: spoken words for the rolename of a table column header.
+ #
+ _("column header"))
+
+rolenames[ROLE_TABLE_ROW_HEADER] = Rolename(
+ ROLE_TABLE_ROW_HEADER,
+ # Translators: short braille for the rolename of a table row header.
+ #
+ _("rwhdr"),
+ # Translators: long braille for the rolename of a table row header.
+ #
+ _("RowHeader"),
+ # Translators: spoken words for the rolename of a table row header.
+ #
+ _("row header"))
+
+rolenames[ROLE_TEAR_OFF_MENU_ITEM] = Rolename(
+ ROLE_TEAR_OFF_MENU_ITEM,
+ # Translators: short braille for the rolename of a tear off menu item.
+ #
+ _("tomnuitm"),
+ # Translators: long braille for the rolename of a tear off menu item.
+ #
+ _("TearOffMenuItem"),
+ # Translators: spoken words for the rolename of a tear off menu item.
+ #
+ _("tear off menu item"))
+
+rolenames[ROLE_TERMINAL] = Rolename(
+ ROLE_TERMINAL,
+ # Translators: short braille for the rolename of a terminal.
+ #
+ _("term"),
+ # Translators: long braille for the rolename of a terminal.
+ #
+ _("Terminal"),
+ # Translators: spoken words for the rolename of a terminal.
+ #
+ _("terminal"))
+
+rolenames[ROLE_TEXT] = Rolename(
+ ROLE_TEXT,
+ # Translators: short braille for the rolename of a text entry field.
+ #
+ _("txt"),
+ # Translators: long braille for the rolename of a text entry field.
+ #
+ _("Text"),
+ # Translators: spoken words for the rolename of a text entry field.
+ #
+ _("text"))
+
+rolenames[ROLE_ENTRY] = rolenames[ROLE_TEXT]
+
+rolenames[ROLE_TOGGLE_BUTTON] = Rolename(
+ ROLE_TOGGLE_BUTTON,
+ # Translators: short braille for the rolename of a toggle button.
+ #
+ _("tglbtn"),
+ # Translators: long braille for the rolename of a toggle button.
+ #
+ _("ToggleButton"),
+ # Translators: spoken words for the rolename of a toggle button.
+ #
+ _("toggle button"))
+
+rolenames[ROLE_TOOL_BAR] = Rolename(
+ ROLE_TOOL_BAR,
+ # Translators: short braille for the rolename of a toolbar.
+ #
+ _("tbar"),
+ # Translators: long braille for the rolename of a toolbar.
+ #
+ _("ToolBar"),
+ # Translators: spoken words for the rolename of a toolbar.
+ #
+ _("tool bar"))
+
+rolenames[ROLE_TOOL_TIP] = Rolename(
+ ROLE_TOOL_TIP,
+ # Translators: short braille for the rolename of a tooltip.
+ #
+ _("tip"),
+ # Translators: long braille for the rolename of a tooltip.
+ #
+ _("ToolTip"),
+ # Translators: spoken words for the rolename of a tooltip.
+ #
+ _("tool tip"))
+
+rolenames[ROLE_TREE] = Rolename(
+ ROLE_TREE,
+ # Translators: short braille for the rolename of a tree.
+ #
+ _("tre"),
+ # Translators: long braille for the rolename of a tree.
+ #
+ _("Tree"),
+ # Translators: spoken words for the rolename of a tree.
+ #
+ _("tree"))
+
+rolenames[ROLE_TREE_TABLE] = Rolename(
+ ROLE_TREE_TABLE,
+ # Translators: short braille for the rolename of a tree table.
+ #
+ _("trtbl"),
+ # Translators: long braille for the rolename of a tree table.
+ #
+ _("TreeTable"),
+ # Translators: spoken words for the rolename of a tree table.
+ #
+ _("tree table"))
+
+rolenames[ROLE_UNKNOWN] = Rolename(
+ ROLE_UNKNOWN,
+ # Translators: short braille for when the rolename of an object is unknown.
+ #
+ _("unk"),
+ # Translators: long braille for when the rolename of an object is unknown.
+ #
+ _("Unknown"),
+ # Translators: spoken words for when the rolename of an object is unknown.
+ #
+ _("unknown"))
+
+rolenames[ROLE_VIEWPORT] = Rolename(
+ ROLE_VIEWPORT,
+ # Translators: short braille for the rolename of a viewport.
+ #
+ _("vwprt"),
+ # Translators: long braille for the rolename of a viewport.
+ #
+ _("Viewport"),
+ # Translators: spoken words for the rolename of a viewport.
+ #
+ _("viewport"))
+
+rolenames[ROLE_WINDOW] = Rolename(
+ ROLE_WINDOW,
+ # Translators: short braille for the rolename of a window.
+ #
+ _("wnd"),
+ # Translators: long braille for the rolename of a window.
+ #
+ _("Window"),
+ # Translators: spoken words for the rolename of a window.
+ #
+ _("window"))
+
+rolenames[ROLE_HEADER] = Rolename(
+ ROLE_HEADER,
+ # Translators: short braille for the rolename of a header.
+ #
+ _("hdr"),
+ # Translators: long braille for the rolename of a header.
+ #
+ _("Header"),
+ # Translators: spoken words for the rolename of a header.
+ #
+ _("header"))
+
+rolenames[ROLE_FOOTER] = Rolename(
+ ROLE_FOOTER,
+ # Translators: short braille for the rolename of a footer.
+ #
+ _("ftr"),
+ # Translators: long braille for the rolename of a footer.
+ #
+ _("Footer"),
+ # Translators: spoken words for the rolename of a footer.
+ #
+ _("footer"))
+
+rolenames[ROLE_PARAGRAPH] = Rolename(
+ ROLE_PARAGRAPH,
+ # Translators: short braille for the rolename of a paragraph.
+ #
+ _("para"),
+ # Translators: long braille for the rolename of a paragraph.
+ #
+ _("Paragraph"),
+ # Translators: spoken words for the rolename of a paragraph.
+ #
+ _("paragraph"))
+
+rolenames[ROLE_APPLICATION] = Rolename(
+ ROLE_APPLICATION,
+ # Translators: short braille for the rolename of a application.
+ #
+ _("app"),
+ # Translators: long braille for the rolename of a application.
+ #
+ _("Application"),
+ # Translators: spoken words for the rolename of a application.
+ #
+ _("application"))
+
+rolenames[ROLE_AUTOCOMPLETE] = Rolename(
+ ROLE_AUTOCOMPLETE,
+ # Translators: short braille for the rolename of a autocomplete.
+ #
+ _("auto"),
+ # Translators: long braille for the rolename of a autocomplete.
+ #
+ _("AutoComplete"),
+ # Translators: spoken words for the rolename of a autocomplete.
+ #
+ _("autocomplete"))
+
+rolenames[ROLE_EDITBAR] = Rolename(
+ ROLE_EDITBAR,
+ # Translators: short braille for the rolename of an editbar.
+ #
+ _("edtbr"),
+ # Translators: long braille for the rolename of an editbar.
+ #
+ _("EditBar"),
+ # Translators: spoken words for the rolename of an editbar.
+ #
+ _("edit bar"))
+
+rolenames[ROLE_EMBEDDED] = Rolename(
+ ROLE_EMBEDDED,
+ # Translators: short braille for the rolename of an embedded component.
+ #
+ _("emb"),
+ # Translators: long braille for the rolename of an embedded component.
+ #
+ _("EmbeddedComponent"),
+ # Translators: spoken words for the rolename of an embedded component.
+ #
+ _("embedded component"))
+
+
+# For backward compatability. The rolenames dictionary will have both
+# numerical AT_SPI role constants as well as role strings. This adds
+# in the strings.
+#
+_legacy_rolename_keys = rolenames.keys()
+for sym in dir(pyatspi):
+ if sym.startswith('ROLE_'):
+ possible_key = sym.replace('ROLE_','').replace('_','').lower()
+ for key in _legacy_rolename_keys:
+ if key.replace(' ','') == possible_key:
+ pyatspi_role = getattr(pyatspi, sym)
+ rolenames[pyatspi_role] = rolenames[key]
+
+def getSpeechForRoleName(obj, role=None):
+ """Returns the localized name of the given Accessible object; the name is
+ suitable to be spoken. If a localized name cannot be discovered, this
+ will return the string as defined by the at-spi.
+
+ Arguments:
+ - obj: an Accessible object
+
+ Returns a string containing the localized name of the object suitable
+ to be spoken.
+ """
+ role = role or obj.getRole()
+
+ # Return fake "menu" role names.
+ #
+ if (role == pyatspi.ROLE_MENU_ITEM) \
+ and (obj.childCount > 0):
+ role = ROLE_MENU
+
+ # If the enum is not in the dictionary, check by name.
+ #
+ try:
+ role_entry = \
+ rolenames.get(role) or rolenames.get(obj.getRoleName())
+ except:
+ role_entry = None
+
+ if role_entry:
+ return role_entry.speech
+ else:
+ log.warning("No rolename for %s" % repr(role))
+ try:
+ localizedRoleName = obj.getLocalizedRoleName()
+ except:
+ localizedRoleName = None
+ if localizedRoleName and len(localizedRoleName):
+ return localizedRoleName
+ else:
+ return repr(role)
+
+def getShortBrailleForRoleName(obj, role=None):
+ """Returns the localized name of the given Accessible object; the name is
+ a short string suitable for a Braille display. If a localized name cannot
+ be discovered, this will return the string as defined by the at-spi.
+
+ Arguments:
+ - obj: an Accessible object
+
+ Returns a short string containing the localized name of the object
+ suitable for a Braille display.
+ """
+ role = role or obj.getRole()
+
+ # Return fake "menu" role names.
+ #
+ if (role == pyatspi.ROLE_MENU_ITEM) \
+ and (obj.childCount > 0):
+ role = ROLE_MENU
+
+ # If the enum is not in the dictionary, check by name.
+ #
+ try:
+ role_entry = \
+ rolenames.get(role) or rolenames.get(obj.getRoleName())
+ except:
+ role_entry = None
+
+ if role_entry:
+ return role_entry.brailleShort
+ else:
+ log.warning("No rolename for %s" % repr(role))
+ try:
+ localizedRoleName = obj.getLocalizedRoleName()
+ except:
+ localizedRoleName = None
+ if localizedRoleName and len(localizedRoleName):
+ return localizedRoleName
+ else:
+ return repr(role)
+
+def getLongBrailleForRoleName(obj, role=None):
+ """Returns the localized name of the given Accessible object; the name is
+ a long string suitable for a Braille display. If a localized name cannot
+ be discovered, this will return the string as defined by the at-spi.
+
+ Arguments:
+ - obj: an Accessible object
+
+ Returns a string containing the localized name of the object suitable for
+ a Braille display.
+ """
+ role = role or obj.getRole()
+
+ # Return fake "menu" role names.
+ #
+ if (role == pyatspi.ROLE_MENU_ITEM) \
+ and (obj.childCount > 0):
+ role = ROLE_MENU
+
+ # If the enum is not in the dictionary, check by name.
+ #
+ try:
+ role_entry = \
+ rolenames.get(role) or rolenames.get(obj.getRoleName())
+ except:
+ role_entry = None
+
+ if role_entry:
+ return role_entry.brailleLong
+ else:
+ log.warning("No rolename for %s" % repr(role))
+ try:
+ localizedRoleName = obj.getLocalizedRoleName()
+ except:
+ localizedRoleName = None
+ if localizedRoleName and len(localizedRoleName):
+ return localizedRoleName
+ else:
+ return repr(role)
+
+def getBrailleForRoleName(obj,
+ role=None,
+ style=settings.BRAILLE_ROLENAME_STYLE_LONG):
+ """Returns the localized name of the given Accessible object; the name is
+ a string suitable for a Braille display. If a localized name cannot
+ be discovered, this will return the string as defined by the at-spi.
+
+ Arguments:
+ - obj: an Accessible object
+ - role: an optional role to override the role of the object
+ - style: settings.BRAILLE_ROLENAME_STYLE_{LONG,SHORT}
+
+ Returns a string containing the localized name of the object suitable for
+ a Braille display. The actual string will depend upon the value of
+ the style parameter.
+ """
+
+ if style == settings.BRAILLE_ROLENAME_STYLE_SHORT:
+ return getShortBrailleForRoleName(obj, role)
+ else:
+ return getLongBrailleForRoleName(obj, role)
+
+if __name__ == "__main__":
+ logging.basicConfig(format="%(name)s %(message)s")
+ log.setLevel(logging.DEBUG)
+
+ print getSpeechForRoleName(None, ROLE_HTML_CONTAINER)
+ print getSpeechForRoleName(None, pyatspi.ROLE_HTML_CONTAINER)
+ print getSpeechForRoleName(None, "foo")
+
+ print getBrailleForRoleName(None,
+ pyatspi.ROLE_HTML_CONTAINER,
+ settings.BRAILLE_ROLENAME_STYLE_SHORT)
+ print getBrailleForRoleName(None,
+ ROLE_HTML_CONTAINER,
+ settings.BRAILLE_ROLENAME_STYLE_LONG)
+
+ print getBrailleForRoleName(None,
+ ROLE_HTML_CONTAINER,
+ settings.BRAILLE_ROLENAME_STYLE_SHORT)
+ print getBrailleForRoleName(None,
+ pyatspi.ROLE_HTML_CONTAINER,
+ settings.BRAILLE_ROLENAME_STYLE_LONG)
+
+ print getBrailleForRoleName(None,
+ "foo",
+ settings.BRAILLE_ROLENAME_STYLE_SHORT)
+ print getBrailleForRoleName(None,
+ "foo",
+ settings.BRAILLE_ROLENAME_STYLE_LONG)
Added: branches/phase2/src/orca/text_attribute_names.py
==============================================================================
--- (empty file)
+++ branches/phase2/src/orca/text_attribute_names.py Tue Sep 16 01:16:31 2008
@@ -0,0 +1,919 @@
+# Copyright 2006-2008 Sun Microsystems Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 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
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library 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.
+
+"""Provides getTextAttributeName method that maps each text attribute
+into its localized equivalent."""
+
+__id__ = "$Id$"
+__copyright__ = "Copyright (c) 2008 Sun Microsystems Inc."
+__license__ = "LGPL"
+
+from orca_i18n import Q_ # to provide qualified translatable strings
+
+# Translators: this is a structure to assist in the generation of
+# localized strings for the various text attributes.
+#
+# Information can be found in the Atk documentation at:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# The at-spi IDL documentation for Accessibility_Text.idl also provides
+# the following information:
+#
+# Attributes relevant to localization should be provided in accordance
+# with the w3c "Internationalization and Localization Markup Requirements",
+# http://www.w3.org/TR/2005/WD-itsreq-20051122/
+#
+# Other text attributes should choose their names and value semantics in
+# accordance with relevant standards such as:
+# CSS level 2 (http://www.w3.org/TR/1998/REC-CSS2-19980512),
+# XHTML 1.0 (http://www.w3.org/TR/2002/REC-xhtml1-20020801), and
+# WICD (http://www.w3.org/TR/2005/WD-WICD-20051121/).
+#
+# Where possible, specific URL references will also be given below for
+# each text attribute.
+#
+
+__textAttributes = {}
+
+# Translators: this attribute specifies the background color of the text.
+# The value is an RGB value of the format "u,u,u".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["bg-color"] = Q_("textattr|background color")
+
+# Translators: this attribute specifies whether to make the background
+# color for each character the height of the highest font used on the
+# current line, or the height of the font used for the current character.
+# It will be a "true" or "false" value.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["bg-full-height"] = Q_("textattr|background full height")
+
+# Translators: this attribute specifies whether a GdkBitmap is set for
+# stippling the background color. It will be a "true" or "false" value.
+# See
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["bg-stipple"] = Q_("textattr|background stipple")
+
+# Translators: this attribute specifies the direction of the text.
+# Values are "none", "ltr" or "rtl".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["direction"] = Q_("textattr|direction")
+
+# Translators: this attribute specifies whether the text is editable.
+# It will be a "true" or "false" value.
+# See
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["editable"] = Q_("textattr|editable")
+
+# Translators: this attribute specifies the font family name of the text.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["family-name"] = Q_("textattr|family name")
+
+# Translators: this attribute specifies the foreground color of the text.
+# The value is an RGB value of the format "u,u,u".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["fg-color"] = Q_("textattr|foreground color")
+
+# Translators: this attribute specifies whether a GdkBitmap is set for
+# stippling the foreground color. It will be a "true" or "false" value.
+# See
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["fg-stipple"] = Q_("textattr|foreground stipple")
+
+# Translators: this attribute specifies the effect applied to the font
+# used by the text.
+# See:
+# http://www.w3.org/TR/2002/WD-css3-fonts-20020802/#font-effect
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["font-effect"] = Q_("textattr|font effect")
+
+# Translators: this attribute specifies the indentation of the text
+# (in pixels).
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["indent"] = Q_("textattr|indent")
+
+# Translators: this attribute specifies whether the text is invisible.
+# It will be a "true" or "false" value.
+# See
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["invisible"] = Q_("textattr|invisible")
+
+# Translators: this attribute specifies how the justification of the text.
+# Values are "left", "right", "center" or "fill".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["justification"] = Q_("textattr|justification")
+
+# Translators: this attribute specifies the language that the text is
+# written in.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["language"] = Q_("textattr|language")
+
+# Translators: this attribute specifies the pixel width of the left margin.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["left-margin"] = Q_("textattr|left margin")
+
+# Translators: this attribute specifies the height of the line of text.
+# See:
+# http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-line-height
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["line-height"] = Q_("textattr|line height")
+
+# Translators: this attribute refers to the named style which is associated
+# with the entire paragraph and which controls the default formatting
+# (font, text size, alignment, etc.) of that paragraph. Examples of
+# paragraph styles include "Heading 1", "Heading 2", "Caption", "Footnote",
+# "Text Body", "Title", and "Subtitle".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["paragraph-style"] = Q_("textattr|paragraph style")
+
+# Translators: this attribute specifies the pixels of blank space to
+# leave above each newline-terminated line.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["pixels-above-lines"] = Q_("textattr|pixels above lines")
+
+# Translators: this attribute specifies the pixels of blank space to
+# leave below each newline-terminated line.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["pixels-below-lines"] = Q_("textattr|pixels below lines")
+
+# Translators: this attribute specifies the pixels of blank space to
+# leave between wrapped lines inside the same newline-terminated line
+# (paragraph).
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["pixels-inside-wrap"] = Q_("textattr|pixels inside wrap")
+
+# Translators: this attribute specifies the pixel width of the right margin.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["right-margin"] = Q_("textattr|right margin")
+
+# Translators: this attribute specifies the number of pixels that the
+# text characters are risen above the baseline.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["rise"] = Q_("textattr|rise")
+
+# Translators: this attribute specifies the scale of the characters. The
+# value is a string representation of a double.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["scale"] = Q_("textattr|scale")
+
+# Translators: this attribute specifies the size of the text.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["size"] = Q_("textattr|size")
+
+# Translators: this attribute specifies the stretch of he text, if set.
+# Values are "ultra_condensed", "extra_condensed", "condensed",
+# "semi_condensed", "normal", "semi_expanded", "expanded",
+# "extra_expanded" or "ultra_expanded".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["stretch"] = Q_("textattr|stretch")
+
+# Translators: this attribute specifies whether the text is strike though
+# (in other words, whether there is a line drawn through it). Values are
+# "true" or "false".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["strikethrough"] = Q_("textattr|strike through")
+
+# Translators: this attribute specifies the slant style of the text,
+# if set. Values are "normal", "oblique" or "italic".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["style"] = Q_("textattr|style")
+
+# Translators: this attribute specifies the decoration of the text.
+# See:
+# http://www.w3.org/TR/1998/REC-CSS2-19980512/text.html#propdef-text-decoration
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["text-decoration"] = Q_("textattr|text decoration")
+
+# Translators: this attribute specifies the angle at which the text is
+# displayed (i.e. rotated from the norm) and is represented in degrees
+# of rotation.
+# See:
+# http://www.w3.org/TR/2003/CR-css3-text-20030514/#glyph-orientation-horizontal
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["text-rotation"] = Q_("textattr|text rotation")
+
+# Translators: this attribute specifies the shadow effects applied to the text.
+# See:
+# http://www.w3.org/TR/1998/REC-CSS2-19980512/text.html#propdef-text-shadow
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["text-shadow"] = Q_("textattr|text shadow")
+
+# Translators: this attributes specifies whether the text is underlined.
+# Values are "none", "single", "double" or "low".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["underline"] = Q_("textattr|underline")
+
+# Translators: this attribute specifies the capitalization variant of
+# the text, if set. Values are "normal" or "small_caps".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["variant"] = Q_("textattr|variant")
+
+# Translators: this attributes specifies what vertical alignment property
+# has been applied to the text.
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["vertical-align"] = Q_("textattr|vertical align")
+
+# Translators: this attribute specifies the weight of the text.
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+# http://www.w3.org/TR/1998/REC-CSS2-19980512/fonts.html#propdef-font-weight
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["weight"] = Q_("textattr|weight")
+
+# Translators: this attribute specifies the wrap mode of the text, if any.
+# Values are "none", "char" or "word".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["wrap-mode"] = Q_("textattr|wrap mode")
+
+# Translators: this attribute specifies the way the text is written.
+# Values are "lr-tb", "rl-tb", "tb-rl", "tb-lr", "bt-rl", "bt-lr", "lr",
+# "rl" and "tb".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["writing-mode"] = Q_("textattr|writing mode")
+
+
+# The following are the known values of some of these text attributes.
+# These values were found in the Atk documentation at:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+# No doubt there will be more, and as they are found, they can be added
+# to this table so they can be translated.
+#
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "invisible", "editable", bg-full-height", "strikethrough",
+# "bg-stipple" and "fg-stipple".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["true"] = Q_("textattr|true")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "invisible", "editable", bg-full-height", "strikethrough",
+# "bg-stipple" and "fg-stipple".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["false"] = Q_("textattr|false")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "font-effect", "underline", "text-shadow", "wrap mode"
+# and "direction".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["none"] = Q_("textattr|none")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "font-effect".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["engrave"] = Q_("textattr|engrave")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "font-effect".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["emboss"] = Q_("textattr|emboss")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "font-effect".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["outline"] = Q_("textattr|outline")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "text-decoration".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["overline"] = Q_("textattr|overline")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "text-decoration".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["line-through"] = Q_("textattr|line through")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "text-decoration".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["blink"] = Q_("textattr|blink")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "text-shadow".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["black"] = Q_("textattr|black")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "underline".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["single"] = Q_("textattr|single")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "underline".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["double"] = Q_("textattr|double")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "underline".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["low"] = Q_("textattr|low")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "wrap mode".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["char"] = Q_("textattr|char")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "wrap mode".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["word"] = Q_("textattr|word")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "direction".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["ltr"] = Q_("textattr|ltr")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "direction".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["rtl"] = Q_("textattr|rtl")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "justification".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["left"] = Q_("textattr|left")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "justification".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["right"] = Q_("textattr|right")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "justification".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["center"] = Q_("textattr|center")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "justification".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["fill"] = Q_("textattr|fill")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["ultra_condensed"] = Q_("textattr|ultra condensed")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["extra_condensed"] = Q_("textattr|extra condensed")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["condensed"] = Q_("textattr|condensed")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["semi_condensed"] = Q_("textattr|semi condensed")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch" and "variant".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["normal"] = Q_("textattr|normal")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["semi_expanded"] = Q_("textattr|semi expanded")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["expanded"] = Q_("textattr|expanded")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["extra_expanded"] = Q_("textattr|extra expanded")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "stretch".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["ultra_expanded"] = Q_("textattr|ultra expanded")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "variant".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["small_caps"] = Q_("textattr|small caps")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "style".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["oblique"] = Q_("textattr|oblique")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "style".
+# See:
+# http://library.gnome.org/devel/atk/1.22/AtkText.html#AtkTextAttribute
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["italic"] = Q_("textattr|italic")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "paragraph-style".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["Default"] = Q_("textattr|Default")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "paragraph-style".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["Text body"] = Q_("textattr|Text body")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "paragraph-style".
+# See:
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["Heading"] = Q_("textattr|Heading")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+# http://wiki.services.openoffice.org/wiki/Accessibility/TextAttributes
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["baseline"] = Q_("textattr|baseline")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["sub"] = Q_("textattr|sub")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["super"] = Q_("textattr|super")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["top"] = Q_("textattr|top")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["text-top"] = Q_("textattr|text-top")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["middle"] = Q_("textattr|middle")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["bottom"] = Q_("textattr|bottom")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["text-bottom"] = Q_("textattr|text-bottom")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "vertical-align" and "writing-mode".
+# See:
+#http://www.w3.org/TR/1998/REC-CSS2-19980512/visudet.html#propdef-vertical-align
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["inherit"] = Q_("textattr|inherit")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["lr-tb"] = Q_("textattr|lr-tb")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["rl-tb"] = Q_("textattr|rl-tb")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["tb-rl"] = Q_("textattr|tb-rl")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["tb-lr"] = Q_("textattr|tb-lr")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["bt-rl"] = Q_("textattr|bt-rl")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["bt-lr"] = Q_("textattr|bt-lr")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["lr"] = Q_("textattr|lr")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["rl"] = Q_("textattr|rl")
+
+# Translators: this is one of the text attribute values for the following
+# text attributes: "writing-mode".
+# See:
+# http://www.w3.org/TR/2001/WD-css3-text-20010517/#PrimaryTextAdvanceDirection
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+__textAttributes["tb"] = Q_("textattr|tb")
+
+
+def getTextAttributeKey(localizedTextAttr):
+ """Given a localized text attribute, return the original text
+ attribute, (i.e. the key value).
+
+ Arguments:
+ - localizedTextAttr: the localized text attribute.
+
+ Returns a string representing the original text attribute key for the
+ localized text attribute.
+ """
+
+ if isinstance(localizedTextAttr, unicode):
+ localizedTextAttr = localizedTextAttr.encode("UTF-8")
+
+ for key, value in __textAttributes.items():
+ if value == localizedTextAttr:
+ return key
+
+ return localizedTextAttr
+
+def getTextAttributeName(textAttr):
+ """Given a text attribute, returns its localized equivalent.
+
+ Arguments:
+ - textAttr: the text attribute to get the localized equivalent of.
+
+ Returns a string representing the localized equivalent for the text
+ attribute.
+ """
+
+ if isinstance(textAttr, unicode):
+ textAttr = textAttr.encode("UTF-8")
+
+ try:
+ return __textAttributes[textAttr]
+ except:
+ return textAttr
+
+if __name__ == "__main__":
+ print __textAttributes
+ print "Should be semi expanded:", getTextAttributeName("semi_expanded")
+ print "Should be foo:", getTextAttributeName("foo")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]