R.A. Epigonos et al.

[gettext] ディレクトリ、ファイル、空ディレクトリの一括削除

Claudio Filho さんの作っている debian のインフォグラフィックが github で公開されている。github でリポジトリをクローンして、pot が提供されているので、適当に翻訳するまでの作業記録。

大本リポジトリのクローンを作成

Claudio Filho さんの大本リポジトリのクローンを作成して、git ルートディレクトリに移動。名前とメールアドレスの登録。

$ git clone https://github.com/filhocf/infographics.git
Cloning into 'infographics'...
remote: Counting objects: 120, done.
remote: Total 120 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (120/120), 42.27 MiB | 2.25 MiB/s, done.
Resolving deltas: 100% (49/49), done.
$ cd infographics/
$ git config user.name "AYANOKOUZI, Ryuunosuke" && git config user.email "i38w7i3@yahoo.co.jp"

github で fork して URL を追加

github のインターフェイスでClaudio Filho さんのリポジトリを fork しておく。ここで作られた編集権限のあるリポジトリを github という登録名で add する。

$ git remote add github git@github.com:l/infographics.git

push 用と作業用ブランチの作成

新規に push 用ブランチ translation_ja を作成。pull 元を忘れないように translation_ja の上流を origin/master に指定。pull テスト。push テストの際には push 先を指定して行う。

$ git checkout -b translation_ja
Switched to a new branch 'translation_ja'
$ git branch --set-upstream translation_ja origin/master
Branch translation_ja set up to track remote branch master from origin.
$ git pull
Already up-to-date.
$ git push github translation_ja
Enter passphrase for key '*************************':
Total 0 (delta 0), reused 0 (delta 0)
To git@github.com:l/infographics.git
 * [new branch]      translation_ja -> translation_ja

同様に作業用ブランチ translation_ja_work を作成 (push 用と作業用に分ける理由は、私の場合 commit 粒度がとても細かいので、翻訳ログで本家の commit ログを無駄に埋めることを防ぐため。適当な分量の作業後に squash で作業用からpush 用ブランチに変更を取り込む)。pull 元を忘れないように translation_ja_wok の上流を origin/master に指定。pull テスト。作業用であり公開を目的としていないので、push テストは行わない。

$ git checkout -b translation_ja_work
Switched to a new branch 'translation_ja_work'
$ git branch --set-upstream translation_ja_work origin/master
Branch translation_ja_work set up to track remote branch master from origin.
$ git pull
Already up-to-date.

最後にこの時点での branch リストを確認。

$ git branch -a -vv
  master                        64e44fc [origin/master] Delete qr_ptbr.svg
  translation_ja                64e44fc [origin/master] Delete qr_ptbr.svg
* translation_ja_work           64e44fc [origin/master] Delete qr_ptbr.svg
  remotes/github/translation_ja 64e44fc Delete qr_ptbr.svg
  remotes/origin/HEAD           -> origin/master
  remotes/origin/master         64e44fc Delete qr_ptbr.svg

作業用ブランチをチェックアウト。インフォグラフィックスの含まれるディレクトリに移動。

$ git checkout translation_ja_work
$ cd debian

所詮 svg は xml なので po4a で翻訳元の svg ファイルから pot ファイルを生成。git に管理対象ファイルに追加。コミット。コミット内容の確認。

$ po4a-gettextize -f xml -m infographic_debian.svg -p infographic_debian.pot\
 --msgid-bugs-address='filhocf@gmail.com'\
 --copyright-holder='Claudio Ferreira Filho <filhocf@gmail.com>'\
 --package-name='Understanding Debian'\
 --package-version='2.1'
$ git add infographic_debian.pot
$ git commit -a -vv -m 'first commit of PO template' -m "$ !-2"
[translation_ja_work aed9366] first commit of PO template
 1 file changed, 1759 insertions(+)
 create mode 100644 debian/infographic_debian.pot
$ git --no-pager log --color --stat --pretty=fuller -1
commit aed93668b04e39225a597a469c574fc1441b407a
Author:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
AuthorDate: Tue Oct 28 04:22:44 2014 +0900
Commit:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
CommitDate: Tue Oct 28 04:22:44 2014 +0900

    first commit of PO template

    $ po4a-gettextize -f xml -m infographic_debian.svg -p infographic_debian.pot --msgid-bugs-address='filhocf@gmail.com' --copyright-holder='Claudio Ferreira Filho <filhocf@gmail.com>' --package-name='Understanding Debian' --package-version='2.1'

 debian/infographic_debian.pot | 1759 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 1759 insertions(+)

pot ファイルから po ファイルを生成。ヘッダ部分だけ少し書き換え。po のエラーチェック。git に管理対象ファイルに追加。コミット。コミットログの確認。

$ msginit --no-translator -i infographic_debian.pot -l ja_JP -o ja_JP.po
Created ja_JP.po.
$ sed -i\
 -e 's/# Automatically generated,/# Ryuunosuke Ayanokouzi <i38w7i3@yahoo.co.jp>,/'\
 -e 's/\(Last-Translator:\) Automatically generated/\1 AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>/'\
 ja_JP.po
$ msgfmt --statistics -c -v -o /dev/null ja_JP.po
ja_JP.po: 0 translated messages, 280 untranslated messages.
$ git add ja_JP.po
$ git commit -a -vv -m 'first commit of Japanese translations' -m "$ !-4"$'\n'"$ !-3"
[translation_ja_work 2aab151] first commit of Japanese translations
 1 file changed, 1732 insertions(+)
 create mode 100644 debian/ja_JP.po
