Project

General

Profile

Translating darktable Through git

This is a guide on how to translate darktable through pull requests in git. This is the preferred way, since updates are more likely to get overlooked or forgotten on the mailing list, whereas through pull requests, the developers will keep receiving reminders until an update is implemented.

This guide assumes that your language is already present in darktable. If not, please consult the darktable developers mailing list to have your language added.

Setting Up Git On Your System

Prerequisites

  • Create an account on GitHub, if you don't already have one.
  • Install git and intltool on your system. On Debian/Ubuntu this would be sudo apt-get install git intltool.
  • A po editor such as Lokalize or Poedit.
  • darktable's build dependencies need to be installed on your system. Please refer to Building_darktable_20.
  1. Go to the darktable GitHub page and click the "Fork" icon in the top, right corner. By now you have a complete copy (a "fork") of the darktable repository on your GitHub account.
  2. Start up a terminal, and cd to the place where you want to store a copy of the darktable repository. Then, write the following command to clone your GitHub fork of the repository into the current directory:
    git clone https://github.com/MYGITHUBNAME/darktable.git
    
  3. cd into your newly cloned repository, and assign a remote called "upstream" to the original darktable repository (your fork is referenced to as "origin"):
    cd darktable
    git remote add upstream https://github.com/darktable-org/darktable.git
    

Working Routine

These are the steps you would typically follow, every time you want to work on your translation.

  1. Fetch any new changes to the source code from the original darktable repository "upstream":
    git fetch upstream
    
  2. Optionally change to a non-master branch, in this case darktable-2.0.x. You would typically do this when the project is about to make a new release. If you work on a non-master branch, you will need to change master into the branch name in all steps below. If you want to work on master branch, you can skip this step. Or if you already changed into another branch and want to change back to master, do this step, but with master instead of the branch name. To see which branch you're working on, do git status.
    git checkout darktable-2.0.x
    
  3. Now, merge the fetches changes into you working files:
    git merge upstream/master
    
  4. Build darktable (takes a while), cd into the po directory where translations are, and update your language file to reflect the newest text strings found in the source files:
    ./build.sh
    cd po
    intltool-update da #change da into your language
    
  5. Start up your po editor and start translating.
  6. Tell git to include your changed file into the next commit, then do the actual commit, and then push your commit to your fork on GitHub:
    git add da.po  #change into your po file
    git commit -m 'Updated Danish translation'  #obviously change comment to fit your language
    git push origin master
    

    If fact, you can do several commits before pushing, and you can push several times before going to the next step.
  7. Go to the GitHib page for your darktable fork. Click to see details of your latest commit(s). There you'll be presented with an option to create a pull request. When you've done so, you have told the darktable developers that your changes are ready for merging into the actual darktable repository.

There's a very recommendable free book about git available at: http://git-scm.com/book

Also available in: PDF HTML TXT