Jump to content

Localization/Concepts/Version Control

From KDE TechBase

When working on translations for KDE, you'll have to interact with the KDE SVN server to pull down the current PO files, update your local copy of them with new/updated strings, and to commit back your work so that it can actually be included in KDE. This article will go over how to use SVN with the KDE translation server, https://websvn.kde.org/.

Note that this article assumes a familiarity with Git, and doesn't provide a definition for common version control terms. (commit, branch, push, pull etc.) See https://git-scm.com/docs/user-manual.html#glossary if you see a term you don't fully understand.

Setting Up SVN

SubVersion (SVN) is the version control software you'll be using to pull down and commit back translation changes. You should be able to get it from your systems package manager, or directly from their website at https://subversion.apache.org/.

Note that in order to commit your changes back to the server, you'll need to have OpenSSH installed on your system, and have the same key that you added to your KDE Invent Account on your system. (See https://identity.kde.org/ or contact the localisation mailing list at kde-i18n-doc at kde.org if you don't have a developer account)

Common SVN Commands

Cloning or "Checking out" a directory

To copy a directory from the server to your local machine, navigate to the directory at https://websvn.kde.org/. In the top menu, you'll be given two different links, labeled "Anonymous SVN URL" and "Developer SVN URL". To clone the directory and create a local copy of it, you'll need to use one of these URLs. The anonymous URL can be used without a developer account, but can't be used to push changes back up to the server. The developer URL is what you'll need to use if you're going to be actively working on a translation.

Copy the developer URL, open a terminal, change directory to where you want the local copy to be created and run svn checkout LINK (Note that unlike Git, SVN does not create a subdirectory when cloning a repository)

Updating your local copy

Update your local copy by running svn update, which will pull in any new changes from the SVN server. You should do this frequently to make sure that you always have the most recent version of the PO files you're working on.

Committing files back to the server

In order to have your changes pushed back up to the SVN server, you'll need to commit them by running svn commit. This will then open a file showing you what's been modified or added since the last commit, and it'll ask you to input a message to add to the commit (you can alternatively skip this by running svn commit -m "Message").

This will then check the committed PO files for syntax errors, upload them to the server and add them as a new commit. Committing work always pushes to the server with SVN.

Adding and removing files from SVN

Unlike something like Git, files are not automatically added/removed from the version control when they're created/deleted on disk. To remove a file, run svn delete FILE. Run svn add FILE to add an already existing file to the version control.

In order to check which files aren't under version control, and which files have been modified since the last commit, run svn status.