GithubHelp home page GithubHelp logo

lin-jun-xiang / action-translate-readme Goto Github PK

View Code? Open in Web Editor NEW
34.0 34.0 6.0 65.93 MB

:books:Free GPT-3.5 Generate the README in Multiple Languages via CI/CD

Home Page: https://github.com/marketplace/actions/auto-translate-readme

License: MIT License

Shell 52.84% Python 47.16%
action chatgpt ci-cd cicd github-actions gpt gpt3 gpt4free markdown readme translation

action-translate-readme's People

Contributors

lin-jun-xiang 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

action-translate-readme's Issues

Unsolve: 'Tab' & '[](#)'

After translating we'll get some problem as following:

  1. 'Tab' will be ignore. (we should let tab be exist)
  2. '' the hyperlinks in markdown will be translated that cannot work. (we should ignore trans this)

Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled

Run Lin-jun-xiang/action-translate-readme@v2
Run actions/checkout@v3
Syncing repository: Silver-Fang/Cpp_Standard_Library
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/4e70c5d3-99e4-46f2-94c0-0c8c4e9439fc' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/Cpp_Standard_Library/Cpp_Standard_Library
/usr/bin/git config --local --get remote.origin.url
https://github.com/Silver-Fang/Cpp_Standard_Library
Removing previously created refs, to avoid conflicts
/usr/bin/git submodule status
Cleaning the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=3 origin +5b23d7158ec13818ee6cc76e83401813bf867f51:refs/remotes/origin/master
Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
The process '/usr/bin/git' failed with exit code 128
Waiting 19 seconds before trying again
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=3 origin +5b23d7158ec13818ee6cc76e83401813bf867f51:refs/remotes/origin/master
Error: fatal: could not read Username for 'https://github.com': terminal prompts disabled
The process '/usr/bin/git' failed with exit code 128
Waiting 12 seconds before trying again
/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=3 origin +5b23d7158ec13818ee6cc76e83401813bf867f51:refs/remotes/origin/master
Error: fatal: could not read Username for 'https://github.com/': terminal prompts disabled
Error: The process '/usr/bin/git' failed with exit code 128

Don't trans inline code ``

translation.sh trans:
翻譯.sh

code --list-extensions | ForEach-Object {"code --install-extension $_"} > extensions.ps1 trans:
代碼--列表擴展| ForEach-Object {"code --install-extension $_"} > extensions.ps1

上述兩種都是錯誤翻譯,inline code 不該進行翻譯

Error translation

when the inline code have some special chars, the action will run in the while loop

The special chars: []


ex:
line='Union[str, int, None]'

in the get_inline_code function, that while loop will not break


Bug are fixing...

KeyError: 'g4f.Provider.DeepAi'

DeepAi was inactive now.

Run export PROVIDER=g4f.Provider.DeepAi
Traceback (most recent call last):
  File "/home/runner/work/action-translate-readme/action-translate-readme/.//translation.py", line 16, in <module>
    PROVIDER = PROVIDER_MAPPING[os.environ.get('PROVIDER')]
KeyError: 'g4f.Provider.DeepAi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/action-translate-readme/action-translate-readme/.//translation.py", line 18, in <module>
    PROVIDER = PROVIDER_MAPPING['g4f.Provider.DeepAi']
KeyError: 'g4f.Provider.DeepAi'
Error: Process completed with exit code 1.

Translation error

GitHub Action logs:

Notice:  A new release of pip is available: 23.0.1 -> 23.2.1
Notice:  To update, run: pip install --upgrade pip
Collecting tenacity
  Obtaining dependency information for tenacity from https://files.pythonhosted.org/packages/f4/f1/990741d5bb2487d529d20a433210ffa136a367751e454214013b441c4575/tenacity-8.2.3-py3-none-any.whl.metadata
  Downloading tenacity-8.2.3-py3-none-any.whl.metadata (1.0 kB)
Downloading tenacity-8.2.3-py3-none-any.whl (24 kB)
Installing collected packages: tenacity
Successfully installed tenacity-8.2.3

Notice:  A new release of pip is available: 23.0.1 -> 23.2.1
Notice:  To update, run: pip install --upgrade pip
Run export PROVIDER=g4f.Provider.DeepAi
README.md changed.
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/g4f/Provider/helper.py", line 21, in get_event_loop
    asyncio.get_running_loop()
RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tenacity/__init__.py", line 382, in __call__
    result = fn(*args, **kwargs)
  File "/home/runner/work/_actions/Lin-jun-xiang/action-translate-readme/v2/translation.py", line 34, in chat_completion
    return g4f.ChatCompletion.create(
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/g4f/__init__.py", line 55, in create
    return result if stream else ''.join(result)
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/g4f/Provider/base_provider.py", line 99, in create_completion
    loop = get_event_loop()
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/g4f/Provider/helper.py", line 23, in get_event_loop
    return _event_loop_policy.get_event_loop()
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/asyncio/events.py", line 656, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'Thread-1 (worker)'.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/work/_actions/Lin-jun-xiang/action-translate-readme/v2/translation.py", line 115, in <module>
    main()
  File "/home/runner/work/_actions/Lin-jun-xiang/action-translate-readme/v2/translation.py", line 111, in main
    pool.map(multi_exec, LAGNS)
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/home/runner/work/_actions/Lin-jun-xiang/action-translate-readme/v2/translation.py", line 102, in multi_exec
    translated_content = translate_content(content, output_lang)
  File "/home/runner/work/_actions/Lin-jun-xiang/action-translate-readme/v2/translation.py", line 53, in translate_content
    response = chat_completion(translate_query)
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tenacity/__init__.py", line [289](https://github.com/yym68686/ChatGPT-Telegram-Bot/actions/runs/6314161905/job/17143809226#step:3:302), in wrapped_f
    return self(f, *args, **kw)
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tenacity/__init__.py", line 379, in __call__
    do = self.iter(retry_state=retry_state)
  File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tenacity/__init__.py", line 326, in iter
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7fbbf7e9e230 state=finished raised RuntimeError>]
Error: Process completed with exit code 1.

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.