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
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.
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.
Running the following command:
$ bun --inspect index.tsand 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.
- Qt Linguist TS file format XSD
- OpenAI Completions API
- Ollama API#Structured outputs
- Transifex OpenAPI
Footnotes
-
Transifex platform will ignore strings marked with
type="unfinished", so for uploading purpose we won't keep this attribute. ↩