$ show postgres-cn/pgdoc-cn
This repository is the Chinese translation of the PostgreSQL documentation, maintained by the PostgreSQL China User Group. It contains translated SGML and XML files for PostgreSQL versions 15 through 18, along with vendored DocBook DSSSL stylesheets (v1.79) and DTDs for rendering. The translation uses a custom marker system (`pgdoc-cn_start`/`pgdoc-cn_end`) with checksums to track original English content and translation state. A set of Python scripts (in `tools/`) post-processes the output, adding navigation bars, edit links, and generating mapping files. The project is actively maintained, but the toolchain is legacy (DocBook DSSSL from 2003, Python 3.4 references) and the duplicated version directories create maintenance overhead. This is not a standalone application or data pipeline; it is a documentation localization project with build tooling. Hybrid nature: primarily translation content, secondarily documentation processing scripts.
The LLM identified 2 files worth highlighting for reuse:
A Python script that inserts a navigation bar with version links and a GitHub edit link into generated HTML documentation files. It reads a mapping file (html2sgml_map.py output), adds a top navigation div, an edit link, and a Chinese-language back-to-top link. The script is self-contained, uses argparse for parameters, and could be adapted for any project that needs to inject navigation into statically generated HTML, not just PostgreSQL documentation.
An XSLT stylesheet that overrides default DocBook XSL parameters to speed up processing. It hardcodes `l10n.gentext.language='zh_cn'` to skip locale detection, sets `generate.meta=0` for caching compatibility, and disables `make.valid.html`. This is a small but effective optimization pattern for any DocBook XSLT pipeline, especially when only one language is used, reducing transformation time by eliminating repeated locale lookups.