-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Translation
First of all, thank you for being interested in IINA! If you want to contribute and localize this project in your language, please follow the instructions below.
For full git clone
or GitHub Desktop usage, please refer to Build the Project.
Create a new branch from latest develop
, and its name should indicate your language.
- If you are using git:
git checkout -b <branch_name> develop
- If you are using GitHub desktop:
Type your branch name and create a new branch based on develop.
Please refer to Build the Project and get ready to build the app.
Then press Finish
directly. Xcode will create a localized copy for each localizable file in the project. If you see a disclosure triangle (▶︎) next to a file in the navigation panel, then it is localizable, and you can check localized versions by clicking it. Typically, xib
, strings
and Contribution.rtf
files are needed to be localized.
-
XIB files
There should be several
.strings
files under each.xib
file. Choose the one in your language and change English expressions in the file into your language.You can copy an Object ID, e.g.
eCe-SS-Wlj
and search it in.xib
files using ⌘+F to find the actual object in UI. -
Strings files
All
.strings
files should also be translated. Please refer to the English(Base) version.Please take extra care for format strings like "%@" and "%d". IINA will crash on incorrect format strings.
-
Contribution.rtf
This file will be displayed in About window. It's up to you to translate the GPLv3 statement, but please also keep the English one as it's the only official version.
Please add your Email or github account name in your Contribution.rtf
too.
Starting from 1.0, IINA Translation Utility is the recommended way to check for errors or missing keys.
Before 0.0.15, IINA included a script to check whether you missed anything, or probably made any mistake. If you want to utilize it, please firstly add your language in the script, and then under project root folder, run
swift other/check_translation.swift
You may submit the updated
check_translation.swift
together in your pull request.
Build and run the app and see whether everything is displayed properly. Please make sure the preference panel will resize automatically and smoothly for wider content.
- For git:
git add .
git commit -am "<commit message>"
git push
If you have not pushed yet to GitHub
git push --set-upstream origin <branch_name>
- For GitHub Desktop:
Press Uncommitted Change
tab, edit your summary and description (optional). Then commit to your branch.
Use Publish
button to push your work to GitHub.
Go to the main page of IINA on GitHub. GitHub will prompt you to make a Pull Request using your most recent branch. Press Compare and pull request
.
Make sure to change the base branch into develop.Now the base branch is already develop.
As IINA is updated frequently, please better stay connected and update your translation promptly.
When IINA needs new translation from you, I (@lhc70000) will mention you in github or the Slack group. If I can't receive your response in several days, IINA will release a next version with missing translations 😰. Please check the Translation Status page for progresses, and feel free to update obsolete translations.
Before starting work, please make sure your branch is up-to-date with the develop
branch.
Now the recommended way to update translations is IINA Translation Utility.
Sadly, Xcode is unable to update an existing
strings
file, so you must update the file manually. For big changes, please consider recreating the translation file or using other tools.
Usually, I'll provide you newly added keys, but you're recommended to check missing keys by yourself.
For xib
files, please just append lines in the strings
file in the same format. E.g. for key eCe-SS-Wlj
, your should add
eCe-SS-Wlj.title = "Your translation";
You can also search this ID in the corresponding xib file to find the actual UI component.