Sphinx 1.1  の  i18n  機能紹介
お前、誰よ <ul><li>イアンというのよ
BeProud  に働いているのよ
Google Appengine API  公式エキスパート
Python/Django  好き、 仕事で  Python  使っているぜ
RedBull 飲んでいるよ
feiz-- </li></ul>
Bucho  好き!
Sphinx  ってなによ!
渋川先生に聞きましょう
しらないの?
あららー
あらららららー
あらららららららららー
あらららららららららららららー
せっかく  sphinx-users.jp  運用しているのに!
http://sphinx-users.jp
Sphinx  はなによ <ul><li>http://sphinx.pocoo.org/
Python で作られたドキュメント生成ツール
ReStructuredText  を使う
ファイル中間参照
Autodoc  ソースから作られたドキュメント
HTML, PDF, LaTeX  出力
最新の Python  公式ドキュメント </li></ul>
ReST/Sphinx  での翻訳
Sphinx  ドキュメントって どうやって国際化するの?
盗品です。  http://www.flickr.com/photos/shibukawa/4067856691/
盗品です。  http://www.flickr.com/photos/shibukawa/4067856691/
ってことは 完全に別ドキュメントとして管理 ?
だよねぇ  (´ ・ ω ・ `)
<ul>元ドキュメントが変更された 場合、翻訳物をどう更新したら いいかわからない </ul>メンテが大変
じゃ、どうするか
盗品です。 http://sphinx.pocoo.org/latest/intl.html Sphinx 1.1 ( 未リリース )
やっぱり  gettext  だねぇ (´ ・ ω ・ `)
それでいいのか?
盗品です。  http://sphinx.pocoo.org/latest/intl.html Sphinx 1.1
sphinx-build gettext <ul><li>index.rst
other.rst
directory/ </li><ul><li>subfile.rst </li></ul></ul><ul><li>index.pot
other.pot
directory/ </li><ul><li>subfile.pot </li></ul></ul>
sphinx-build gettext bpssl Documentation ==================== What is bpssl? ----------------------------------- bpssl is ...
sphinx-build gettext bpssl Documentation ==================== What is bpssl? ----------------------------------- bpssl is ...
Upcoming SlideShare
Loading in …5
×

Sphinx 1.1 i18n 機能紹介

5,830 views

Published on

Sphinx 1.1 のi18n 新機能

PyCon Mini 2011/01/29 に発表

Published in: Technology

