ggb / numeral-elm

Numeral.js port to Elm
MIT License
22 stars 9 forks source link

How do I create a new language-file? #5

Closed ghost closed 8 years ago

ghost commented 8 years ago

I duplicated English.elm to BritishEnglish.elm, made the necessary changes ($ to £) and put "Languages.BritishEnglish" in elm-package.json.

> import Numeral
> import Languages.BritishEnglish as BritishEnglish
> formatWithLanguage BritishEnglish.lang "£0,0.00" 1000.23

in elm repl is giving me this

var d_e_l_t_r_o_n_3_0_3_0; = d_e_l_t_r_o_n_3_0_3_0

SyntaxError: Unexpected token =
ggb commented 8 years ago

Hi,

could you please open a PR with your changes, so that I can check it on my side?

Thanks! Gregor

ggb commented 8 years ago

Thanks for the PR. I've checked the BritishEnglish-language file and it works as expected (tested with 0.17 and 0.17.1 on Ubuntu). Please note that you have to use it like this:

> import Numeral
> import Languages.BritishEnglish as BritishEnglish
> Numeral.formatWithLanguage BritishEnglish.lang "$0,0.00" 1000.23
"£1,000.23" : String

Do you have problems with other language files? I'll merge your PR and republish the package soon.

Gregor

ghost commented 8 years ago

It's working today. Can't work out why it wasn't yesterday. Thanks for the help!

ggb commented 8 years ago

I'm glad it works! Thanks for your PR.