Repository: nvaccess/nvda

Issue:
Include braille tables for romanian language in NVDA's braille settings
### Steps to reproduce:
1. Connect a braille display with NVDA and write following:
Romanian: Haș
2. Try to read the words on the Braille Display
3. Go to the last letter of the romanian word and try to read the single character with eSpeak


### Expected behavior:
The letter ș as well as other language specıfıc signs should automatically be properly dısplayed on a braılle dısplay. ș is for example dots 2, 4, 6 (grade 1).


### Actual behavior:
On the Braille Display there is a code generated (for romanian letter for example 'x219') instead of displaying the letter itself.

### System configuration:
NVDA version:
2017.4

NVDA Installed or portable:
Both

Other information:

Windows version:
Windows 10 Build 16299.64

Name and version of other software in use when reproducing the issue:
All

### Other questions:

Does the issue still occur after restarting your PC?
yes

Have you tried any other versions of NVDA?
Yes, 2017.3, 2017.1

Danish contracted eight dot braille doesn't show capital characters
NVDA 2017.3 does not show capital characters when using the 8 dot contracted braille table.
This was the case until 2017.3 where the input table was added.

Here is how to reproduce

1. Select the Danish 8 dot contracted table under options, braille options.
2. Open Notepad and type:
Hello World
Now make a newline and type:
NVDA
Remember to type all characters as capitals when typing NVDA.
3. On the braille display it shows:
hello world!
n v d a 

So:
When a word contains of multiple capital letters the dot 7 is not used, instead there is inserted a space, and when words start with a capital letter this is not shown.

4. Now try retype the examples above but switch to the Danish uncontracted braille table.
You will now find that capital characters works again just fine.

Tested on Windows 7 with a Braille Sense U2 from HIMS.



Discussion:

Hi, Can you reproduce this with United States English 8-dot computer braille and other ones when ts 7 and 8 are used? CC @DKager and other Danish speakers.

 

From: Thomas Byskov Dalgaard [mailto:notifications@github.com] 
Sent: Saturday, August 26, 2017 10:17 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] Danish contracted eight dot braille doesn't show capital characters (#7526)

 

NVDA 2017.3 does not show capital characters when using the 8 dot contracted braille table.
This was the case until 2017.3 where the input table was added.

Here is how to reproduce

1.	Select the Danish 8 dot contracted table under options, braille options.
2.	Open Notepad and type:
Hello World
Now make a newline and type:
NVDA
Remember to type all characters as capitals when typing NVDA.
3.	On the braille display it shows:
hello world!
n v d a

So:
When a word contains of multiple capital letters the dot 7 is not used, instead there is inserted a space, and when words start with a capital letter this is not shown.

4.	Now try retype the examples above but switch to the Danish uncontracted braille table.
You will now find that capital characters works again just fine.

Tested on Windows 7 with a Braille Sense U2 from HIMS.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/7526> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkEBYBpLgNcYvlre7rDN7WN-0EdSeks5scFMpgaJpZM4PDjvd> .


I don't speak Danish, but @BueVest does. :)
Dot 7 works with English 8-dot Computer Braille. But, as tbdalgaard mentions, not with Danish 8-dot Grade 2 / Contracted Braille. Tested on Windows10, 64 bit, NVDA Next 14342. 
Now that I'm actually paying attention, I realize I missed the obvious cause. This is another case where passing the `pass1Only` flag to liblouis seriously messes up braille tables. See #7301.
Yes, the polish braille table is messed up in that way, too


W dniu 30.08.2017 o 13:01, Davy Kager pisze:
>
> Now that I'm actually paying attention, I realize I missed the obvious 
> cause. This is another case where passing the |pass1Only| flag to 
> liblouis seriously messes up braille tables. See #7301 
> <https://github.com/nvaccess/nvda/issues/7301>.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub 
> <https://github.com/nvaccess/nvda/issues/7526#issuecomment-325957201>, 
> or mute the thread 
> <https://github.com/notifications/unsubscribe-auth/AKohk4oXIYCZYxpHgYdp90CYtekMZtBmks5sdUEFgaJpZM4PDjvd>.
>


but on input grade1


W dniu 30.08.2017 o 13:01, Davy Kager pisze:
>
> Now that I'm actually paying attention, I realize I missed the obvious 
> cause. This is another case where passing the |pass1Only| flag to 
> liblouis seriously messes up braille tables. See #7301 
> <https://github.com/nvaccess/nvda/issues/7301>.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub 
> <https://github.com/nvaccess/nvda/issues/7526#issuecomment-325957201>, 
> or mute the thread 
> <https://github.com/notifications/unsubscribe-auth/AKohk4oXIYCZYxpHgYdp90CYtekMZtBmks5sdUEFgaJpZM4PDjvd>.
>


@BueVest: Do I understand you correctly that you belief this is caused by pass1only (so multi pass being disabled)?
Yes, absolutely. The cause has already been described in this thread, which has apparently also been closed by the way.

Also, this is in accordance with what happens when I turn this option on in the tests. More and more tables depend on multi-pass opcodes. For Danish, 8 dots grade 2 and 6 dots grade 1 and to are messed up.



