Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
nvdaes and coderabbitai[bot] authored Sep 27, 2024
1 parent 8bbb65b commit de5b6cd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions source/brailleTables.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class BrailleTable(NamedTuple):
"""Maps languages to translation L{BrailleTable.fileName}."""


def getDefaultTableForCurLang(tableType: TableType) -> BrailleTable.fileName:
def getDefaultTableForCurLang(tableType: TableType) -> str:
"""Gets the file name of the braille table for the current NVDA language.
:param tableType: input or translation.
:return: A L{BrailleTable} fileName.
Expand All @@ -93,6 +93,9 @@ def getDefaultTableForCurLang(tableType: TableType) -> BrailleTable.fileName:
langDict = _inputTableForLangs
elif tableType == TableType.TRANSLATION:
langDict = _translationTableForLangs
else:
raise ValueError(f"Unknown tableType: {tableType}")
lang = languageHandler.getLanguage()
lang = languageHandler.getLanguage()
table = langDict.get(lang)
if table is not None:
Expand Down Expand Up @@ -859,9 +862,9 @@ def initialize():
f"{manifestPath}",
)
if config.conf["braille"]["translationTable"] == "auto":
config.conf["braille"]["translationTable"] = getDefaultTableForCurLang("translation")
config.conf["braille"]["translationTable"] = getDefaultTableForCurLang(TableType.TRANSLATION)
if config.conf["braille"]["inputTable"] == "auto":
config.conf["braille"]["inputTable"] = getDefaultTableForCurLang("input")
config.conf["braille"]["inputTable"] = getDefaultTableForCurLang(TableType.INPUT)


def terminate():
Expand Down

0 comments on commit de5b6cd

Please sign in to comment.