第52回 wordbench 大阪 wordpress...

35
WordPress ののののののののの GlotPress のののののの 2016 の 4 の 16 の の 52 の WordBench のの のののののののののののの のの ののKITANI Kimiya @kimipooh

Upload: kitani-kimiya

Post on 14-Apr-2017

421 views

Category:

Internet


3 download

TRANSCRIPT

Page 1: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

WordPress の新しい翻訳システム「 GlotPress 」を使ってみよう!

2016 年 4 月 16 日 第 52 回 WordBench 大阪

京都大学東南アジア研究所木谷 公哉( KITANI Kimiya )

@kimipooh

Page 2: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

@kimipooh◆ 大学教員(助教 & 情報処理室長)

◆ ヘルプディスク〜サーバー管理〜データベース開発◆ コミュニティとの関わり

◆ WordBench 京都◆ WordBench 大阪

イベントへの関わり WordCamp Kansai 2016 実行委員( 2014 〜) 関西オープンフォーラム 2016 実行委員( 2002 〜)

WordPress と深く関わったきっかけ 2012 年 4 月 5 つの WordPress サイトをオープン 2012 年 6 月 第 5 回 WordBench 京都へ初参加 2012 年 8 月 第 7 回 WordBench 京都で発表

2

Page 3: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

1. GlotPress で翻訳してみよう!

2. 公式プラグインを GlotPress に 移行してみよう!

3

Page 4: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳の方法

テーマ・プラグインフォルダで翻訳

GlotPress (translate.wordpress.org) で翻訳

4

Page 5: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

踏み出してみよう!翻訳の第一歩(ハンズオン)

2015 年 7 月 25 日 WordCamp Kansai 2015

資料: http://www.slideshare.net/kitanikimiya

テーマ・プラグインフォルダで翻訳

5

Page 6: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

GlotPress への対応状況 公式テーマ

2015 年 7 月中旬 過去 2 年間に 1 度でも更 新されたテーマ

https://ja.naoko.cc/2015/08/04/wordpress-directory-theme-online-translation/

公式プラグイン 2015 年 12 月 全プラグイン(要更新)

6

Page 7: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

1. GlotPress で翻訳してみよう!

7

Page 8: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

WordPress.org アカウントを作成 https://ja.forums.wordpress.org/register.php

「WordPress.org 登録」などで検索

8

Page 9: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳したいものを探す1. https://translate.wordpress.org

9

Page 10: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

2. 各プラグインページからアクセス

10

Page 11: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳対応状況の確認1. GlotPress に翻訳場所がない(プラグインの次期アップデート時に自動生成)

2. プラグインが GlotPress に対応していない( readme のみ翻訳可)

翻訳できない

翻訳できるが反映はされない

11

Page 12: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳対応状況の確認

3. プラグインが GlotPress に対応済み!

Stable から翻訳しよう!

翻訳でき、承認されたものは反映される

12

Page 13: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

A Piece of Cake

テーマ を翻訳してみよう!

13

Page 14: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳したい箇所を探す◆ A Piece of Cake の例

翻訳したい箇所の「 Details 」をクリックして翻訳文字を入れます。

14

Page 15: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳する◆ A Piece of Cake の例

15

翻訳できたら、 Suggest ボタンで提案する

Page 16: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳の進め方

◆ 翻訳ガイドライン◆ http://wpdocs.osdn.jp/WordPress_ の翻訳 / 翻

