Repository: nvaccess/nvda

Issue:
NVDA does not work after translating the following string
Hello everyone, I just tested svn's new nvda.po file and found that after translating the following string and replacing it in my test environment, NVDA won't start properly. Here is the specific string:
I understand that changing these settings may cause NVDA to function incorrectly. ID: 1937
Warning! 翻译 — 中文（中国）: 警告, ID: 1935
The following settings are for advanced users. Changing them may cause NVDA to function incorrectly. Please only change these if you know what you are doing or have been specifically instructed by NVDA developers. 翻译 — 中文（中国）: 警告！以下设置适用于高级用户。修改它们可能会导致NVDA无法正常运行。如果 您知道自己在做什么或者是已经得到NVDA开发人员的明确指示，才可以修改这些 设置。, ID: 1936
Restore defaults 翻译 — 中文（中国）: 用户默认, ID: 1938
NVDA Settings 翻译 — 中文（中国）: NVDA设置, ID: 1979

### Steps to reproduce:
First translate nvda.po and then generate nvda.mo, then overwrite nvda.mo to the translation directory, and finally restart NVDA.
### Actual behavior:
After restarting NVDA, there will be a system error tone and no error window will appear.
### Expected behavior:
Unable to start NVDA and read aloud
### System configuration
#### NVDA installed/portable/running from source:
install
#### NVDA version:
2019.1 beta
#### Windows version:
windows10-1809
#### Name and version of other software in use when reproducing the issue:
NVDA2019
#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your PC?
yes
#### Have you tried any other versions of NVDA?
no
Error log provided by Russian
CRITICAL - __main__ (11:01:02.378):
core failure
Traceback (most recent call last):
File "nvda.pyw", line 233, in <module>
File "core.pyo", line 238, in main
File "appModuleHandler.pyo", line 26, in <module>
File "NVDAHelper.pyo", line 22, in <module>
File "eventHandler.pyo", line 9, in <module>
File "api.pyo", line 11, in <module>
File "review.pyo", line 10, in <module> 
File "NVDAObjects\__init__.pyo", line 17, in <module> 
File "displayModel.pyo", line 16, in <module> 
File "mouseHandler.pyo", line 8, in <module> 
File "gui\__init__.pyo", line 28, in <module> 
File "gui\settingsDialogs.pyo", line 2101, in <module> 
File "gui\settingsDialogs.pyo", line 2118, in AdvancedPanel 
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128) 


Discussion:
Looks like regression from an attempt to tidy up the advanced panel. CC @feerrenrut

 

From: eric <notifications@github.com> 
Sent: Sunday, March 3, 2019 8:19 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: [nvaccess/nvda] NVDA does not work after translating the following string (#9342)

 

Hello everyone, I just tested svn's new nvda.po file and found that after translating the following string and replacing it in my test environment, NVDA won't start properly. Here is the specific string:


Steps to reproduce:


First translate nvda.po and then generate nvda.mo, then overwrite nvda.mo to the translation directory, and finally restart NVDA.


Actual behavior:


After restarting NVDA, there will be a system error tone and no error window will appear.


Expected behavior:


Unable to start NVDA and read aloud


System configuration


NVDA installed/portable/running from source:


install


NVDA version:


2019.1 beta


Windows version:


windows10-1809


Name and version of other software in use when reproducing the issue:


NVDA2019


Other information about your system:


Other questions


Does the issue still occur after restarting your PC?


yes


Have you tried any other versions of NVDA?


no
Error log provided by Russian
CRITICAL - main (11:01:02.378):
core failure
Traceback (most recent call last):
File "nvda.pyw", line 233, in 
File "core.pyo", line 238, in main
File "appModuleHandler.pyo", line 26, in 
File "NVDAHelper.pyo", line 22, in 
File "eventHandler.pyo", line 9, in 
File "api.pyo", line 11, in 
File "review.pyo", line 10, in 
屏幕外
File "NVDAObjects_init_.pyo", line 17, in 
屏幕外
File "displayModel.pyo", line 16, in 
屏幕外
File "mouseHandler.pyo", line 8, in 
屏幕外
File "gui_init_.pyo", line 28, in 
屏幕外
File "gui\settingsDialogs.pyo", line 2101, in 
File "gui\settingsDialogs.pyo", line 2118, in AdvancedPanel
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)

—
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/9342> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AHgLkLoZKYisN8AaLkJlv-OdoHz7cfhxks5vTJ6zgaJpZM4bbhT_> .


Hi,

Note that this was reported to translations mailing list with another translator confirming the problem.

Thanks.
Hi Joseph and all,

I can confirm this problem for polish and Croatian languages, when copied the latest.mo file I translated to the alpha snap. 

The Unicode error is the same,

NVDA refuses to start. 

Best,

Zvonimir

 

From: Joseph Lee <notifications@github.com> 
Sent: Monday, March 4, 2019 5:23 AM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [nvaccess/nvda] NVDA does not work after translating the following string (#9342)

 

Hi,

Note that this was reported to translations mailing list with another translator confirming the problem.

Thanks.

—
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/9342#issuecomment-469113838> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AKohk0sguajJiQ-2PRQq9oBbggKi1bMSks5vTJ-6gaJpZM4bbhT_> .  <https://github.com/notifications/beacon/AKohk5bGjAf-9wfhBEskUCudsq6J6uJbks5vTJ-6gaJpZM4bbhT_.gif> 



Resolving patch:
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -258,7 +258,7 @@ class SettingsPanel(with_metaclass(guiHelper.SIPABCMeta, wx.Panel, DpiScalingHel
 	"""
 
 	title=""
-	panelDescription=""
+	panelDescription=u""
 
 	def __init__(self, parent):
 		"""
@@ -2115,7 +2115,7 @@ class AdvancedPanel(SettingsPanel):
 		"have been specifically instructed by NVDA developers."
 	)
 
-	panelDescription = "{}\n{}".format(warningHeader, warningExplanation)
+	panelDescription = u"{}\n{}".format(warningHeader, warningExplanation)
 
 	def makeSettings(self, settingsSizer):
 		"""


Test patch: