translators icon indicating copy to clipboard operation
translators copied to clipboard

[Bug]: Unable to find server backend.

Open dvdcjw opened this issue 2 years ago • 1 comments

Debug Tips

  • [X] I'm sure I've read this project's Issues of README.

What happened?

hey guys I'm trying to make a GUI program right now, I just don't want the user to touch the CLI. Is there anyway to prevent this from happening?

APP Version

5.8.9

Python Version

3.11

Runtime Environment

Windows 10

Country/Region

China

Relevant log output

\Lib\site-packages\translators\server.py:331: UserWarning: Unable to find server backend.
 warnings.warn('Unable to find server backend.\n\n')
Please input your server region need to visit:
eg: [Qatar, China, ...]

Screenshots

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

dvdcjw avatar Feb 11 '24 11:02 dvdcjw

@dvdcjw Hello friend, Attention this ->https://github.com/UlionTse/translators/blob/c20c815ffe0ed75c551eef37d86055d8a8e435c7/translators/server.py#L307, you can add these codes first:

import os

os.environ['translators_default_region'] = 'CN'

UlionTse avatar Feb 13 '24 03:02 UlionTse