angular-ngrx-material-starter
angular-ngrx-material-starter copied to clipboard
DatePipe & DecimalPipe
I need to read dates and numbers from a json file and dynamically change locale format. Would be nice to add localized DatePipe and DecimalPipe in an example.
This is probably a better question to ask on the actual package used to translate. This package is meant to be a starter package for clean code with just some fun examples thrown in. i18n does not have a standard for dates or currencies, as far as I know. Best bet is to write your own service and pipe, and either keep a massive json file in your assets folder with all the different variants or stick it all in a database, which is what I'd do. If I were hosting this site I'd most likely take the json file from assets and stick it in a NoSQL database somewhere and manually retrieve what's needed. Reallistically speaking, and especially in enterprise situations, web applications tend to grow, and with it you'd have to maintain an up-to-date translation file. All that being said, machine learning coupled with cloud services will most likely replace keeping up with i18n files sooner or later.