Skip to content

Commit

Permalink
Fix broken translation template (pot) generation. (nvaccess#7425)
Browse files Browse the repository at this point in the history
The superBrl braille display driver includes escape sequences which produce non-ASCII characters; e.g. "\xff". Due to a gettext bug, this causes xgettext to fail even though these aren't in translatable strings. See nvaccess#2592 (comment).

1. To work around this, declare encoding as UTF-8 for the superBrl driver.
2. Make AppVeyor build the translation template so that builds fail for problems like this. This way, we learn about such problems long before they get to the translation system.
3. Explicitly exclude source\comInterfaces for scons pot to avoid unknown encoding warnings. These files never contain translatable strings anyway.
  • Loading branch information
jcsteh authored Jul 20, 2017
1 parent 4bf797a commit 9dac6ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ build_script:
- 'echo scons args: %sconsArgs%'
- py scons.py source %sconsArgs%
# We don't need launcher to run tests, so run the tests before launcher.
- py scons.py tests %sconsArgs%
# We also build the translation template (pot) just to ensure it succeeds.
- py scons.py tests pot %sconsArgs%
# We don't actually need the pot as a build artifact though.
- del output\*.pot
- 'echo scons output targets: %sconsOutTargets%'
- py scons.py %sconsOutTargets% %sconsArgs%
# Build symbol store.
Expand Down
6 changes: 5 additions & 1 deletion sconstruct
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,11 @@ env.Clean('devDocs', [devGuide, devDocs_nvda])
pot = env.Command(outputDir.File("%s.pot" % outFilePrefix),
# Don't use sourceDir as the source, as this depends on comInterfaces and nvdaHelper.
# We only depend on the Python files.
[f for pattern in ("*.py", "*.pyw", r"*\*.py", r"*\*\*.py") for f in env.Glob(os.path.join(sourceDir.path, pattern))],
[f for pattern in ("*.py", "*.pyw", r"*\*.py", r"*\*\*.py")
for f in env.Glob(os.path.join(sourceDir.path, pattern))
# Exclude comInterfaces, since these don't contain translatable strings
# and they cause unknown encoding warnings.
if not f.path.startswith("source\\comInterfaces\\")],
makePot)

env.Alias("pot", pot)
Expand Down
1 change: 1 addition & 0 deletions source/brailleDisplayDrivers/superBrl.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: UTF-8 -*-
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
Expand Down

0 comments on commit 9dac6ff

Please sign in to comment.