$ git --no-pager log --color --stat --pretty=fuller -1
commit 2aab151a2b35288d08382c9dc7d1acad9753f7de
Author:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
AuthorDate: Tue Oct 28 04:31:23 2014 +0900
Commit:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
CommitDate: Tue Oct 28 04:31:23 2014 +0900

    first commit of Japanese translations

    $ msginit --no-translator -i infographic_debian.pot -l ja_JP -o ja_JP.po
    $ sed -i -e 's/# Automatically generated,/# Ryuunosuke Ayanokouzi <i38w7i3@yahoo.co.jp>,/' -e 's/\(Last-Translator:\) Automatically generated/\1 AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>/' ja_JP.po

 debian/ja_JP.po | 1732 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 1732 insertions(+)

翻訳作業を行ったら commit 前に msgfmt でチェック。コミット。ログを確認。

$ msgfmt --statistics -c -v -o /dev/null ja_JP.po
$ git commit -a -vv -m 'Update Japanese translations'
[translation_ja_work c70c537] Update Japanese translations
 1 file changed, 94 insertions(+), 84 deletions(-)
$ git --no-pager log --color --stat --pretty=fuller -1
commit c70c5377a2ca426c44f8806ed62e25dba6b1ad05
Author:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
AuthorDate: Tue Oct 28 05:09:58 2014 +0900
Commit:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
CommitDate: Tue Oct 28 05:09:58 2014 +0900

    Update Japanese translations

 debian/ja_JP.po |  178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------
 1 file changed, 94 insertions(+), 84 deletions(-)

とりあえずはこのサイクルの繰り返し。

最後に翻訳済み文書を作成する。

$ po4a-translate -f xml -m infographic_debian.svg -p ja_JP.po -l infographic_debian.ja_JP.svg
$ git add infographic_debian.ja_JP.svg
$ git commit -a -vv -m 'generate Japanese-translated document file' -m "$ !-2"
[translation_ja_work 4e36465] follow Japanese translations update
 1 file changed, 85827 insertions(+)
 create mode 100644 debian/infographic_debian.ja_JP.svg
$ git --no-pager log --color --stat --pretty=fuller -1
commit 4e364659784d1c3980ec1556b4304d2d9940d69d
Author:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
AuthorDate: Tue Oct 28 07:13:24 2014 +0900
Commit:     AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>
CommitDate: Tue Oct 28 07:13:24 2014 +0900

    follow Japanese translations update

    $ po4a-translate -f xml -m infographic_debian.svg -p ja_JP.po -l infographic_debian.ja_JP.svg

 debian/infographic_debian.ja_JP.svg |85827 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85827 insertions(+)

ここまででとりあえず作業用ブランチでの作業は終わり、push 用ブランチをcheckoutする。本家側の更新を取り込む。

$ git checkout translation_ja
Switched to branch 'translation_ja'
$ git pull
Already up-to-date.

まずは PO template のコミットに対応するものを translation_ja ブランチにマージ。

$ git diff --name-only aed93668b04e39225a597a469c574fc1441b407a
$ git checkout aed93668b04e39225a597a469c574fc1441b407a infographic_debian.pot
$ git commit -a -vv -C aed93668b04e39225a597a469c574fc1441b407a
$ git --no-pager log --color --stat --pretty=fuller -1
$ git diff --name-only 17354b2428fb3db5aaffbaecd162a5adcf952ad1
debian/ja_JP.po
$ git checkout 17354b2428fb3db5aaffbaecd162a5adcf952ad1 ja_JP.po
$ git commit -a -vv -C 17354b2428fb3db5aaffbaecd162a5adcf952ad1
$ git --no-pager log --color --stat --pretty=fuller -1
$ git diff --name-only 53b9468bae2c0eacac21b45d20aa3eceea0cb91c
debian/ja_JP.po
$ git checkout 53b9468bae2c0eacac21b45d20aa3eceea0cb91c ja_JP.po
$ git commit -a -vv -C 53b9468bae2c0eacac21b45d20aa3eceea0cb91c
$ git --no-pager log --color --stat --pretty=fuller -1
$ git diff --name-only e00fa6cf8a56ad55f18193dee3356f5b662aa864
debian/infographic_debian.ja_JP.svg
$ git checkout e00fa6cf8a56ad55f18193dee3356f5b662aa864 infographic_debian.ja_JP.svg
$ git commit -a -vv -C e00fa6cf8a56ad55f18193dee3356f5b662aa864
$ git --no-pager log --color --stat --pretty=fuller -1

リファレンス

  1. GitHub - filhocf/infographics: Repository of my infographics
  2. CF na Rede | Onde o conhecimento é desenhado e compartilhado
  3. Infographic of Debian | CF na Rede
  4. ClaudioComputing | O código aberto ao alcance de todos.
  5. Infographic of Debian | ClaudioComputing
  6. Internet Archive Wayback Machine
  7. Diagrams - Debian Wiki
  8. ClaudioFilho - Debian Wiki

ソーシャルブックマーク

  1. はてなブックマーク
  2. Google Bookmarks
  3. del.icio.us

ChangeLog

  1. Posted: 2008-10-01T22:03:49+09:00
  2. Modified: 2008-10-01T22:03:49+09:00
  3. Generated: 2023-08-27T23:09:12+09:00