date-format icon indicating copy to clipboard operation
date-format copied to clipboard

Language configs should be provided from outside

Open Hamzali opened this issue 4 years ago • 4 comments

Love the library thank you for this awesome work :)

MomentJS is awesome as well however the biggest pain point for me was the size of the language and internalization options, however, most of the time I use two or three languages at most.

I think language data could be given as a dict from outside with typed configuration values and language codes as keys because every language will increase the size of the package and limits the language aspect. Maybe every language set can be a separate package this way

Any ideas or plans about how can the internalization problem decoupled from the date formatting problem at hand?

Hamzali avatar Mar 24 '20 22:03 Hamzali

Unused languages will be tree-shaken out anyways AFAIK.

janwirth avatar Mar 26 '20 10:03 janwirth

If it is the case then I would love to add Turkish translations because I will need it for my current project :) I just open a PR right? Anything important to know beforehand?

Hamzali avatar Mar 27 '20 13:03 Hamzali

You can inject them locally for now AFAIK - I needed german but only for relative date formatting. So partially translating works.

janwirth avatar Mar 27 '20 17:03 janwirth

ok, thanks for the help :)

Hamzali avatar Apr 18 '20 21:04 Hamzali