|
4 years ago 0 |
Hi, this tutorial will show you how to contribute to spices by translating them. Themes don't need translations, so this only applies to applets, desklets and extensions.
SPICE_NAME-YOUR_LANGUAGE_CODE
) from the master one. For example, in this screenshot, there is a branch for the French translation of the SpicesUpdate applet. Clone your branch on your computer. Type into the terminal (replace capitalized words accordingly):
$ git clone -b SPICE_NAME-YOUR_LANGUAGE_CODE --single-branch https://github.com/YOUR_GITHUB_ACCOUNT/cinnamon-spices-XXX.git
po
directory. Now we need to create a YOUR_LANGUAGE_CODE.po
file, or work on it if it already exists. If you don't see your language code, right-click the SPICE_NAME.pot
file, and then open with Poedit. Click on Create New Translation at the bottom. Select the language you want to translate into, then get to work.If YOUR_LANGUAGE_CODE.po
is already in the po/ directory, you can open the file and work on it. You can save with Ctrl+S. A few other useful shortcuts:
You obtain a YOUR_LANGUAGE_CODE.po
file. Add and commit this file to the git repository using the following commands, from the terminal (replace capitalized words accordingly; you have to do this even if the file already existed before you edited it):
$ git add SPICE_NAME/files/SPICE_NAME/po/YOUR_LANGUAGE_CODE.po $ git commit -m "[SPICE_NAME] Added YOUR_LANGUAGE_CODE.po"
Push it to GitHub:
$ git push origin
Questions:
Q: What if I want to translate more applets? Do I have to make a new fork and clone every time?
A:
Nope! You can actually sync from the upstream repository (linuxmint/cinnamon-spices-applets, linuxmint/cinnamon-spices-desklets or linuxmint/cinnamon-spices-extensions). First, navigate to the folder where you first copied your repository. Then, add the upstream (full tutorial here):
$ git remote add upstream https://github.com/linuxmint/cinnamon-spices-XXX.git
Now, every time you want to work on a new translation, you can fetch the latest commits from the upstream branch (full tutorial here):
$ git fetch upstream $ git checkout master $ git merge upstream/master $ git push origin master
Then create a new branch:
$ git checkout -b SPICE_NAME-YOUR_LANGUAGE_CODE
Do your work (steps 6, 7, 8). Then push it to GitHub:
$ git push --set-upstream origin SPICE_NAME-YOUR_LANGUAGE_CODE
And now you can make another pull request from GitHub.
Q: Are there guidelines/best practices for translation?
A: Depends on the language. You can go to the Linux Mint translation section on Launchpad (link here - this is for OS-specific programs, not spices). Look for your language (you might have to click "view all languages" on the bottom right). Then click on a program from the list (from the column under "Template Name"). There should be a notice at the top saying "Before translating, be sure to go through Linux Mint instructions (and X guidelines).". If the second part is missing, then there are no guidelines.
Q: I can't see the sidebar in Poedit!
A: Try switching to a bright theme in Themes > Controls.
Tutorial based on the one written by claudiux for Spices Update.