Skip to content

linuxdeepin/deepin-auto-translation

Repository files navigation

deepin-auto-translation

Pre-fill untranslated strings in Qt Linguist TS files using LLM, before translators gets involved.

Pre-filled strings can be marked with an type="unfinished" attribute, so translators will know these strings needs to be reviewed.1

Usage

This repo offers a set of scripts and utility functions that can help you pre-fill translations for Qt-based projects. It still needs to be guided to use since the results returned by LLM are not always correct and not reliable in some cases.

Running the Project

In convenience, we recommend using bun as your runtime environment. After installing it according to the official guide, use bun install to install the necessary dependencies, and then run bun index.ts to start the project.

Please note that index.ts does not provide a complete set of behaviors, but rather provides a simple example to demonstrate how to use the helper scripts/functions provided by this tool. You will need to modify index.ts yourself to achieve your needs.

Debugging Suggestions

Running the following command:

$ bun --inspect index.ts

and then visit the address printed in the console to open the debugger. This will allow you to debug your code in the browser. Even if you don't plan to use a debugger, it's still recommended to use this method to view logs, as it allows you to easily collapse certain logs. You can also use other v8 inspector compatible debugging tools.

Resources and Links

Footnotes

  1. Transifex platform will ignore strings marked with type="unfinished", so for uploading purpose we won't keep this attribute.

About

Translate Qt Linguist TS file format to different languages via OpenAI Completions API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published