···11+---
22+title: Translating psycopg3 documentation
33+date: 2025-01-06
44+tags:
55+- psycopg3
66+- translation
77+toc: true
88+---
99+1010+> This post was actually written on March 25, 2023, but completely forgot to publish. During that period, I wrote [Takahē articles](post/2024-03-13-takahe-gihyo-article) and translated psycopg3 documentation into Japanese at the same time.
1111+1212+I continue [translating psycopg3 into Japanese](https://psycopg3-ja.translation.shuuji3.xyz/) one by one. It's fun to learn unknown PostgreSQL features and how psycopg3 is handling connections and queries under the hood for database libraries in Python!
1313+1414+<!--more-->
1515+1616+## ReStructuredText syntax
1717+1818+By translating documentation written in ReStructuredText syntax, I become much familiar with this syntax and finally come to get confident with them. Surely I read in a lot of various Python documentations and translated huge amount of Django translation text on Transifex. But somehow I couldn't fully understand a few syntaxes.
1919+2020+That lack of confidence has almost disappeared and I can see the power and flexibility of this syntax now.
2121+2222+## Contributing to `sphinx-socialgraph`
2323+2424+I noticed that psycopg documentation doesn't have any OpenGraph Protocol meta data in `<head />`. And after a quick search, I found `sphinx-socialgraph` just for this addition.
2525+2626+Unfortunately, its generated card image only support default embedded Roboto Flex font file at that time, so any CJK language characters cannot be rendered other than many Tofu ⬜⬜⬜ !
2727+2828+There was an existing issue too: [Bundled Roboto font does not support Japanese (social images) · Issue #108 · wpilibsuite/sphinxext-opengraph](https://github.com/wpilibsuite/sphinxext-opengraph/issues/108)
2929+3030+As the issue explains, the card image is rendered with `matplotlib` but its custom font loading feature was still "TODO" state. As I had some experience with `matplotlib` for a while ago, I somehow could solve the problem to allow the library to load any detectable font file from `matplotlib`.
3131+3232+[The PR is waiting for the review](https://github.com/wpilibsuite/sphinxext-opengraph/pull/110) and hopefully to be merged soon. (later merged on Oct 28, 2023 🎉)
3333+3434+**Before**
3535+3636+
3737+3838+**After**
3939+4040+
4141+4242+## Translation rules
4343+4444+While translating docs, I built up the following rules to be consistent:
4545+4646+- place spaces between Japanese and ASCII characters.
4747+- put a space in between multiple Katakana words
4848+ - But "server-side" and "client-side" are concatenated with "-" and they should be treated as one word, so they are translated to "サーバーサイド" and "クライアントサイド" accordingly (not "サーバー サイド")
4949+- behave = 動作する (not 振る舞う)
5050+ - I felt this may help map one word and concept in mind more connected due to the higher density of Kanji characters.
5151+- advanced = 発展的な
5252+- open/close = オープン/クローズ (I though 開く/閉じる is acceptable but オープン is more natural like in the verb "オープンする"
5353+- connection = コネクション、コネクションする (not 接続 or 接続する)
5454+ - both are understandable but the conversion cost of 接続 -> コネクション in brain has a bit more resistance.
5555+- statement = ステートメント, not 文
5656+ - similarly, ステートメント can be mapped to statement more directly, and one might question like "Which 文 means here?"
5757+- use = 使用 (not 利用)
···33date: 2024-03-13T13:37:36Z
44tags: ["media", "activitypub", "fediverse", "takahe", "elk", "writing"]
55toc: true
66+aliases: 2024-03-13-2024-03-13-takahe-gihyo-article # typo
67---
7889It was already a half year ago, but I had an opportunity to write two long articles about Takahē in Japanese on the website gihyo.jp, managed by Gijutsu-Hyoron Co., Ltd. (技術評論社), one of the famous technical book publishers in Japan:
···18191920But it was a wonderful experience as I was able to introduce little-known Takahē and its interesting architecture at that time to the Japanese
2021tech community and learn/explore more about ActivityPub/Fediverse, Django, and many other communities in depth at the same time.
2121-