Git Product home page Git Product logo

translate-renpy's Introduction

TranslateRenPy

TranslateRenPy

Author: duc010298-1

Features

  • Unlimited number of characters to be translated
  • Using selenium to translate (no need Yandex API key or Google Cloud Services - free for all)
  • Automatically override available languages (you do not need renpy sdk to Generate Translations)
  • Automatically ignores variables or special characters of Renpy during translation:

    Example

    1. [earnings] is kept after translation
      # m "OK, let's check the school's account. The school's owners have transferred me [earnings] credits."
      m "OK, vérifions le compte de l'école. Les propriétaires de l'école m'ont transféré [earnings] crédits."
      
    2. \n (break line) is kept after translation
      old "Loading will lose unsaved progress.\nAre you sure you want to do this?"
      new "Le chargement perdra la progression non enregistrée.\nEs-tu sûr de vouloir faire ça?"
      
    3. %s is kept after translation
      old "Saved screenshot as %s."
      new "Capture d'écran enregistrée sous %s."
      
    And some other special cases

Quick Start

Installation instructions

  1. Install Python

    You need Python 3 or later to run translate-renpy

    For Windows, packages are available at

    https://www.python.org/getit/

  2. Install requirements

    Clone or download zip source code, open Command line in source code folder

    Install requirements using pip:

     pip install -r requirements.txt
    
  3. Install Driver

    You should instal Chrome browser and check your browser version

    And then download ChromeDriver suitable for your browser at: chromedriver.chromium.org

    After downloaded, extract it, copy and rewrite chromedriver to folder Driver\[your_os] in source code folder

Usage

  1. First you need generate RenPy translations

    You can read and follow Generate RenPy translations section on this post:

    F95 RenPy Translation tool

    ** Note: Some games do not compile rpyc files. If in the folder [your_game]\game\tl\[language] there are many files with .rpy extension look like on screen below, you can skip this step.

    preview

  2. Run run.bat file

    For original language and into language, you should go to cloud.google.com/translate/docs/languages and find ISO-639-1 Code of your language

    Number of thread, this is the number of browser tabs the tool will open simultaneously (I recommended 16 for 8Gb Ram)

    You can show the browser during translation but I recommend you to hide it to avoid using too much CPU.

Help me

  • Please Star this github repository if it is of help to you

translate-renpy's People

Contributors

duc010298-1 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

Watchers

 avatar  avatar  avatar  avatar

translate-renpy's Issues

Thank

Thank you for this tool, just an improvement of the visual interface or at least modifiable variables to launch it directly from a python editor.
Also as you use the browser, the Deepl translator would be perfect.

Rate limit

after a while its me but its i do what?

Translation was stopped because the issue of network
Press Enter to try again...

Google translate page just updated HTML

Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "trans-ren.py", line 411, in runner
input_text_area = driver.find_element(By.XPATH, XPATH_INPUT)
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/c-wiz/div/div[2]/c-wiz/div[2]/c-wiz/div[1]/div[2]/div[2]/c-wiz[1]/span/span/div/textarea"}
(Session info: chrome=90.0.4430.93)

(Translation was stopped because the issue of network)still there

First Attempt A project yesterday and finishing the translation. Today i open the next one again, the site(google translate) opens, but does not translate(Where there are words do not show, just open the site like that), and After a while, 1.6 shows a Google Translate timeout.

Is that because Google translate queries the same IP over a short period of time caused by excessive translation?

Thank you for your software

video

Can you make a video on how this is done?:>

Hello I still have the same problem I do not understand

Total dialogue done on thread 1: 0
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "trans-ren.py", line 411, in runner
input_text_area = driver.find_element(By.XPATH, XPATH_INPUT)
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\micka\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/c-wiz/div/div[2]/c-wiz/div[2]/c-wiz/div[1]/div[2]/div[2]/c-wiz[1]/span/span/div/textarea"}
(Session info: chrome=90.0.4430.93)

Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/c-wiz/div/div[2]/c-wiz/div[2]/c-wiz/div[1]/div[2]/div[2]/c-wiz[1]/span/span/div/textarea"} Problem line

Rate limit

Hi, how are you, you know why this "error" is happening, all the time I have to press enter to continue, do you know how to fix it?

Note: I already checked my internet and it's ok

image

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.