Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluent-react] DATETIME formatting always uses default #90

Closed
hkasemir opened this issue Nov 8, 2017 · 8 comments
Closed

[fluent-react] DATETIME formatting always uses default #90

hkasemir opened this issue Nov 8, 2017 · 8 comments

Comments

@hkasemir
Copy link
Contributor

hkasemir commented Nov 8, 2017

fluent version 0.4.1

// ftl file
today-is = today is { DATETIME($date, month: "long", day: "numeric") }
// React component
...
  <Localized id='today-is' $date={new Date()}>
    <p>today is {(new Intl.DateTimeFormat("fr", {month: "long", day: "numeric"})).format()}</p>
  </Localized>
  <p>today is {(new Intl.DateTimeFormat("fr", {month: "long", day: "numeric"})).format()}</p>
...

result
image

node version 6.11.2

@zbraniecki
Copy link
Collaborator

Seems like an issue with fluent-react, since I can't reproduce it in fluent-web.

@stasm ?

@zbraniecki zbraniecki changed the title DATETIME formatting always uses default [fluent-react] DATETIME formatting always uses default Nov 14, 2017
@stasm
Copy link
Contributor

stasm commented Nov 21, 2017

I can't reproduce this. In cce4d42 I added a DATETIME($date, month: "long", day: "numeric") placeable to fluent-react's hello-world example. I can see the full name of the month spelled out correctly.

@stasm stasm removed their assignment Nov 21, 2017
@hkasemir
Copy link
Contributor Author

I can see that this is not reproduced by the examples, however, I was able to create a very basic test repo that repro's all the issues: #91, #90, and #89

https://github.com/hkasemir/test-fluent
it's using node 8.9.1, and requires npm link to the local fluent-react

@hkasemir
Copy link
Contributor Author

however I did just discover that if I also npm link fluent, issue #90 is solved.

@zbraniecki
Copy link
Collaborator

I was able to reproduce all three issues using Heidi's minimized testcase. In my case, npm link fluent did not fix issue #90.

@stasm
Copy link
Contributor

stasm commented Nov 27, 2017

Thanks for putting together the testcase, @hkasemir. I can confirm that npm link fluent fixes #90. This is thanks to #81 which landed on master but hasn't made it into a released version yet.

Linking both fluent and fluent-react also fixes #89 for me. I suspect this is because when they're both linked, Webpack bundles them together and the instanceof FluentType actually works.

@stasm
Copy link
Contributor

stasm commented Nov 27, 2017

Once #98 lands I'll publish a new version of fluent which will make it easier to set up fluent-react for testing.

@stasm
Copy link
Contributor

stasm commented Nov 27, 2017

I just published fluent 0.4.2 which fixed this.

@stasm stasm closed this as completed Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants