Skip to content

Angus-repo/xliff-trans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supported Languages

Language Guidelines
English (en) README
Chinese Traditional (zh-TW) README_zh-TW
Czech (cs) README_cs

Xliff-trans Translation Tool

This tool supports the xliff(1.2) format and performs XLIFF translation through external AI services (such as ChatGPT).

Instructions:

1. Export XLIFF file from Crowdin:

In this example, we use Crowdin. Choose "Export in XLIFF" from your project, then download the file. image

2. Download the program

xliff-trans release:

java -jar xliff-trans-x.x.x.jar

Select the appropriate file for your operating system:

Windows users:

This program is written in Java and requires JDK1.8 or JRE8 or later versions. If JDK8 or above is not installed, please first visit Java download

 xliff-trans-0.1.1.zip
macOS users:

If you have Java 8 or higher installed, download:

 xliff-trans-x.x.x-macos.tar.gz

If you do not have Java 8 or higher, or are unsure, download the version that includes the Java runtime:

 xliff-trans-x.x.x-macos-withJRE.tar.gz
Linux users:

This program is written in Java and requires JDK1.8 or JRE8 or later versions. If JDK8 or above is not installed, please first visit Java download

 xliff-trans-x.x.x.tar.gz

After downloading, please extract the files first.

3. AI Translation Setup (Optional):

    3.1 Edit prefix_promp.txt (Optional):

    If you plan to use AI-based token translation, write the target language and specify any translation terms or tone in the prefix_promp.txt.

Note: The quality of your translation depends on the AI model and your promp, so make sure to input the desired translation style fully in the prefix_promp.txt.

    3.2 Specify OpenAI Key in Config.properties (Optional):

    Enter your OpenAI key token (additional fees apply). Follow this video for setup: Watch the video

After obtaining the api_key, enter it in Config.properties

api_key=sk-proj-xxxxxxxxxxxxxxxxxxxxxx

If you need to modify the AI model, specify it here

model_version=gpt-4o-mini

Note: The models you can use depend on the Usage tiers. If you've paid $5, you can be a Tier1 user. See Tier1 details here.

4. Start xliff-trans:

Windows users:

Run:

run.bat

Note: Windows may display a security warning. Click "More info" => "Run anyway".

image

image

macOS users:

Run:

./run_macos.sh

or

./run_macos_withJRE.sh
Linux users:

Run:

java -cp . -jar xliff-trans-0.1.1.jar

After starting the program, you will see file path selections, action buttons, and log output at the bottom. First, choose the path of the XLIFF file you want to translate (e.g., /path/xxx.xliff).

5. Step 1 - Extract text for translation:

Select the XLIFF file path and press "Step 1". The program will extract text with the needs-transcate attribute and save it to /path/xxx.xliff_source_text.txt. This will contain only source text for AI translation use.

6. Step 2 - Start Translation:

    Method 1: Use the ChatGPT web interface:

    Copy paragraphs (suggested 100 lines) from /path/xxx.xliff_source.txt, paste them into the ChatGPT conversation. Depending on your model, translation speed and accuracy may vary. For example, using GPT-4o, paste 100 lines at a time, wait for the result, and then save the result to /path/xxx.xliff_target.txt.

    Method 2: Use the OpenAI API (Additional fees apply):

    You need to bind a credit card and generate an API token.     > Note: Make sure you've entered the api_key, refer to 3. AI Translation Setup (Optional)

    In the prefix_promp.txt, specify the target language and mention any specific translation rules for terms. Once everything is ready, press "Step 2" to send 50 lines of text to OpenAI at a time, using the default GPT-4o-mini. The result will be saved in /path/xxx.xliff_target.txt.

Non-source tag data will be skipped in "Step 3", so if incorrect XML structures occur, you can ignore them. API usage fees can be tracked at https://platform.openai.com/usage (updates may have a few minutes delay).

7. Step 3 - Merge translation into XLIFF:

Click "Step 3" to merge the translation from /path/xxx.xliff_target.txt into the original XLIFF file based on the ID, then save it as /path/xxx.xliff_update.xliff and change the target attribute to translated

<target state="translated">xxxxxx</target>

8. Upload the translated XLIFF:

Upload the /path/xxx.xliff_update.xliff to Crowdin and check the results.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages