I already started my draft when you answered. After evaluating the
alternatives I ruled out Shakespeare because it requires that all
languages are baked into the Hledger executable. In contrast to that I
think it is essential that users can create their own translations, maybe
even custom translations for their specific needs.
Here is my first draft:
https://github.com/hledgerorg/hledger/pull/2735
However, since Shakespeare can evaluate arbitrary Haskell code it would be
capable of doing a little language processing (see below).
> - Focus strictly on text in reports for now, starting with bs/is/cf -
> titles, headings, month names, weekday names.
I started with this, but even things like "Monthly Income Statement"
cannot be easily translated because attributes like "Monthly" need to be
adapted to the gender of noun in many languages.
Also, translations for Month and Weekday names already exist in glib20.mo.
I am not sure whether we should re-use such generic translations or
include our own ones.
> Ignore CLI, error messages, docs. Catalogue the reports and report items to be translated.
Error messages in the sense of Haskell's "error" are messages to the
developer and should not be translated. In the long run however, user
error messages should be translated. I am afraid Hledger does not clearly
separate these two kinds of errors.
> - Select the display language at runtime with a _lang in ReportOptions, and a --lang CLI option.
> - Don't switch based on locale - default to english for consistency and repeatability. We'll document how to set
> --lang in a config file.
Currently I let the user choose a catalog file.