OSGeo-jp / QGIS-Website

Official Website for QGIS.org
https://qgis.github.io/QGIS-Website/
MIT License
1 stars 1 forks source link

mdファイルから言語別 po ファイル作成と、翻訳済poファイルから 言語別mdファイル更新のフローを作る #1

Open yoichigmf opened 1 month ago

yoichigmf commented 1 month ago

Tools

gettext hugo-gettext sphinx-intl

Summary

md ファイル -> pot -> 言語別 po -> 翻訳システム transifex or Weblate

修正済みmd -> 既存言語別 po 更新 -> 翻訳システム transifex or Weblate

po -> mo -> 言語別 md

この流れの作成 Github Action にできないか

yoichigmf commented 1 month ago

md ファイルの pot ファイル変換

md-gettext extract mdfilepath potfilepath

https://github.com/PhuNH/markdown-gettext

yoichigmf commented 1 month ago

Usage You can use either md-gettext or markdown-gettext command

Extraction md-gettext extract [-p PACKAGE] [-r REPORT_ADDR] [-t TEAM_ADDR] md pot

positional arguments: md path of the Markdown file to extract messages from pot path of the POT file to create

optional arguments: -p PACKAGE, --package PACKAGE the package name in POT metadata -r REPORT_ADDR, --report-addr REPORT_ADDR the report address in POT metadata -t TEAM_ADDR, --team-addr TEAM_ADDR the team address in POT metadata Generation md-gettext generate [-l LANG] in-md po out-md

positional arguments: in-md path of the source Markdown file po path of the PO file containing translations out-md path of the Markdown file to create

optional arguments: -l LANG, --lang LANG language of translations

yoichigmf commented 1 month ago

sphinx-intl で pot ファイルから 言語別の po ファイル作成ができた。

sphinx-intl update -p i18n/gettext -l ja

これで i18n/locale/ja/LC_MESSAGES の下に日本語用の po ファイルができる。

conf.py が sphinxの設定ファイルなんだが、gdal のやつをもってきて不要部分を削除した。 中身は再度チェック必要かも