Qt translation to czech

The story

Pavel translated the Qt libraries strings without knowing it. We now try to send this huge contribution to Nokia via Gitorious, and specially the clone czech-translation

Howto

First steps

Installing Git under Debian:

# installing Git
aptitude install git-core
 
# Configuring Git
git config --global user.name "Xavier G."
git config --global user.email "xavier@tuxfamily.org"

Getting a working directory:

# read-only access
git clone git://gitorious.org/~xavierg/qt/czech-translation.git
# if you have a write access to the Gitorious repository
git clone git@gitorious.org:~xavierg/qt/czech-translation.git
# Extra configuration, specific to Nokia
cd czech-translation/
git config commit.template .commit-template

If you wish to work in the czech-translation branch (and believe me, you do want to work in the czech-translation branch), do the following:

  1. at first, you have only one branch: git branch will only list the * master branch
  2. however, git branch -a will show every available branch on the remote repositories:
    * master
      remotes/origin/4.5
      remotes/origin/4.6
      remotes/origin/4.6-stable
      remotes/origin/HEAD -> origin/master
      remotes/origin/czech-translation
      remotes/origin/master
      remotes/origin/master-stable
  3. Check out the czech-translation branch: git checkout -b czech-translation remotes/origin/czech-translation :
    Branch czech-translation set up to track remote branch czech-translation from origin.
    Switched to a new branch 'czech-translation'
  4. Check the branch you are now working on: git branch :
    * czech-translation
      master

If by chance you have cloned from the read-only URL (git://gitorious.org/~xavierg/qt/czech-translation.git) while you have a write-access, you can reconfigure your “remote” repository named “origin” by editing the file .git/config, and replacing the line :

url = git://gitorious.org/~xavierg/qt/czech-translation.git

by

url = git@gitorious.org:~xavierg/qt/czech-translation.git

in the [remote “origin”] section.

You can check this by doing: git remote show origin:

* remote origin
  Fetch URL: git@gitorious.org:~xavierg/qt/czech-translation.git
  Push  URL: git@gitorious.org:~xavierg/qt/czech-translation.git
  HEAD branch: master
  Remote branches:
    4.5               tracked
    4.6               tracked
    4.6-stable        tracked
    czech-translation tracked
    master            tracked
    master-stable     tracked
  Local branches configured for 'git pull':
    czech-translation merges with remote czech-translation
    master            merges with remote master
  Local refs configured for 'git push':
    czech-translation pushes to czech-translation (up to date)
    master            pushes to master            (up to date)

Note that the last lines indicate you where git push and git pull commands use to work, depending of the current working branch (the one with a star).

Importing the current translations

Qt Translations

# Get into the working directory
cd czech-translation/
 
# put the holy .ts file somewhere:
cp /home/user/path/to/qt_cs.ts translations/
 
# change to the src directory
cd ../src
 
# update the qt_cs.ts file
lupdate-qt4 -locations relative -no-ui-lines 3rdparty/phonon 3rdparty/webkit activeqt corelib gui multimedia network opengl plugins qt3support script scripttools sql svg xml xmlpatterns -ts ../translations/qt_cs.ts

This last command should output something like:

[01:06:30][xavier]{huxley}~/projets/qt/czech-translation/src $ lupdate-qt4 -locations relative -no-ui-lines 3rdparty/phonon 3rdparty/webkit activeqt corelib gui multimedia network opengl plugins qt3support script scripttools sql svg xml xmlpatterns -ts ../translations/qt_cs.ts
Scanning directory '3rdparty/phonon'...
Scanning directory '3rdparty/webkit'...
Scanning directory 'activeqt'...
Scanning directory 'corelib'...
Scanning directory 'gui'...
Scanning directory 'multimedia'...
Scanning directory 'network'...
Scanning directory 'opengl'...
Scanning directory 'plugins'...
Scanning directory 'qt3support'...
Scanning directory 'script'...
Scanning directory 'scripttools'...
Scanning directory 'sql'...
Scanning directory 'svg'...
Scanning directory 'xml'...
Scanning directory 'xmlpatterns'...
/home/xavier/projets/qt/czech-translation/src/3rdparty/webkit/WebCore/bindings/js/JSDesktopNotificationsCustom.cpp:89: Unbalanced parentheses in C++ code (or abuse of the C++ preprocessor)

Updating '../translations/qt_cs.ts'...

    Found 1825 source text(s) (488 new and 1337 already existing)
    Kept 14 obsolete entries
    Same-text heuristic provided 21 translation(s)

[01:06:38][xavier]{huxley}~/projets/qt/czech-translation/src $
# add our new .ts file for versionning
cd ..
git add translations/qt_cs.ts
 
# adds the cs language to translations/translations.pri if needed
grep -E '^QT_TS.*cs.*$' translations/translations.pri || perl -i -pe 's,^QT_TS(.*)$,QT_TS$1 cs,' translations/translations.pri

Commit our work

# check the modifications in the local repository
git status
git diff --cached translations/translations.pri
 
# commit the modifications in the local repository
git commit
# Change the email address if needed, write a commit message
# now, let's update the remote repository
git push origin czech-translation

This last command should ouput:

Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 12.17 KiB, done.
Total 5 (delta 4), reused 0 (delta 0)
=> Syncing Gitorious... [OK]
To git@gitorious.org:~xavierg/qt/czech-translation.git
   69f00b2..63c2b16  czech-translation -> czech-translation
Print/export