2020-05-01 (Fri) [長年日記]

_ [mutt]To edit both the code and po/*.po

Mutt の開発者メーリングリストで、mutt が表示するメッセージにおける各種表記の一貫性について提案があり、「それなら」ということで、全体的にチェックしてみたい気持ちになりました。その後の経過を説明するために、拙い英語で書いておきます。

Mutt-dev members noticed some inconsistencies in mutt's messages. I'd like to review and hopefully improve them.

I can edit po/mutt.pot directly. But it will be re-generated with the code.

Is there a tool to update the source files according to my latest mutt.pot? Does gettext have something useful for my task? I can't find one.

Okay, I'll write one.

One line of change in mutt.pot would have to update one or more source files and all the *.po files. Sounds complicated? But all the necessary information is around the changed line. So it should be easy. If that's all I need.

I want more. I'd like to sort the messages in various orders or to find/replace some patterns. So mutt.pot is not in the best format. (s/msg/message/ will break everything. s/autocrypt/Autocrypt/ will affect not only the messages but also filenames.)

Then I need some kind of database. Tab-separated list is easy to process with sed and perl.

https://gitlab.com/ttakah/mutt/-/tree/l10n-review/po

Ideally, I need only two scripts:

  • review-parse parses mutt.pot (as STDIN) and generate the database (as STDOUT).
  • review-subst updates the source files.

Due to my poor skill, I can't write them as simple as they should be.

  • review-parse also duplicates *.po with .sub suffix, replacing msgid's with their sha256 values.
  • review-divide lists up the individual files to update.
  • review-subst has to be called once before review-parse, and twice after it.
    • first: replace _("messages") in the source files with their sha256s.
    • second: update the source.
    • last: update *.po.

Hmmm, I hope someone will create a simpler tool.

Anyway, I'm using mine to review mutt.pot for more consistency.


«前の日記(2020-04-14 (Tue)) 最新