@@ -3567,6 +3567,34 @@ def script_braille_cycleShowSelection(self, gesture: inputCore.InputGesture) ->
35673567 braille .handler .initialDisplay ()
35683568 ui .message (msg )
35693569
3570+ @script (
3571+ # Translators: Input help mode message for Braille Unicode normalization command.
3572+ description = _ ("Cycle through the braille Unicode normalization states" ),
3573+ category = SCRCAT_BRAILLE
3574+ )
3575+ def script_braille_cycleUnicodeNormalization (self , gesture : inputCore .InputGesture ) -> None :
3576+ featureFlag : FeatureFlag = config .conf ["braille" ]["unicodeNormalization" ]
3577+ boolFlag : BoolFlag = featureFlag .enumClassType
3578+ values = [x .value for x in boolFlag ]
3579+ currentValue = featureFlag .value .value
3580+ nextValueIndex = (currentValue % len (values )) + 1
3581+ nextName : str = boolFlag (nextValueIndex ).name
3582+ config .conf ["braille" ]["unicodeNormalization" ] = nextName
3583+ featureFlag = config .conf ["braille" ]["unicodeNormalization" ]
3584+ if featureFlag .isDefault ():
3585+ # Translators: Used when reporting braille Unicode normalization state
3586+ # (default behavior).
3587+ msg = _ ("Braille Unicode normalization default ({default})" ).format (
3588+ default = featureFlag .behaviorOfDefault .displayString
3589+ )
3590+ else :
3591+ # Translators: Used when reporting braille Unicode normalization state
3592+ # (disabled or enabled).
3593+ msg = _ ("Braille Unicode normalization {state}" ).format (
3594+ state = BoolFlag [nextName ].displayString
3595+ )
3596+ ui .message (msg )
3597+
35703598 @script (
35713599 description = _ (
35723600 # Translators: Input help mode message for report clipboard text command.
@@ -4343,6 +4371,34 @@ def script_toggleReportCLDR(self, gesture):
43434371 characterProcessing .clearSpeechSymbols ()
43444372 ui .message (state )
43454373
4374+ @script (
4375+ # Translators: Input help mode message for speech Unicode normalization command.
4376+ description = _ ("Cycle through the speech Unicode normalization states" ),
4377+ category = SCRCAT_SPEECH
4378+ )
4379+ def script_speech_cycleUnicodeNormalization (self , gesture : inputCore .InputGesture ) -> None :
4380+ featureFlag : FeatureFlag = config .conf ["speech" ]["unicodeNormalization" ]
4381+ boolFlag : BoolFlag = featureFlag .enumClassType
4382+ values = [x .value for x in boolFlag ]
4383+ currentValue = featureFlag .value .value
4384+ nextValueIndex = (currentValue % len (values )) + 1
4385+ nextName : str = boolFlag (nextValueIndex ).name
4386+ config .conf ["speech" ]["unicodeNormalization" ] = nextName
4387+ featureFlag = config .conf ["speech" ]["unicodeNormalization" ]
4388+ if featureFlag .isDefault ():
4389+ # Translators: Used when reporting speech Unicode normalization state
4390+ # (default behavior).
4391+ msg = _ ("Speech Unicode normalization default ({default})" ).format (
4392+ default = featureFlag .behaviorOfDefault .displayString
4393+ )
4394+ else :
4395+ # Translators: Used when reporting speech Unicode normalization state
4396+ # (disabled or enabled).
4397+ msg = _ ("Speech Unicode normalization {state}" ).format (
4398+ state = BoolFlag [nextName ].displayString
4399+ )
4400+ ui .message (msg )
4401+
43464402 _tempEnableScreenCurtain = True
43474403 _waitingOnScreenCurtainWarningDialog : Optional [wx .Dialog ] = None
43484404 _toggleScreenCurtainMessage : Optional [str ] = None
0 commit comments