Resolving patch:
diff --git a/source/braille.py b/source/braille.py
--- a/source/braille.py
+++ b/source/braille.py
@@ -378,8 +378,6 @@ def update(self):
 		@postcondition: L{brailleCells}, L{brailleCursorPos}, L{brailleSelectionStart} and L{brailleSelectionEnd} are updated and ready for rendering.
 		"""
 		mode = louis.dotsIO
-		if config.conf["braille"]["outputPass1Only"]:
-			mode |= louis.pass1Only
 		if config.conf["braille"]["expandAtCursor"] and self.cursorPos is not None:
 			mode |= louis.compbrlAtCursor
 		text=unicode(self.rawText).replace('\0','')
diff --git a/source/brailleTables.py b/source/brailleTables.py
--- a/source/brailleTables.py
+++ b/source/brailleTables.py
@@ -66,8 +66,11 @@ def listTables():
 	"da-dk-g16.utb":"da-dk-g16.ctb",
 	"da-dk-g18.utb":"da-dk-g18.ctb",
 	"en-us-comp8.ctb" : "en-us-comp8-ext.utb",
+	"fr-ca-g1.utb":"fr-bfu-comp6.utb",
+	"Fr-Ca-g2.ctb":"fr-bfu-g2.ctb",
 	"gr-gr-g1.utb":"el.ctb",
 	"hr.ctb":"hr-comp8.utb",
+	"mn-MN.utb":"mn-MN-g1.utb",
 	"nl-BE-g1.ctb":"nl-BE-g0.utb",
 	"nl-NL-g1.ctb":"nl-NL-g0.utb",
 	"no-no.ctb":"no-no-comp8.ctb",
@@ -187,13 +190,7 @@ def listTables():
 addTable("fr-bfu-comp8.utb", _("French (unified) 8 dot computer braille"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
-addTable("fr-bfu-g2.ctb", _("French (unified) Grade 2"), contracted=True)
-# Translators: The name of a braille table displayed in the
-# braille settings dialog.
-addTable("fr-ca-g1.utb", _("French (Canada) grade 1"))
-# Translators: The name of a braille table displayed in the
-# braille settings dialog.
-addTable("Fr-Ca-g2.ctb", _("French (Canada) grade 2"), contracted=True)
+addTable("fr-bfu-g2.ctb", _("French (unified) grade 2"), contracted=True)
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
 addTable("ga-g1.utb", _("Irish grade 1"))
@@ -253,7 +250,10 @@ def listTables():
 addTable("ks-in-g1.utb", _("Kashmiri grade 1"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
-addTable("lt.ctb", _("Lithuanian"))
+addTable("lt.ctb", _("Lithuanian 8 dot"))
+# Translators: The name of a braille table displayed in the
+# braille settings dialog.
+addTable("lt-6dot.utb", _("Lithuanian 6 dot"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
 addTable("Lv-Lv-g1.utb", _("Latvian grade 1"))
@@ -265,7 +265,10 @@ def listTables():
 addTable("mn-in-g1.utb", _("Manipuri grade 1"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
-addTable("mn-MN.utb", _("Mongolian"))
+addTable("mn-MN-g1.utb", _("Mongolian grade 1"))
+# Translators: The name of a braille table displayed in the
+# braille settings dialog.
+addTable("mn-MN-g2.ctb", _("Mongolian grade 2"), contracted=True)
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
 addTable("mr-in-g1.utb", _("Marathi grade 1"))
@@ -316,6 +319,9 @@ def listTables():
 addTable("pu-in-g1.utb", _("Punjabi grade 1"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
+addTable("ro.ctb", _("Romanian"))
+# Translators: The name of a braille table displayed in the
+# braille settings dialog.
 addTable("ru-compbrl.ctb", _("Russian braille for computer code"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
@@ -349,6 +355,9 @@ def listTables():
 addTable("tr.ctb", _("Turkish grade 1"))
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
+addTable("uk.utb", _("Ukrainian"))
+# Translators: The name of a braille table displayed in the
+# braille settings dialog.
 addTable("unicode-braille.utb", _("Unicode braille"), output=False)
 # Translators: The name of a braille table displayed in the
 # braille settings dialog.
diff --git a/source/config/configSpec.py b/source/config/configSpec.py
--- a/source/config/configSpec.py
+++ b/source/config/configSpec.py
@@ -1,6 +1,6 @@
 # -*- coding: UTF-8 -*-
 #A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2006-2017 NV Access Limited, Babbage B.V., Davy Kager
+#Copyright (C) 2006-2018 NV Access Limited, Babbage B.V., Davy Kager
 #This file is covered by the GNU General Public License.
 #See the file COPYING for more details.
 
@@ -65,7 +65,6 @@
 	readByParagraph = boolean(default=false)
 	wordWrap = boolean(default=true)
 	focusContextPresentation = option("changedContext", "fill", "scroll", default="changedContext")
-	outputPass1Only = boolean(default=true)
 
 	# Braille display driver settings
 	[[__many__]]


Test patch:
diff --git a/tests/unit/test_brailleTables.py b/tests/unit/test_brailleTables.py
new file mode 100644
--- /dev/null
+++ b/tests/unit/test_brailleTables.py
@@ -0,0 +1,30 @@
+#tests/unit/test_brailleTables.py
+#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) 2018 NV Access Limited, Babbage B.V.
+
+"""Unit tests for the brailleTables module.
+"""
+
+import unittest
+import brailleTables
+import os.path
+
+class TestFBrailleTables(unittest.TestCase):
+	"""Tests for braille table files and their existence."""
+
+	def test_tableExistence(self):
+		"""Tests whether all defined tables exist."""
+		tables = brailleTables.listTables()
+		for table in tables:
+			self.assertTrue(
+				os.path.isfile(os.path.join(brailleTables.TABLES_DIR, table.fileName)),
+				msg="{table} table not found".format(table=table.displayName)
+			)
+
+	def test_renamedTableExistence(self):
+		"""Tests whether all defined renamed tables are part of the actual list of tables."""
+		tableNames = [table.fileName for table in brailleTables.listTables()]
+		for name in brailleTables.RENAMED_TABLES.itervalues():
+			self.assertIn(name, tableNames)