@@ -319,8 +319,8 @@ def realtime_tab():
319319
320320 with gr .Blocks () as ui :
321321 with gr .Row ():
322- start_button = gr .Button ("Start" , variant = "primary" )
323- stop_button = gr .Button ("Stop" , interactive = False )
322+ start_button = gr .Button (i18n ( "Start" ) , variant = "primary" )
323+ stop_button = gr .Button (i18n ( "Stop" ) , interactive = False )
324324 latency_info = gr .Label (label = i18n ("Status" ), value = "Realtime not started." )
325325 terms_checkbox = gr .Checkbox (
326326 label = i18n ("I agree to the terms of use" ),
@@ -334,13 +334,13 @@ def realtime_tab():
334334 with gr .Tabs ():
335335 with gr .TabItem ("Audio Settings" ):
336336 with gr .Row ():
337- refresh_devices_button = gr .Button ("Refresh Audio Devices" )
337+ refresh_devices_button = gr .Button (i18n ( "Refresh Audio Devices" ) )
338338 with gr .Row ():
339- with gr .Accordion ("Input Device" , open = True ):
339+ with gr .Accordion (i18n ( "Input Device" ) , open = True ):
340340 with gr .Column ():
341341 input_audio_device = gr .Dropdown (
342- label = "Input Device" ,
343- info = "Select the microphone or audio interface you will be speaking into." ,
342+ label = i18n ( "Input Device" ) ,
343+ info = i18n ( "Select the microphone or audio interface you will be speaking into." ) ,
344344 choices = input_devices ,
345345 value = get_safe_dropdown_value (
346346 saved_settings ["input_device" ], input_devices
@@ -351,24 +351,24 @@ def realtime_tab():
351351 minimum = 0 ,
352352 maximum = 200 ,
353353 value = 100 ,
354- label = "Input Gain (%)" ,
355- info = "Adjusts the input volume before processing. Prevents clipping or boosts a quiet mic." ,
354+ label = i18n ( "Input Gain (%)" ) ,
355+ info = i18n ( "Adjusts the input volume before processing. Prevents clipping or boosts a quiet mic." ) ,
356356 interactive = True ,
357357 )
358358 input_asio_channels = gr .Slider (
359359 minimum = - 1 ,
360360 maximum = 16 ,
361361 value = - 1 ,
362362 step = 1 ,
363- label = "Input ASIO Channel" ,
364- info = "For ASIO drivers, selects a specific input channel. Leave at -1 for default." ,
363+ label = i18n ( "Input ASIO Channel" ) ,
364+ info = i18n ( "For ASIO drivers, selects a specific input channel. Leave at -1 for default." ) ,
365365 interactive = True ,
366366 )
367367 with gr .Accordion ("Output Device" , open = True ):
368368 with gr .Column ():
369369 output_audio_device = gr .Dropdown (
370- label = "Output Device" ,
371- info = "Select the device where the final converted voice will be sent (e.g., a virtual cable)." ,
370+ label = i18n ( "Output Device" ) ,
371+ info = i18n ( "Select the device where the final converted voice will be sent (e.g., a virtual cable)." ) ,
372372 choices = output_devices ,
373373 value = get_safe_dropdown_value (
374374 saved_settings ["output_device" ], output_devices
@@ -379,27 +379,27 @@ def realtime_tab():
379379 minimum = 0 ,
380380 maximum = 200 ,
381381 value = 100 ,
382- label = "Output Gain (%)" ,
383- info = "Adjusts the final volume of the converted voice after processing." ,
382+ label = i18n ( "Output Gain (%)" ) ,
383+ info = i18n ( "Adjusts the final volume of the converted voice after processing." ) ,
384384 interactive = True ,
385385 )
386386 output_asio_channels = gr .Slider (
387387 minimum = - 1 ,
388388 maximum = 16 ,
389389 value = - 1 ,
390390 step = 1 ,
391- label = "Output ASIO Channel" ,
392- info = "For ASIO drivers, selects a specific output channel. Leave at -1 for default." ,
391+ label = i18n ( "Output ASIO Channel" ) ,
392+ info = i18n ( "For ASIO drivers, selects a specific output channel. Leave at -1 for default." ) ,
393393 interactive = True ,
394394 )
395395 with gr .Accordion ("Monitor Device (Optional)" , open = False ):
396396 with gr .Column ():
397397 use_monitor_device = gr .Checkbox (
398- label = "Use Monitor Device" , value = False , interactive = True
398+ label = i18n ( "Use Monitor Device" ) , value = False , interactive = True
399399 )
400400 monitor_output_device = gr .Dropdown (
401- label = "Monitor Device" ,
402- info = "Select the device for monitoring your voice (e.g., your headphones)." ,
401+ label = i18n ( "Monitor Device" ) ,
402+ info = i18n ( "Select the device for monitoring your voice (e.g., your headphones)." ) ,
403403 choices = output_devices ,
404404 value = get_safe_dropdown_value (
405405 saved_settings ["monitor_device" ], output_devices
@@ -410,29 +410,29 @@ def realtime_tab():
410410 minimum = 0 ,
411411 maximum = 200 ,
412412 value = 100 ,
413- label = "Monitor Gain (%)" ,
414- info = "Adjusts the volume of the monitor feed, independent of the main output." ,
413+ label = i18n ( "Monitor Gain (%)" ) ,
414+ info = i18n ( "Adjusts the volume of the monitor feed, independent of the main output." ) ,
415415 interactive = True ,
416416 )
417417 monitor_asio_channels = gr .Slider (
418418 minimum = - 1 ,
419419 maximum = 16 ,
420420 value = - 1 ,
421421 step = 1 ,
422- label = "Monitor ASIO Channel" ,
423- info = "For ASIO drivers, selects a specific monitor output channel. Leave at -1 for default." ,
422+ label = i18n ( "Monitor ASIO Channel" ) ,
423+ info = i18n ( "For ASIO drivers, selects a specific monitor output channel. Leave at -1 for default." ) ,
424424 interactive = True ,
425425 )
426426 with gr .Row ():
427427 exclusive_mode = gr .Checkbox (
428- label = "Exclusive Mode (WASAPI)" ,
429- info = "For WASAPI (Windows), gives the app exclusive control for potentially lower latency." ,
428+ label = i18n ( "Exclusive Mode (WASAPI)" ) ,
429+ info = i18n ( "For WASAPI (Windows), gives the app exclusive control for potentially lower latency." ) ,
430430 value = True ,
431431 interactive = True ,
432432 )
433433 vad_enabled = gr .Checkbox (
434- label = "Enable VAD" ,
435- info = "Enables Voice Activity Detection to only process audio when you are speaking, saving CPU." ,
434+ label = i18n ( "Enable VAD" ) ,
435+ info = i18n ( "Enables Voice Activity Detection to only process audio when you are speaking, saving CPU." ) ,
436436 value = True ,
437437 interactive = True ,
438438 )
@@ -614,34 +614,34 @@ def realtime_tab():
614614 maximum = 2730.7 ,
615615 value = 512 ,
616616 step = 1 ,
617- label = "Chunk Size (ms)" ,
618- info = "Audio buffer size in milliseconds. Lower values may reduce latency but increase CPU load." ,
617+ label = i18n ( "Chunk Size (ms)" ) ,
618+ info = i18n ( "Audio buffer size in milliseconds. Lower values may reduce latency but increase CPU load." ) ,
619619 interactive = True ,
620620 )
621621 cross_fade_overlap_size = gr .Slider (
622622 minimum = 0.05 ,
623623 maximum = 0.2 ,
624624 value = 0.01 ,
625- label = "Crossfade Overlap Size (s)" ,
626- info = "Duration of the fade between audio chunks to prevent clicks. Higher values create smoother transitions but may increase latency." ,
625+ label = i18n ( "Crossfade Overlap Size (s)" ) ,
626+ info = i18n ( "Duration of the fade between audio chunks to prevent clicks. Higher values create smoother transitions but may increase latency." ) ,
627627 interactive = True ,
628628 )
629629 extra_convert_size = gr .Slider (
630630 minimum = 0.1 ,
631631 maximum = 5 ,
632632 value = 0.5 ,
633633 step = 0.1 ,
634- label = "Extra Conversion Size (s)" ,
635- info = "Amount of extra audio processed to provide context to the model. Improves conversion quality at the cost of higher CPU usage." ,
634+ label = i18n ( "Extra Conversion Size (s)" ) ,
635+ info = i18n ( "Amount of extra audio processed to provide context to the model. Improves conversion quality at the cost of higher CPU usage." ) ,
636636 interactive = True ,
637637 )
638638 silent_threshold = gr .Slider (
639639 minimum = - 90 ,
640640 maximum = - 60 ,
641641 value = - 90 ,
642642 step = 1 ,
643- label = "Silence Threshold (dB)" ,
644- info = "Volume level below which audio is treated as silence and not processed. Helps to save CPU resources and reduce background noise." ,
643+ label = i18n ( "Silence Threshold (dB)" ) ,
644+ info = i18n ( "Volume level below which audio is treated as silence and not processed. Helps to save CPU resources and reduce background noise." ) ,
645645 interactive = True ,
646646 )
647647
0 commit comments