Sphinx 1.1 i18n 機能紹介

  1. 1. Sphinx 1.1 の i18n 機能紹介
  2. 2. お前、誰よ <ul><li>イアンというのよ
  3. 3. BeProud に働いているのよ
  4. 4. Google Appengine API 公式エキスパート
  5. 5. Python/Django 好き、 仕事で Python 使っているぜ
  6. 6. RedBull 飲んでいるよ
  7. 7. feiz-- </li></ul>
  8. 8. Bucho 好き!
  9. 9. Sphinx ってなによ!
  10. 10. 渋川先生に聞きましょう
  11. 11. しらないの?
  12. 12. あららー
  13. 13. あらららららー
  14. 14. あらららららららららー
  15. 15. あらららららららららららららー
  16. 16. せっかく sphinx-users.jp 運用しているのに!
  17. 17. http://sphinx-users.jp
  18. 18. Sphinx はなによ <ul><li>http://sphinx.pocoo.org/
  19. 19. Python で作られたドキュメント生成ツール
  20. 20. ReStructuredText を使う
  21. 21. ファイル中間参照
  22. 22. Autodoc ソースから作られたドキュメント
  23. 23. HTML, PDF, LaTeX 出力
  24. 24. 最新の Python 公式ドキュメント </li></ul>
  25. 25. ReST/Sphinx での翻訳
  26. 26. Sphinx ドキュメントって どうやって国際化するの?
  27. 27. 盗品です。 http://www.flickr.com/photos/shibukawa/4067856691/
  28. 28. 盗品です。 http://www.flickr.com/photos/shibukawa/4067856691/
  29. 29. ってことは 完全に別ドキュメントとして管理 ?
  30. 30. だよねぇ (´ ・ ω ・ `)
  31. 31. <ul>元ドキュメントが変更された 場合、翻訳物をどう更新したら いいかわからない </ul>メンテが大変
  32. 32. じゃ、どうするか
  33. 33. 盗品です。 http://sphinx.pocoo.org/latest/intl.html Sphinx 1.1 ( 未リリース )
  34. 34. やっぱり gettext だねぇ (´ ・ ω ・ `)
  35. 35. それでいいのか?
  36. 36. 盗品です。 http://sphinx.pocoo.org/latest/intl.html Sphinx 1.1
  37. 37. sphinx-build gettext <ul><li>index.rst
  38. 38. other.rst
  39. 39. directory/ </li><ul><li>subfile.rst </li></ul></ul><ul><li>index.pot
  40. 40. other.pot
  41. 41. directory/ </li><ul><li>subfile.pot </li></ul></ul>
  42. 42. sphinx-build gettext bpssl Documentation ==================== What is bpssl? ----------------------------------- bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page. Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at: #b6395b85f34144a1a91a23a1bce5aa37 msgid &quot;What is bpssl?&quot; msgstr &quot;&quot; #2a85f8ce621c4e88897b51f59d868a55 msgid &quot;Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at:&quot; msgstr &quot;&quot; #3ec7b8f0c3e0425baac65f2a0f97394c msgid &quot;bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page.&quot; msgstr &quot;&quot; #46cbf44fbb2040d983af60128148537d msgid &quot;bpssl Documentation&quot; msgstr &quot;&quot;
  43. 43. sphinx-build gettext bpssl Documentation ==================== What is bpssl? ----------------------------------- bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page. Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at: #b6395b85f34144a1a91a23a1bce5aa37 msgid &quot;What is bpssl?&quot; msgstr &quot;bpssl とは? &quot; #2a85f8ce621c4e88897b51f59d868a55 msgid &quot;Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at:&quot; msgstr &quot;&quot; #3ec7b8f0c3e0425baac65f2a0f97394c msgid &quot;bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page.&quot; msgstr &quot;&quot; #46cbf44fbb2040d983af60128148537d msgid &quot;bpssl Documentation&quot; msgstr &quot;&quot;
  44. 44. sphinx-build gettext bpssl Documentation ==================== What is bpssl? ----------------------------------- bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page. Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at: #b6395b85f34144a1a91a23a1bce5aa37 msgid &quot;What is bpssl?&quot; msgstr &quot;&quot; #2a85f8ce621c4e88897b51f59d868a55 msgid &quot;Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at:&quot; msgstr &quot;&quot; #3ec7b8f0c3e0425baac65f2a0f97394c msgid &quot;bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page.&quot; msgstr &quot;&quot; #46cbf44fbb2040d983af60128148537d msgid &quot;bpssl Documentation&quot; msgstr &quot;&quot;
  45. 45. sphinx-build gettext bpssl Documentation ==================== What is bpssl? ----------------------------------- bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page. Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at: #b6395b85f34144a1a91a23a1bce5aa37 msgid &quot;What is bpssl?&quot; msgstr &quot;&quot; #2a85f8ce621c4e88897b51f59d868a55 msgid &quot;Specifying views and urls as secure is supported as are `flatpages`_. `Fastcgi`_ and HTTP proxy setups are also well supported. See the sourcecode/homepage at:&quot; msgstr &quot;&quot; #3ec7b8f0c3e0425baac65f2a0f97394c msgid &quot;bpssl is a Django application that helps you support HTTPS on your website. The main functionality is performing redirection for HTTPS only URLs and views. For instance, if a request for your login view '/login' is recieved over HTTP, the provided middleware can redirect the user to the equivalent HTTPS page.&quot; msgstr &quot;&quot; #46cbf44fbb2040d983af60128148537d msgid &quot;bpssl Documentation&quot; msgstr &quot;&quot; 残念!
  46. 46. 盗品です。 http://sphinx.pocoo.org/latest/intl.html Sphinx 1.1 ( 未リリース )
  47. 47. 盗品です。 http://sphinx.pocoo.org/latest/intl.html ? Sphinx 1.1 ( 未リリース )
  48. 48. 結局、自分でやらないといけねぇかよ (´ ・ ω ・ `)
  49. 49. INDIR = $1 OUTDIR = $2 LOCALES = `cd $OUTDIR && ls -d */ | sed 's//$//'` for LOCALE in $LOCALES ; do echo &quot;Updating locale $LOCALE...&quot; for FILE in `cd $INDIR && find . -name &quot;*.pot&quot;` ; do OUTFILE = `echo &quot; $FILE &quot; | sed 's/.pot$/.po/'` OUTFILE = `echo &quot; $OUTFILE &quot; | cut -b 1-2 --complement` INFILE = `echo &quot; $FILE &quot; | cut -b 1-2 --complement` pybabel update -l $LOCALE -i $INDIR / $INFILE -o $OUTDIR $LOCALE /LC_MESSAGES/ $OUTFILE done done
  50. 50. init_trans.sh / update_trans.sh <ul><li>index.pot
  51. 51. other.pot
  52. 52. directory/ </li><ul><li>subfile.pot </li></ul></ul><ul><li>en/ </li><ul><li>LC_MESSAGES/ </li><ul><li>index.po
  53. 53. other.po
  54. 54. directory/ </li><ul><li>subfile.po </li></ul></ul></ul><li>ja/ </li><ul><li>... </li></ul><li>de/ </li><ul><li>... </li></ul></ul>
  55. 55. 盗品です。 http://sphinx.pocoo.org/latest/intl.html ? Sphinx 1.1 ( 未リリース )
  56. 56. 盗品です。 http://sphinx.pocoo.org/latest/intl.html ? ? Sphinx 1.1 ( 未リリース )
  57. 57. compile_trans.sh <ul><li>index.po
  58. 58. other.po
  59. 59. directory/ </li><ul><li>subfile.po </li></ul></ul><ul><li>index.mo
  60. 60. other.mo
  61. 61. directory/ </li><ul><li>subfile.mo </li></ul></ul>
  62. 62. 盗品です。 http://sphinx.pocoo.org/latest/intl.html Sphinx 1.1 ( 未リリース )
  63. 63. sphinx-build -Dlanguage=ja <ul><li>index.mo
  64. 64. other.mo
  65. 65. directory/ </li><ul><li>subfile.mo </li></ul><li>index.rst
  66. 66. other.rst
  67. 67. directory/ </li><ul><li>subfile.rst </li></ul></ul>+
  68. 68. まとめ <ul><li>新しい機能なので、ま、ま。。。。
  69. 69. 小さいプロジェクトにはまだ面倒かな
  70. 70. gettext は便利なのか、不便なのか </li></ul>
  71. 71. まとめ <ul><li>大きいプロジェクトにはいいかも </li><ul><li>翻訳ファイルの管理ツール
  72. 72. 更新が多い </li></ul><li>ドキュメント更新された時、翻訳のどこを更新すればいいか、 gettext が 働いてくれるのがうれしい </li></ul>
  73. 73. 皆さん、どんどんPythonドキュメント 翻訳しよう!! ご清聴ありがとうございました! 質問!! [email_address] @IanMLewis

×