subins2000 / kde-weblate

Weblate instance for KDE
GNU General Public License v3.0
3 stars 1 forks source link

KDE Weblate Translation

Translation

IMPORTANT : After translation, add your name to Your names (NAME OF TRANSLATORS) and email to Your emails. If there already exist a value, add yours after a comma. Example :

Workflow

There are 3 repos :

We need to make the intermediary repo and then setup Weblate.

Weblate will work with the intermediary repo, and we'll have to manually merge the intermediary repo with KDE upstream (not that much of difficulty).

Setup

If your language team is not using Summit, use it. Instructions here.

Using summit helps you to maintain only one branch for both trunk and stable.

Intermediary repo

We need to create a new git repo which will act as an intermediary between KDE upstream repo (SVN) and Weblate.

Weblate will use this intermediary git repo for syncing.

The intermediary repo after the setup will have this folder structure :

Make the upstream directory structure :

mkdir upstream upstream/summit
cd upstream/summit
svn co svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-support/ml/summit/messages ml
svn co svn+ssh://svn@svn.kde.org/home/kde/trunk/l10n-support/templates/summit/messages templates

Then, make the folder pos in the root, and copy files from upstream/summit folder with the exact sub-directory structure. For example, if you want to add Dolphin file manager (dolphin), then :

mkdir pos pos/ml pos/ml/dolphin
cp "upstream/summit/ml/dolphin/*" "pos/ml/dolphin/"

Adding a new component

Copy file from upstream to corresponding one in pos folder.

Then import from git to weblate (the command in the Importing components to Weblate section) :

weblate import_project ...

Searching for strings

To search for a particular string, do this in upstream :

grep -rnw '.' --include="*.po" -e '"Open Path"'

Weblate

Importing components to Weblate

Each PO file will be a component in Weblate. These components will be under a project in Webalte. dolphin, discover, plasma-workspace will each have their own project.

For example, let's take 'dolphin' :

Optional :

Or you can just disable public registration and allow specific users only.

Social Auth

Intermediary Repo

Syncing With KDE Upstream

This is done in 2 processes (see the diagram at the end) :

  1. "Weblate Sync Process"
  2. "Merge Process"

Weblate Sync Process :

Merge Process :

Steps till Weblate pull changes can be done periodically to keep Weblate POs up-to-date with upstream.

Better add a webhook in GitHub to Weblate so that Weblate is known of the changes automatically. Do this with the weblate branch.

Illutsration

Notes

SVN Tips

If you see a ? next to files when doing svn status, then those files are untracked. You can track them all with :

# ? means file is new
# You may wanna add new files too (this is the equivalent of git add --all) :
svn status | grep '?' | sed 's/^.* /svn add /' | bash

To revert local changes (git checkout) :

svn revert --recursive path

git vs svn commands table