Repository: nvaccess/nvda

Issue:
When testing Vision framework with NVDA beta-19263 and alpha-19262: Always &show a warning when loading {screenCurtainTranslatedName} String does not take effect after translation
### Steps to reproduce:
First download the translation test template from [here](https://ci.appveyor.com/api/buildjobs/wuvi0ditnx1v80l4/artifacts/output%2Fnvda_snapshot_beta-19263%2C04569185.pot)
Then copy zh_CN-nvda.po Open the nvda.po with poedit and update the .po file with snapshot_beta-19263,04569185.pot
Final translation
Always &show a warning when loading {screenCurtainTranslatedName} String
Generate nvda.mo to cover NVDA-locale-zh_CN-LC_MESSAGES nvda.mo restart NVDA for testing
### Actual behavior:
Post-translation string does not take effect
### Expected behavior:
Post-translation string does not take effect
### System configuration
#### NVDA installed/portable/running from source:
install version
#### NVDA version:
beta-19263 and alpha-19262
#### Windows version:
windows10-1909
#### Name and version of other software in use when reproducing the issue:
NVDA-alpha-19262
#### Other information about your system:
none
### Other questions
#### Does the issue still occur after restarting your PC?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
no
NVDA-log:
none
thanks


Discussion:

Resolving patch:
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -2887,7 +2887,7 @@ def onOk(self, evt):
 			gui.messageBox(
 				# Translators: The message in a dialog presented when NVDA is unable to load the selected
 				# braille display.
-				message=_(f"Could not load the {display} display."),
+				message=_("Could not load the {display} display.").format(display=display),
 				# Translators: The title in a dialog presented when NVDA is unable to load the selected
 				# braille display.
 				caption=_("Braille Display Error"),
@@ -3131,12 +3131,16 @@ def showStartErrorForProviders(
 		providerName = providers[0].displayName
 		# Translators: This message is presented when
 		# NVDA is unable to load a single vision enhancement provider.
-		message = _(f"Could not load the {providerName} vision enhancement provider")
+		message = _("Could not load the {providerName} vision enhancement provider").format(
+			providerName=providerName
+		)
 	else:
 		providerNames = ", ".join(provider.displayName for provider in providers)
 		# Translators: This message is presented when NVDA is unable to
 		# load multiple vision enhancement providers.
-		message = _(f"Could not load the following vision enhancement providers:\n{providerNames}")
+		message = _("Could not load the following vision enhancement providers:\n{providerNames}").format(
+			providerNames=providerNames
+		)
 	gui.messageBox(
 		message,
 		# Translators: The title of the vision enhancement provider error message box.
@@ -3157,15 +3161,17 @@ def showTerminationErrorForProviders(
 		providerName = providers[0].displayName
 		# Translators: This message is presented when
 		# NVDA is unable to gracefully terminate a single vision enhancement provider.
-		message = _(f"Could not gracefully terminate the {providerName} vision enhancement provider")
+		message = _("Could not gracefully terminate the {providerName} vision enhancement provider").format(
+			providerName=providerName
+		)
 	else:
 		providerNames = ", ".join(provider.displayName for provider in providers)
 		# Translators: This message is presented when
 		# NVDA is unable to terminate multiple vision enhancement providers.
 		message = _(
 			"Could not gracefully terminate the following vision enhancement providers:\n"
-			f"{providerNames }"
-		)
+			"{providerNames}"
+		).format(providerNames=providerNames)
 	gui.messageBox(
 		message,
 		# Translators: The title of the vision enhancement provider error message box.
diff --git a/source/visionEnhancementProviders/screenCurtain.py b/source/visionEnhancementProviders/screenCurtain.py
--- a/source/visionEnhancementProviders/screenCurtain.py
+++ b/source/visionEnhancementProviders/screenCurtain.py
@@ -94,7 +94,9 @@ class Magnification:
 warnOnLoadCheckBoxText = (
 	# Translators: Description for a screen curtain setting that shows a warning when loading
 	# the screen curtain.
-	_(f"Always &show a warning when loading {screenCurtainTranslatedName}")
+	_("Always &show a warning when loading {screenCurtainTranslatedName}").format(
+		screenCurtainTranslatedName=screenCurtainTranslatedName
+	)
 )
 
 


Test patch: