Skip to content

QuickBook Parse/Serialize Helpers (utils/quickbook.py) #6

@whisper67265

Description

@whisper67265

Problem

There is no standard po4a-style external converter for QuickBook. To support translation in Weblate, the project needs an in-process parser that extracts translatable segments into a translate-toolkit store, plus reconstruction that applies translations while preserving non-translatable markup and layout.

Acceptance Criteria

  • Parser extracts agreed translatable constructs (paragraphs, lists, headings, sections, admonitions, block quotes, selected table content, variable lists, etc.) and skips or copies verbatim the documented non-translatable constructs (code blocks, includes, templates, comments, etc.).
  • Inline QuickBook markup inside translatable text remains in the unit source so translators can preserve it.
  • Nested sections are handled with a sane recursion strategy (including a depth limit) so nested translatable blocks are not dropped.
  • QuickBookTranslator (or equivalent) can rebuild .qbk from template bytes + PO/store lookup, analogous in spirit to translate.convert.po2asciidoc.AsciiDocTranslator.

Implementation Notes

  • Implement on top of translate.storage abstractions already used elsewhere in the stack.
  • Prefer explicit keyword/skip lists and regex boundaries that are easy to extend; avoid silent partial parses.

References

  • src/boost_weblate/utils/quickbook.py
  • translate.convert.po2asciidoc (pattern reference for PO → structured text)
  • Boost QuickBook documentation

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions