pot-app / pot-desktop

🌈一个跨平台的划词翻译和OCR软件 | A cross-platform software for text translation and recognition.
https://pot-app.com
GNU General Public License v3.0
9.87k stars 449 forks source link

Automatic translation of software #927

Open Y-PLONI opened 1 week ago

Y-PLONI commented 1 week ago

Description

Text from any window displayed in any language can be collected using built-in tools. Here is an example code:

`# pip install pywinauto from pywinauto import Desktop

desktop = Desktop(backend="uia")

for window in desktop.windows(): print(f"WINDOW: {window.window_text()}")

for element in window.descendants():
    if element.element_info.control_type == "Text":
        print(f"  TEXT: {element.window_text()}")

`

I would appreciate it if you could create a feature that automatically translates any window that the software identifies as being in a language different from my own.

Application Scenario

for programs that are not translated

References

No response

xtyuns commented 6 days ago

You can implement custom requirements with the help of this api: APIs

Y-PLONI commented 6 days ago

Thank you for the response. I don't know how to do this myself, so I would appreciate it if you could create something ready for this. Please note that obtaining the text from the screen in the way I suggested is much better than any OCR because it gets the text directly from the operating system. I don't know how to code; I simply asked GPT how the Windows text reader [NARRATOR] gets the text from the screen, and eventually, this code came out... I thought of something much more sophisticated: consider an idea where the software constantly checks if text from a specific application does not appear on the screen, so every mouse click event would trigger another text check. This way, no one would have issues with software in other languages; your software would simply recognize the text and translate it on the side of the screen [or better yet, above the original text]. That would be wonderful!!!

‫בתאריך יום א׳, 15 בספט׳ 2024 ב-18:36 מאת ‪xtyuns‬‏ <‪ @.***‬‏>:‬

You can implement custom requirements with the help of this api: APIs https://pot-app.com/docs/invoke.html#api-%E6%96%87%E6%A1%A3

— Reply to this email directly, view it on GitHub https://github.com/pot-app/pot-desktop/issues/927#issuecomment-2351644991, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3Z3BBA3OLD3SJTMWY5VUV3ZWWSO3AVCNFSM6AAAAABOFGHQGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJRGY2DIOJZGE . You are receiving this because you authored the thread.Message ID: @.***>