nicksnyder / go-i18n

Translate your Go program into multiple languages.
MIT License
2.96k stars 269 forks source link

Adding gettext #243

Open Waitak opened 3 years ago

Waitak commented 3 years ago

We've really enjoyed this package. One thing that would help us tremendously is if we could share translation files between platforms. What would need to happen to make a gettext unmarhaller that could seamlessly read in a Django-style collection of po/pm translations? As is, we've had to write tools to turn the latter into the former. That works, more or less, but having a single, shared source of translations would be much more desirable.

nicksnyder commented 3 years ago

What would need to happen to make a gettext unmarhaller that could seamlessly read in a Django-style collection of po/pm translations?

I honestly don't know. There might be a fundamental data model incompatibility (i.e. mo/po files don't provide the necessary information to be able to fulfil the API that go-i18n provides), or it might be as simple as adding an unmarshal method and implementing the logic. If it is as simple as adding a new load/unmarshal method, I would be happy to review a PR.