website-raghukamath.com/content/journal/how-to-translate-krita/index.md

7.7 KiB

+++ title = "How to translate Krita to your own language?" date = 2021-04-04T12:00:44+05:30 thumb = "/journal/how-to-translate-krita/translate-hero.jpg" tags = ["translation", "Free Software", "KDE", "Krita"] keywords = ["Free Software", "tools", "hardware", "krita"] description = "A step by step guide for translating Krita's UI into your native language" +++

While painting in Krita one day, out of curiosity I switched the application language to Hindi which is one of the major local language in India. Some parts of the UI were translated but most of it was untranslated. I thought about fixing this problem and started to research about how to get started in translating.

Krita translated UI

While there are many workflows for translating I found Lokalize to be the easiest one of them. I started using Lokalize & svn to work on Hindi translations for KDE. The Lokalize handbook is a good resource, but I felt that I needed more simplified step-by-step guide to set up the work environment and get started. After setting it up for my self, I am sharing it here so that any new Lokalize & svn user will find it easy. This post covers the process in step by step to help others translate Krita or any of the KDE apps in their local language and contribute to the KDE translation team. This guide is made for Linux users, but you can use it for other platforms too except for the step where we install the software. I plan to update these instructions in future to cover how to do this on Windows platform too. So here it goes.

1. Install Lokalize and Subversion

We will install Lokalize the KDE's translation software and Subversion a version control system software from our distribution's repository.

$ sudo apt install lokalize subversion  # for ubuntu/debian distros
$ sudo dnf install lokalize subversion # for Fedora the distribution that I am using.

2. Create working folders

We will create a parent folder which will have the source and output folder for our translations. You can do this step from your file explorer too.

# Make a parent folder where we will have our translation work
mkdir translations
cd translation

3. Clone the source and target

The following command clones the Hindi (hi) folder where we will save the translated .PO files. This will we cloned inside the translation folder.

svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kf5/hi

The following command clones the template folder where the original untranslated .pot files are stored. We take these .pot files and add translations to them, save them as .po file in the hi folder under relevant project sub folder. Lokalize does this automatically for us.

svn co svn://anonsvn.kde.org/home/kde/branches/stable/l10n-kf5/templates
Note - We are cloning from the stable folder, since Krita takes translation at releases time from this. If you want to work on the blleding edge version of Krita or any application you can clone the language sub flder trunk folder. Browse the translation repository here -> https://websvn.kde.org/

Once we have cloned both folder in to our machine, the directory structure will be:

translations (parent folder)
|----> hi (sub folder)
|----> templates (sub folder)

Screenshot of folder structure

4. Set up Lokalize

  1. Open Lokalize and go to Settings > Configure Lokalize
  2. In the identities tab put your name email and choose the default language as Hindi (hi). Default mailing list - kde-l10n-hi at kde.org. Default language team - Kde-hindi and lastly add your name in hindi for lokalized name.

Screenshot of settings

5. Set up our project.

  1. To open our project go to - Project > Open Project

  2. Browse to the hi folder that we cloned earlier and choose the index.lokalize file present in the folder. It will fetch all the translations and files and will show the status of translations in the project overview tab. The Red progress bar means there is no translation yet, green means translated and yellow means the string has changed and the translation needs an update.

  3. Make sure the project is correctly set up. Go to projects > configure projects and check the details in the general and advanced section:

General
ID: kde-hi
Target language: Hindi(hi)
Mailing list: kde-l10n-hi at kde.org
Root folder : path of the hi folder that we cloned
Glossary: path_of_the_hi_folder/terms.tbx

Screenshot of settings

Advanced (Paths subsection)
Template files folder: path to the templates folder we cloned earlier
Branch Folder: path to the hi folder

Screenshot of settings

6. Get started

Now that we have set up Lokalize, familiarize yourself to its UI by reading the Lokalize handbook. If you are working on Hindi translations read the Hindi translation style guide given here. This style guide for Hindi was created by Rajesh Ranjan of the Fuel Project and is licensed under CC-BY-SA 3.0. You may request your translation team for the style guide for your language. And start working 😃 👍🏽

Screenshot of settings

If you are translating not just Krita but also other KDE application then choose a small project first to get the understanding of the language and then add in your translations. For translating Krita generally the translation team recommends starting with the libraries that Krita uses. Because translating only the Krita.po file is not enough and some part of the Krita UI generated from the libraries. The libraries are:

  • KConfig
  • KWidgetsAddons
  • KCompletion
  • KCoreAddons
  • KGuiAddons
  • KI18n
  • KItemModels
  • KItemViews
  • KWindowSystem

These can be found in the svn repository, and we have already cloned the entire repository, so you can search for these through Lokalize.

7. Checking and submitting your translations

Once you have done translating and are ready to send your translations for review you must first check for any errors. The following commands can help you in checking the translated files for any error.

msgfmt --check <your_newly_translated_file.po>

It will give you line numbers if there are any error, which you have to correct.

Now after the file is error free, send a mail to this mailing list for Hindi and or the mailing list of the translation team of your language. Let us know that you have completed the translation for a project and want to request review. Someone will answer your mail and then send them the files. They will review it and commit to the main repository. If you are working on Hindi translations you can also ping me on matrix or directly join our matrix room here.

Note - I am also a new contributor so some of the steps may be long or may have some other way of doing it. If anyone notices any error please correct me by commenting here.