訳ガイドライン ( http://goo.gl/ohr6NP)

◆ 半角英数、記号の前後→半角スペース◆ 訳語の統一

◆ https://translate.wordpress.org/projects/wp/dev/ja/default/glossary

https://ja.wordpress.org/get-involved/translation-first-steps/

16

Page 17: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳したよって気づいてもらう

◆WordSlack へ参加する  http://wpdocs.osdn.jp/WordSlack への参加方法

◆#translate チャンネルで翻訳した旨を通知

GlotPress に対応した公式テーマや公式プラグイン

17

Page 18: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

2. 公式プラグインを GlotPress に  移行してみよう!

18

Page 19: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳対象

readme.txt Stable (最新版) Development (trunk)

プラグイン本体 Stable (最新版) Development (trunk)

https://ja.wordpress.org/plugins/wp-add-mime-types/

https://wordpress.org/plugins/wp-add-mime-types/

19

Page 20: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

GlotPress への移行手順1. 対応コードを入れて、プラグインをアップデート (SVN)2. GlotPress 上で翻訳3. GlotPress での承認権限(翻訳編集者)をもらう4. 翻訳を承認5. 翻訳が反映されたことを確認

翻訳データ: https://i18n.trac.wordpress.org 6. 事前テストする

テスト環境でプラグインから翻訳データを削除して確認 GlotPress 用翻訳フォルダを確認

7. プラグインから翻訳データを削除し、アップデート(SVN)

8. 最終確認20

Page 21: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

1. 対応コードの挿入

プラグインコメント欄に Text Domain を追加

プラグインアップデート

プラグインディレクトリと同名にすること!

21

Page 22: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

対応コードの未挿入 How to Internationalize Your Plugin

https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/

22

Page 23: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

2. GlotPress 上で翻訳

第1部で説明したように翻訳していきます。

Stable と Stable Readme の翻訳を100% へ

23

Page 24: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

3. 承認権限をもらう◆WordSlack へ参加する

  http://wpdocs.osdn.jp/WordSlack への参加方法

◆#translate チャンネルで依頼

24

Page 25: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

4. 翻訳を承認

25

Page 26: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

5. 翻訳データが反映されたか確認

https://i18n.trac.wordpress.org/browser/plugins

https://i18n.trac.wordpress.org/timeline

26

Page 27: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳が反映されるタイミング

UTC 0 時 (日本時間 9 時)〜UTC 6 時 (日本時間 15 時)〜UTC 12 時(日本時間 21 時)〜UTC 18 時(日本時間 3 時)〜

https://i18n.trac.wordpress.org/timeline

タイムラインを眺めていると・・

かな?27

Page 28: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

6. 事前テストする

ダッシュボード > 更新 > 翻訳 > 翻訳の更新

テスト環境で、プラグインから翻訳データを削除する。

GlotPress で翻訳されたデータが反映されるか確認

wp-content ┗ languages   ┣ plugins     ┣ wp-add-mime-types-ja.mo     ┗ wp-add-mime-types-ja.po   ┗ themes

28

Page 29: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

7. プラグインから翻訳データを削除

プラグインをアップデート (SVN)

29

Page 30: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

8. 最終確認

ダッシュボード > 更新 > 翻訳 > 翻訳の更新

ダッシュボード > プラグインのアップデート

公式プラグインの説明

反映されていることを確認https://ja.wordpress.org/plugins/wp-add-mime-types/ https://wordpress.org/plugins/wp-add-mime-types/

30

Page 31: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

付録

翻訳したデータをテスト環境で確認しよう!

テスト環境構築は割愛31

Page 32: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳データをダウンロードする

日本語なら「テキストドメイン -ja.mo 」と名前変更します。

Stable (latest release) の翻訳データ( MO ファイル)をダウンロード

wp-plugins-wp-add-mime-types-stable-ja.mo wp-add-mime-types-ja.mo32

Page 33: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

テキストドメインの見つけ方

◆ テーマ( functions.php )◆ load_theme_textdomain( ‘ テキストドメイン’ );◆ load_theme_textdomain( ‘ テキストドメイン ',

get_template_directory() . '/languages' );

◆ プラグイン(フォルダと同名 .php ) ◆ load_plugin_textdomain (‘ テキストドメイン’ );◆ load_plugin_textdomain (‘ テキストドメイン’ , false,

dirname( plugin_basename( __FILE__ ) ) . '/languages/');

33

Page 34: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳ファイルを設置する(テーマ)

◆ GlotPress 対応(固定)wp-content ┗ languages    ┗ themes      ┗ テキストドメイン -ja.po

◆ テーマ内wp-content ┗ themes   ┗ テーマフォルダ      ┗ languages         ┗ テキストドメイン -ja.po

34

Page 35: 第52回 WordBench 大阪   WordPress の新しい翻訳システム「GlotPress」を使ってみよう!

翻訳ファイルを設置する(プラグイン)

◆ GlotPress 対応(固定)wp-content ┗ languages    ┗ themes      ┗ テキストドメイン -ja.po

◆ プラグイン内wp-content ┗ plugins   ┗ プラグインフォルダ      ┗ languages         ┗ テキストドメイン -ja.po

35