Skip to content
New issue

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

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

Already on GitHub? # to your account

Locale doesn't work some browsers #642

Closed
2 tasks done
thefidanabdulla opened this issue Sep 8, 2022 · 2 comments
Closed
2 tasks done

Locale doesn't work some browsers #642

thefidanabdulla opened this issue Sep 8, 2022 · 2 comments
Labels
question Further information is requested

Comments

@thefidanabdulla
Copy link

Before you start - checklist

  • I followed instructions in documentation written for my React-Calendar version
  • I have checked if this bug is not already reported

Description

az-AZ locale doesn't work on following browsers: Chrome, Opera, Brave. I checked another browser like edge it worked.

Steps to reproduce

send to locale prop this keyword: "az-AZ":
and check the browsers which I mentioned above

Expected behavior

I expect the month name in my own language (Sentyabr, Oktyabr)

Actual behavior

It looks like for the M09 or M10.

Additional information

No response

Environment

  • Browser (if applicable):
  • React-Calendar version:
  • React version:
@thefidanabdulla thefidanabdulla added the bug Something isn't working label Sep 8, 2022
@wojtekmaj
Copy link
Owner

wojtekmaj commented Sep 8, 2022

Unfortunately since React-Calendar i18n depends entirely on browser's support for Intl, there's nothing I can personally do.
However, note that in our README there's Intl polyfill mentioned, and this polyfill actually supports az locale.

Here's how you can add the polyfill:

import React from 'react';
import { render } from 'react-dom';
import App from './app';
+import IntlPolyfill from 'intl';
+import 'intl/locale-data/jsonp/az.js';
+
+if (global.Intl) {
+  Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
+} else {
+  global.Intl = IntlPolyfill;
+}

render(
  <App />,
  document.getElementById('react-root'),
);

And boom!

@wojtekmaj wojtekmaj closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2022
@wojtekmaj wojtekmaj added invalid This doesn't seem right question Further information is requested and removed bug Something isn't working invalid This doesn't seem right labels Sep 8, 2022
@thefidanabdulla
Copy link
Author

Thanks for your attention :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants