jianchang512 / stt

Voice Recognition to Text Tool / 一个离线运行的本地语音识别转文字服务,输出json、srt字幕带时间戳、纯文字格式
https://pyvideotrans.com
GNU General Public License v3.0
1.74k stars 195 forks source link

locale.getdefaultlocale Error in cfg.py #26

Open pyvadev opened 3 months ago

pyvadev commented 3 months ago

Env

version: 0.92 platform: Mac Air M1

pull project as README and run, then throw error as follow:

Traceback (most recent call last):
  File ".../stt/start.py", line 13, in <module>
    from stslib import cfg, tool
  File ".../stt/stslib/cfg.py", line 41, in <module>
    sets=parse_ini()
  File ".../stt/stslib/cfg.py", line 11, in parse_ini
    "lang":"en" if locale.getdefaultlocale()[0].split('_')[0].lower() != 'zh' else "zh", 
AttributeError: 'NoneType' object has no attribute 'split'
jianchang512 commented 3 months ago

../stt/stslib/cfg.py line 11

"lang":"en" if locale.getdefaultlocale()[0].split('_')[0].lower() != 'zh' else "zh",

edit to

"lang":"en"