====== Překlad Qt do češtiny ====== ===== Příběh ===== Pavel přeložil řetězce knihoven Qt, aniž by to věděl. Nyní jsme poslali tento příspěvek Nokii pomocí [[http://qt.gitorious.org/|Gitorious]], a zvláště klon [[http://qt.gitorious.org/~xavierg/czech-translation|czech-translation]] ===== Užitečné odkazy ===== * 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 ===== Jak na to ===== ==== První kroky ==== Instalace systému Git pod Debianem: # Instalace Gitu aptitude install git-core # Nastavení Gitu git config --global user.name "Xavier G." git config --global user.email "xavier@tuxfamily.org" Vytvoření pracovního adresáře: # Přístup pouze pro čtení git clone git://gitorious.org/~xavierg/qt/czech-translation.git # Pokud máte přístup do skladiště Gitorious s právy pro zápis git clone git@gitorious.org:~xavierg/qt/czech-translation.git # Nastavení navíc, určité pro Nokii cd czech-translation/ git config commit.template .commit-template Pokud si přejete pracovat ve větvi czech-translation (a věřte mi, vy nechcete pracovat ve větvi czech-translation), udělejte následující: - nejprve, máte jen jednu větev: ''git branch'' uvede pouze větev ''* master'' - avšak, ''git branch -a'' ukáže každou dostupnou větev ve vzdálených skladištích: * 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 - Vyzkoušejte si (check out) větev czech-translation: ''git checkout -b czech-translation remotes/origin/czech-translation'' : Větev czech-translation nastavit na sledování vzdálené větve czech-translation ze zdroje. Switched to a new branch 'czech-translation' - Ověřte větev, na níž nyní pracujete: ''git branch'' : * czech-translation master Pokud jste náhodou klonovali z adresy pouze pro čtení (URL) (''%%git://gitorious.org/~xavierg/qt/czech-translation.git%%''), když máte právo pro zápis, můžete znovu nastavit své vzdálené ("remote") skladiště nazvané "origin" upravením souboru ''.git/config'', a nahrazením řádku: url = git://gitorious.org/~xavierg/qt/czech-translation.git tímto url = git@gitorious.org:~xavierg/qt/czech-translation.git v oddíle ''[remote "origin"]''. Můžete to prověřit provedením: ''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) Všimněte si, že poslední řádky vám naznačují, kde pracují příkazy ''git push'' a ''git pull'', v závislosti na současné pracovní větvi (to je ta s hvězdičkou). ==== Zavedení nynějších překladů ==== === Překlady Qt === # přejít do pracovního adresáře cd czech-translation/ # položit kamkoli čistý soubor .ts: cp /home/user/path/to/qt_cs.ts translations/ # změnit adresář na src cd ../src # zaktualizovat soubor qt_cs.ts 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 Tento poslední příkaz by měl vést k výstupu podobnému tomuto: [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 $ # přidat náš nový soubor .ts pro verzování cd .. git add translations/qt_cs.ts # přidá český jazyk (cs) do translations/translations.pri, je-li to potřeba grep -E '^QT_TS.*cs.*$' translations/translations.pri || perl -i -pe 's,^QT_TS(.*)$,QT_TS$1 cs,' translations/translations.pri ==== Odeslání naší práce ==== # prověřit změny v našem místním skladišti git status git diff --cached translations/translations.pri # odeslat změny do místního skladiště git commit # změnit adresu elektronické pošty, je-li potřeba, napsat zprávu o odeslání # nyní pojďme obnovit vzdálené skladiště git push origin czech-translation Tento poslední příkaz by měl vést k tomuto výstupu: 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