Git Product home page Git Product logo

freed-wu / translate-shell Goto Github PK

View Code? Open in Web Editor NEW
26.0 3.0 5.0 528 KB

Translate text by google, bing, youdaozhiyun, haici, stardict, openai, large language model of local machine, etc at same time from CLI, GUI (GNU/Linux, Android, macOS and Windows), REPL, python, shell and vim.

Home Page: https://translate-shell.readthedocs.io/

License: GNU General Public License v3.0

Vim Script 1.65% Python 94.98% Shell 0.54% Perl 0.13% Jinja 1.92% Dockerfile 0.77%
commandline-tool python translate vim lsp-server bing chatgpt google llama llamacpp

translate-shell's People

Contributors

deepsource-autofix[bot] avatar deepsourcebot avatar freed-wu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

translate-shell's Issues

Raise error when run `trans`, and I can not launch the desktop entry.

Traceback (most recent call last):
  File "/home/wu/anaconda3/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/home/wu/anaconda3/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/home/wu/anaconda3/lib/python3.9/site-packages/translate_shell/ui/gui.py", line 20, in run
    args.text = check_output(clipper, universal_newlines=True)
  File "/home/wu/anaconda3/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/home/wu/anaconda3/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/wu/anaconda3/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/home/wu/anaconda3/lib/python3.9/subprocess.py", line 1691, in _execute_child
    executable = args[0]
IndexError: list index out of range```

Windows support

trans.exe Free as in Freedom

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\repo\translate-shell\venv\Scripts\trans.exe\__main__.py", line 7, in <module>
  File "D:\repo\translate-shell\venv\Lib\site-packages\translate_shell\__main__.py", line 186, in main
    init(args)
  File "D:\repo\translate-shell\venv\Lib\site-packages\translate_shell\ui\__init__.py", line 123, in init
    _readline = init_readline()
                ^^^^^^^^^^^^^^^
  File "D:\repo\translate-shell\venv\Lib\site-packages\translate_shell\ui\__init__.py", line 47, in init_readline
    atexit.register(readline.write_history_file, HISTORY_FILE)  # type: ignore
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'translate_shell.external.readline' has no attribute 'write_history_file'. Did you mean: 'read_history_file'?

How can I fix it?

'gbk' codec can't decode byte 0x93 in position 1370: illegal multibyte sequence

$ trans
Traceback (most recent call last):
  File "C:\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Python\Python310\Scripts\trans.exe\__main__.py", line 4, in <module>
  File "C:\Python\Python310\lib\site-packages\translate_shell\__main__.py", line 36, in <module>
    LANGS = json.loads((ASSETS_PATH / "json" / "lang.json").read_text())
  File "C:\Python\Python310\lib\pathlib.py", line 1135, in read_text
    return f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 1370: illegal multibyte sequence

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.