Description
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:
-
API and usage for current Gettext users would need to remain identical for backwards compatibility
-
The extractor would need to be told hold to tag messages so they aren’t all tagged as
format-elixir
-
The backend interface would be normalised. Instead of
BackendModule.__gettext__(:priv)
for example, it would be better to haveBackendModule.__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?