mondeja / mdpo

Markdown files translation using GNU PO files
https://mondeja.github.io/mdpo/
BSD 3-Clause "New" or "Revised" License
25 stars 5 forks source link

Cannot translate the Front Matter part correctly in the Markdown #296

Closed hwhsu1231 closed 6 months ago

hwhsu1231 commented 6 months ago

Problem Description

Recently, I tried to use md2po and po2md commands to translate Markdown files used in a Hugo-based documentation. For example, Graphviz.

However, I noticed that it cannot translate the Front Matter part, which is usually used at the top of the Markdown files, correctly.

---
title: Graphviz
aliases:
  # Fixes a broken Home Page link from Gallery pages.
  - /_pages/
type: docs
---

Screenshot_20240310_150229

Versions

Logs

Click to expand the log ```bash (.venv) hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ md2po content/en/_index.md --quiet --save --po-filepath content/en/_index.zh-tw.po (.venv) hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ po2md --po-files content/en/_index.zh-tw.po --quiet --save content/en/_index.zh-tw.md content/en/_index.md (.venv) hwhsu1231@vb-kubuntu:~/Repo/graphviz.gitlab.io$ md2po --version md2po 2.0.0 ```
mondeja commented 6 months ago

mdpo uses commonmark, which doesn't supports YAML front matters. This is mainly a duplicate of https://github.com/mondeja/mdpo/issues/228, please, refer to that issue.