Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:doc:qt_translation_cs [24/10/2009 01:33] xavieren:doc:qt_translation_cs [20/11/2014 14:01] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== 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 [[http://qt.gitorious.org/|Gitorious]], and specially the clone [[http://qt.gitorious.org/~xavierg/czech-translation|czech-translation]]
 +===== Useful links =====
 +
 +  * http://qt.nokia.com/developer/the-qt-contribution-model
 +  * http://qt.gitorious.org/qt/pages/QtContributionGuidelines
 +  * http://qt.gitorious.org/qt/pages/QtLocalization
 +  * http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
 +
 +===== Howto =====
 +==== First steps ====
 +Installing Git under Debian: <code bash>
 +# installing Git
 +aptitude install git-core
 +
 +# Configuring Git
 +git config --global user.name "Xavier G."
 +git config --global user.email "xavier@tuxfamily.org"
 +</code>
 +
 +Getting a working directory:
 +<code bash>
 +# 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
 +</code>
 +
 +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:
 +  - at first, you have only one branch: ''git branch'' will only list the ''* master'' branch
 +  - however, ''git branch -a'' will show every available branch on the remote repositories: <file>
 +* 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
 +</file>
 +  - Check out the czech-translation branch: ''git checkout -b czech-translation remotes/origin/czech-translation'' : <file>
 +Branch czech-translation set up to track remote branch czech-translation from origin.
 +Switched to a new branch 'czech-translation'
 +</file>
 +  - Check the branch you are now working on: ''git branch'' : <file>
 +* czech-translation
 +  master
 +</file>
 +
 +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 :
 +<file>url = git://gitorious.org/~xavierg/qt/czech-translation.git</file>
 +by
 +<file>url = git@gitorious.org:~xavierg/qt/czech-translation.git</file>
 +in the ''[remote "origin"]'' section.
 +
 +You can check this by doing: ''git remote show origin'':
 +<file>
 +* 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)
 +</file>
 +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 ===
 +<code bash>
 +# 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
 +</code>
 +
 +This last command should output something like:
 +<file>
 +[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 $
 +
 +</file>
 +
 +<code bash>
 +# 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
 +</code>
 +
 +==== Commit our work ====
 +<code bash>
 +# 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
 +</code>
 +
 +<code bash>
 +# now, let's update the remote repository
 +git push origin czech-translation
 +</code>
 +
 +This last command should ouput:
 +<file>
 +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
 +</file>
Print/export