Translating psycopg3 documentation
This post was actually written on March 25, 2023, but completely forgot to publish. During that period, I wrote TakahΔ articles and translated psycopg3 documentation into Japanese at the same time.
I continue translating psycopg3 into Japanese 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!
ReStructuredText syntax
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.
That lack of confidence has almost disappeared and I can see the power and flexibility of this syntax now.
Contributing to sphinx-socialgraph
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.
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 β¬β¬β¬ !
There was an existing issue too: Bundled Roboto font does not support Japanese (social images) Β· Issue #108 Β· wpilibsuite/sphinxext-opengraph
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
.
The PR is waiting for the review and hopefully to be merged soon. (later merged on Oct 28, 2023 π)
Before
After
Translation rules
While translating docs, I built up the following rules to be consistent:
- place spaces between Japanese and ASCII characters.
- put a space in between multiple Katakana words
- 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 “γ΅γΌγγΌ γ΅γ€γ”)
- behave = εδ½γγ (not ζ―γθγ)
- I felt this may help map one word and concept in mind more connected due to the higher density of Kanji characters.
- advanced = ηΊε±ηγͺ
- open/close = γͺγΌγγ³/γ―γγΌγΊ (I though ιγ/ιγγ is acceptable but γͺγΌγγ³ is more natural like in the verb “γͺγΌγγ³γγ”
- connection = γ³γγ―γ·γ§γ³γγ³γγ―γ·γ§γ³γγ (not ζ₯ηΆ or ζ₯ηΆγγ)
- both are understandable but the conversion cost of ζ₯ηΆ -> γ³γγ―γ·γ§γ³ in brain has a bit more resistance.
- statement = γΉγγΌγγ‘γ³γ, not ζ
- similarly, γΉγγΌγγ‘γ³γ can be mapped to statement more directly, and one might question like “Which ζ means here?”
- use = δ½Ώη¨ (not ε©η¨)