tsengwoody / Access8Math

Allows access math content written by MathML ; Assist writing math content by LaTeX
GNU General Public License v2.0
32 stars 15 forks source link

i18n file is not found #104

Open tage64 opened 2 months ago

tage64 commented 2 months ago

Whenever I encounter some math NVDA becomes silent and I get the following error in the log:

ERROR - scriptHandler.executeScript (11:02:16.339) - MainThread (17184):
error executing script: <bound method CursorManager.script_moveByLine_forward of <virtualBuffers.gecko_ia2.Gecko_ia2 object at 0x0AEC9470>> with gesture 'down arrow'
Traceback (most recent call last):
  File "scriptHandler.pyc", line 295, in executeScript
  File "cursorManager.pyc", line 274, in script_moveByLine_forward
  File "cursorManager.pyc", line 171, in _caretMovementScriptHelper
  File "speech\speech.pyc", line 1420, in speakTextInfo
  File "speech\types.pyc", line 41, in __iter__
  File "speech\speech.pyc", line 1591, in getTextInfoSpeech
  File "speech\speech.pyc", line 1392, in _extendSpeechSequence_addMathForTextInfo
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\interaction.py", line 176, in getSpeechForMathMl
    mathcontent = MathContent(config.conf["Access8Math"]["settings"]["language"], mathMl)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\A8M_PM.py", line 193, in __init__
    symbol = load_unicode_dic(language=language, category="speech", NVDASymbol=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Tage\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\A8M_PM.py", line 1705, in load_unicode_dic
    raise OSError(f"{language} i18n file is not found")
OSError: en_US i18n file is not found

Seems that some i18n file is missing. Can you please fix this issue?

Thanks, Tage

tsengwoody commented 2 months ago

The current workaround to resolve this issue is to go to Tools -> Access8Math -> Settings in NVDA and read the settings for the Access8Math language. If Access8Math detects that the current setting language does not exist, it should automatically set it to the first available language (which is usually en). I will fixing this issue to ensure it handles missing languages more gracefully. Thanks for reporting this!

tage64 commented 2 months ago

Ok, thanks.

I solved the issue by installing basic typing for my language in Windows settings.