Skip to content

Commit 70b43e8

Browse files
chore(i18n): use english as the base language for i18n (#22)
* chore(i18n): use english as the base language for i18n rewrite all of the locale files to use english as base for translation * fix(i18n): update rest of the scripts that rely on the chinese-base i18n translation * chore(i18n): change some of the base strings to be more correct * chore(i18n): sync locale on dev * chore(format): run black on dev --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 91d3504 commit 70b43e8

File tree

19 files changed

+2291
-2240
lines changed

19 files changed

+2291
-2240
lines changed

gui.py

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@ def launcher(self):
241241
layout = [
242242
[
243243
sg.Frame(
244-
title=i18n("加载模型"),
244+
title=i18n("Load model"),
245245
layout=[
246246
[
247247
sg.Input(
248248
default_text=data.get("pth_path", ""),
249249
key="pth_path",
250250
),
251251
sg.FileBrowse(
252-
i18n("选择.pth文件"),
252+
i18n("Select the .pth file"),
253253
initial_folder=os.path.join(
254254
os.getcwd(), "assets/weights"
255255
),
@@ -262,7 +262,7 @@ def launcher(self):
262262
key="index_path",
263263
),
264264
sg.FileBrowse(
265-
i18n("选择.index文件"),
265+
i18n("Select the .index file"),
266266
initial_folder=os.path.join(os.getcwd(), "logs"),
267267
file_types=[("Index File", "*.index")],
268268
),
@@ -274,7 +274,7 @@ def launcher(self):
274274
sg.Frame(
275275
layout=[
276276
[
277-
sg.Text(i18n("设备类型")),
277+
sg.Text(i18n("Device type")),
278278
sg.Combo(
279279
self.hostapis,
280280
key="sg_hostapi",
@@ -283,14 +283,14 @@ def launcher(self):
283283
size=(20, 1),
284284
),
285285
sg.Checkbox(
286-
i18n("独占 WASAPI 设备"),
286+
i18n("Takeover WASAPI device"),
287287
key="sg_wasapi_exclusive",
288288
default=data.get("sg_wasapi_exclusive", False),
289289
enable_events=True,
290290
),
291291
],
292292
[
293-
sg.Text(i18n("输入设备")),
293+
sg.Text(i18n("Input device")),
294294
sg.Combo(
295295
self.input_devices,
296296
key="sg_input_device",
@@ -300,7 +300,7 @@ def launcher(self):
300300
),
301301
],
302302
[
303-
sg.Text(i18n("输出设备")),
303+
sg.Text(i18n("Output device")),
304304
sg.Combo(
305305
self.output_devices,
306306
key="sg_output_device",
@@ -310,33 +310,35 @@ def launcher(self):
310310
),
311311
],
312312
[
313-
sg.Button(i18n("重载设备列表"), key="reload_devices"),
313+
sg.Button(
314+
i18n("Reload device list"), key="reload_devices"
315+
),
314316
sg.Radio(
315-
i18n("使用模型采样率"),
317+
i18n("Choose sample rate of the model"),
316318
"sr_type",
317319
key="sr_model",
318320
default=data.get("sr_model", True),
319321
enable_events=True,
320322
),
321323
sg.Radio(
322-
i18n("使用设备采样率"),
324+
i18n("Choose sample rate of the device"),
323325
"sr_type",
324326
key="sr_device",
325327
default=data.get("sr_device", False),
326328
enable_events=True,
327329
),
328-
sg.Text(i18n("采样率")),
330+
sg.Text(i18n("Sampling rate")),
329331
sg.Text("", key="sr_stream"),
330332
],
331333
],
332-
title=i18n("音频设备"),
334+
title=i18n("Audio device"),
333335
)
334336
],
335337
[
336338
sg.Frame(
337339
layout=[
338340
[
339-
sg.Text(i18n("响应阈值")),
341+
sg.Text(i18n("Response threshold")),
340342
sg.Slider(
341343
range=(-60, 0),
342344
key="threhold",
@@ -347,7 +349,7 @@ def launcher(self):
347349
),
348350
],
349351
[
350-
sg.Text(i18n("音调设置")),
352+
sg.Text(i18n("Pitch settings")),
351353
sg.Slider(
352354
range=(-24, 24),
353355
key="pitch",
@@ -358,7 +360,7 @@ def launcher(self):
358360
),
359361
],
360362
[
361-
sg.Text(i18n("共振偏移")),
363+
sg.Text(i18n("Formant offset")),
362364
sg.Slider(
363365
range=(-5, 5),
364366
key="formant",
@@ -369,7 +371,11 @@ def launcher(self):
369371
),
370372
],
371373
[
372-
sg.Text(i18n("检索特征占比")),
374+
sg.Text(
375+
i18n(
376+
"Search feature ratio (controls accent strength, too high has artifacting)"
377+
)
378+
),
373379
sg.Slider(
374380
range=(0.0, 1.0),
375381
key="index_rate",
@@ -380,7 +386,7 @@ def launcher(self):
380386
),
381387
],
382388
[
383-
sg.Text(i18n("响度因子")),
389+
sg.Text(i18n("Loudness factor")),
384390
sg.Slider(
385391
range=(0.0, 1.0),
386392
key="rms_mix_rate",
@@ -391,7 +397,7 @@ def launcher(self):
391397
),
392398
],
393399
[
394-
sg.Text(i18n("音高算法")),
400+
sg.Text(i18n("Pitch detection algorithm")),
395401
sg.Radio(
396402
"pm",
397403
"f0method",
@@ -429,12 +435,12 @@ def launcher(self):
429435
),
430436
],
431437
],
432-
title=i18n("常规设置"),
438+
title=i18n("General settings"),
433439
),
434440
sg.Frame(
435441
layout=[
436442
[
437-
sg.Text(i18n("采样长度")),
443+
sg.Text(i18n("Sample length")),
438444
sg.Slider(
439445
range=(0.02, 1.5),
440446
key="block_time",
@@ -456,7 +462,11 @@ def launcher(self):
456462
# ),
457463
# ],
458464
[
459-
sg.Text(i18n("harvest进程数")),
465+
sg.Text(
466+
i18n(
467+
"Number of CPU processes used for harvest pitch algorithm"
468+
)
469+
),
460470
sg.Slider(
461471
range=(1, n_cpu),
462472
key="n_cpu",
@@ -469,7 +479,7 @@ def launcher(self):
469479
),
470480
],
471481
[
472-
sg.Text(i18n("淡入淡出长度")),
482+
sg.Text(i18n("Fade length")),
473483
sg.Slider(
474484
range=(0.01, 0.15),
475485
key="crossfade_length",
@@ -480,7 +490,7 @@ def launcher(self):
480490
),
481491
],
482492
[
483-
sg.Text(i18n("额外推理时长")),
493+
sg.Text(i18n("Extra inference time")),
484494
sg.Slider(
485495
range=(0.05, 5.00),
486496
key="extra_time",
@@ -492,17 +502,17 @@ def launcher(self):
492502
],
493503
[
494504
sg.Checkbox(
495-
i18n("输入降噪"),
505+
i18n("Input noise reduction"),
496506
key="I_noise_reduce",
497507
enable_events=True,
498508
),
499509
sg.Checkbox(
500-
i18n("输出降噪"),
510+
i18n("Output noise reduction"),
501511
key="O_noise_reduce",
502512
enable_events=True,
503513
),
504514
sg.Checkbox(
505-
i18n("启用相位声码器"),
515+
i18n("Enable phase vocoder"),
506516
key="use_pv",
507517
default=data.get("use_pv", False),
508518
enable_events=True,
@@ -516,29 +526,29 @@ def launcher(self):
516526
],
517527
# [sg.Text("注:首次使用JIT加速时,会出现卡顿,\n 并伴随一些噪音,但这是正常现象!")],
518528
],
519-
title=i18n("性能设置"),
529+
title=i18n("Performance settings"),
520530
),
521531
],
522532
[
523-
sg.Button(i18n("开始音频转换"), key="start_vc"),
524-
sg.Button(i18n("停止音频转换"), key="stop_vc"),
533+
sg.Button(i18n("Start audio conversion"), key="start_vc"),
534+
sg.Button(i18n("Stop audio conversion"), key="stop_vc"),
525535
sg.Radio(
526-
i18n("输入监听"),
536+
i18n("Input voice monitor"),
527537
"function",
528538
key="im",
529539
default=False,
530540
enable_events=True,
531541
),
532542
sg.Radio(
533-
i18n("输出变声"),
543+
i18n("Output converted voice"),
534544
"function",
535545
key="vc",
536546
default=True,
537547
enable_events=True,
538548
),
539-
sg.Text(i18n("算法延迟(ms)")),
549+
sg.Text(i18n("Algorithmic delays (ms)")),
540550
sg.Text("0", key="delay_time"),
541-
sg.Text(i18n("推理时间(ms)")),
551+
sg.Text(i18n("Inference time (ms)")),
542552
sg.Text("0", key="infer_time"),
543553
],
544554
]
@@ -669,17 +679,17 @@ def event_handler(self):
669679

670680
def set_values(self, values):
671681
if len(values["pth_path"].strip()) == 0:
672-
sg.popup(i18n("请选择pth文件"))
682+
sg.popup(i18n("Please choose the .pth file"))
673683
return False
674684
if len(values["index_path"].strip()) == 0:
675-
sg.popup(i18n("请选择index文件"))
685+
sg.popup(i18n("Please choose the .index file"))
676686
return False
677687
pattern = re.compile("[^\x00-\x7F]+")
678688
if pattern.findall(values["pth_path"]):
679-
sg.popup(i18n("pth文件路径不可包含中文"))
689+
sg.popup(i18n("pth path cannot contain unicode characters"))
680690
return False
681691
if pattern.findall(values["index_path"]):
682-
sg.popup(i18n("index文件路径不可包含中文"))
692+
sg.popup(i18n("index path cannot contain unicode characters"))
683693
return False
684694
self.set_devices(values["sg_input_device"], values["sg_output_device"])
685695
self.config.use_jit = False # values["use_jit"]

0 commit comments

Comments
 (0)