Skip to content

Separate PO and Gettext into separate packages #215

Closed
@kipcole9

Description

@kipcole9

I am working on an ICU Message formatter and localisation processor as the (maybe) last part of the ex_cldr. One requirement is of course to store and manage translations and PO files are clearly the defacto globally standard.

I would like to propose splitting Gettext into as PO package that looks after storage, parsing, merging and extracting. That way different localisation packages can leverage the same infrastructure - which is supported by the format tag in a PO file. As you know, today Gettext saves all messages with the format-elixir tag.

What would need to change:

  1. API and usage for current Gettext users would need to remain identical for backwards compatibility

  2. The extractor would need to be told hold to tag messages so they aren’t all tagged as format-elixir

  3. The backend interface would be normalised. Instead of BackendModule.__gettext__(:priv) for example, it would be better to have BackendModule.__po__(:priv) in order to be more specific and not tied to the Gettext API alone

4 Compiling PO files would compile messages based upon the message format. Perhaps a behaviour would be introduced so that any message format could be compiled. Instead of use Gettext, .... it would become use PO, icu_format: MyMessageFormatter, elxiir_format: Gettext or some such. Then use Gettext, ... would also include use PO, ....

5 Lastly, this may open up the opportunity to have different storage models, like DB, or :persistent_term or even a web service that can replace PO files while still retaining the well known format.

I’m fine to work on this - its better than creating another PO file parser/merger/extracted as @tmbb as already had to do,

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions