Navigation Menu

Skip to content

Commit

Permalink
Updated liblouis braille translator to 3.0.0. This includes significa…
Browse files Browse the repository at this point in the history
…nt enhancements to Unified English Braille. (#6109, #4194, #6220, #6140)

As there were quite a few changes to table file names required for this version of liblouis, this also includes code to migrate old table file names to new ones.
PR #6110.
  • Loading branch information
josephsl authored and jcsteh committed Oct 11, 2016
1 parent 25bcf29 commit de7bf21
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
@@ -1,6 +1,6 @@
[submodule "include/liblouis"]
path = include/liblouis
url = https://github.com/nvaccess/liblouis.git
url = https://github.com/liblouis/liblouis.git
[submodule "include/minhook"]
path = include/minhook
url = https://github.com/RaMMicHaeL/minhook
Expand Down
2 changes: 1 addition & 1 deletion include/liblouis
Submodule liblouis updated 537 files
2 changes: 2 additions & 0 deletions nvdaHelper/liblouis/liblouis.def
Expand Up @@ -17,5 +17,7 @@ EXPORTS
lou_compileString
lou_setDataPath
lou_getTable
lou_checkTable
lou_getTypeformForEmphClass
lou_getDataPath
lou_free
1 change: 1 addition & 0 deletions nvdaHelper/liblouis/sconscript
Expand Up @@ -51,6 +51,7 @@ sourceFiles = [
"lou_backTranslateString.c",
"wrappers.c",
"logging.c",
"pattern.c",
]
objs = [env.Object("%s.obj" % f, louisSourceDir.File(f)) for f in sourceFiles]
louisLib = env.SharedLibrary("liblouis", objs + ["liblouis.def"])
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -54,7 +54,7 @@ For reference, the following dependencies are included in Git submodules:
* [Sonic](https://github.com/waywardgeek/sonic), commit 4f8c1d11
* [IAccessible2](http://www.linuxfoundation.org/collaborate/workgroups/accessibility/iaccessible2), version 1.3
* [ConfigObj](http://www.voidspace.org.uk/python/configobj.html), version 4.6.0
* [liblouis](http://www.liblouis.org/), version 2.6.5
* [liblouis](http://www.liblouis.org/), version 3.0.0
* NVDA images and sounds
* System dlls not present on many systems: mfc90.dll, msvcp90.dll, msvcr90.dll, Microsoft.VC90.CRT.manifest
* [Adobe Acrobat accessibility interface, version XI](http://download.macromedia.com/pub/developer/acrobat/AcrobatAccess.zip)
Expand Down
37 changes: 27 additions & 10 deletions source/braille.py
Expand Up @@ -2,7 +2,7 @@
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2008-2016 NV Access Limited
#Copyright (C) 2008-2016 NV Access Limited, Joseph Lee

import sys
import itertools
Expand Down Expand Up @@ -55,10 +55,10 @@
("cz-cz-g1.utb", _("Czech grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("da-dk-g16.utb", _("Danish 6 dot grade 1"), False),
("da-dk-g16.ctb", _("Danish 6 dot grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("da-dk-g18.utb", _("Danish 8 dot grade 1"), False),
("da-dk-g18.ctb", _("Danish 8 dot grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("da-dk-g26.ctb", _("Danish 6 dot grade 2"), False),
Expand Down Expand Up @@ -205,13 +205,13 @@
("mr-in-g1.utb", _("Marathi grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("nl-BE-g1.ctb", _("Dutch (Belgium) grade 1"), False),
("nl-BE-g0.utb", _("Dutch (Belgium)"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("nl-NL-g1.ctb", _("Dutch (Netherlands) grade 1"), False),
("nl-NL-g0.utb", _("Dutch (Netherlands)"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("no-no.ctb", _("Norwegian 8 dot computer braille"), True),
("no-no-comp8.ctb", _("Norwegian 8 dot computer braille"), True),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("No-No-g0.utb", _("Norwegian grade 0"), False),
Expand Down Expand Up @@ -262,7 +262,7 @@
("Se-Se-g1.utb", _("Swedish grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("sk-sk-g1.utb", _("Slovak grade 1"), False),
("sk-g1.ctb", _("Slovak grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("sl-si-g1.utb", _("Slovene grade 1"), False),
Expand All @@ -274,16 +274,16 @@
("ta-ta-g1.ctb", _("Tamil grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("te-in-g1.utb", _("Telegu grade 1"), False),
("te-in-g1.utb", _("Telugu grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("tr.ctb", _("Turkish grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("UEBC-g1.utb", _("Unified English Braille Code grade 1"), False),
("en-ueb-g1.ctb", _("Unified English Braille Code grade 1"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("UEBC-g2.ctb", _("Unified English Braille Code grade 2"), False),
("en-ueb-g2.ctb", _("Unified English Braille Code grade 2"), False),
# Translators: The name of a braille table displayed in the
# braille settings dialog.
("zh-hk.ctb", _("Chinese (Hong Kong, Cantonese)"), False),
Expand All @@ -295,6 +295,18 @@
#: Braille tables that support input (only computer braille tables yet).
INPUT_TABLES = tuple(t for t in TABLES if t[2])

#: Maps old table names to new table names for tables renamed in newer versions of liblouis.
RENAMED_TABLES = {
"da-dk-g16.utb":"da-dk-g16.ctb",
"da-dk-g18.utb":"da-dk-g18.ctb",
"nl-BE-g1.ctb":"nl-BE-g0.utb",
"nl-NL-g1.ctb":"nl-NL-g0.utb",
"no-no.ctb":"no-no-comp8.ctb",
"sk-sk-g1.utb":"sk-g1.ctb",
"UEBC-g1.ctb":"en-ueb-g1.ctb",
"UEBC-g2.ctb":"en-ueb-g2.ctb",
}

roleLabels = {
# Translators: Displayed in braille for an object which is an
# editable text field.
Expand Down Expand Up @@ -1764,6 +1776,11 @@ def initialize():
global handler
config.addConfigDirsToPythonPackagePath(brailleDisplayDrivers)
log.info("Using liblouis version %s" % louis.version())
# #6140: Migrate to new table names as smoothly as possible.
oldTableName = config.conf["braille"]["translationTable"]
newTableName = RENAMED_TABLES.get(oldTableName)
if newTableName:
config.conf["braille"]["translationTable"] = newTableName
handler = BrailleHandler()
handler.setDisplayByName(config.conf["braille"]["display"])

Expand Down

0 comments on commit de7bf21

Please sign in to comment.