question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Locale doesn't work

See original GitHub issue

Issue Description

Locale doesn’t work. As per instruction in README, I am setting dayjs locale but still not getting any dates/time localized. Any ideas?

import 'dayjs/locale/ru

render (
     <GiftedChat messages={messages} locale={'ru'} />
)

Steps to Reproduce / Code Snippets

As above

Expected Results

Dates and times localized to a selected locale

Additional Information

  • Nodejs version: 13
  • React version:16.8.1
  • React Native version:0.61.3
  • react-native-gifted-chat version: 0.16.3
  • Platform(s) (iOS, Android, or both?):both
  • TypeScript version: N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

6reactions
dan-arkhipovcommented, Aug 22, 2020

OK, managed to sort this, this is what worked for me:

const dayjs = require('dayjs');
import ru from 'dayjs/locale/ru'

render (
     <GiftedChat messages={messages} locale={ru} />
)
2reactions
jackwullemscommented, Sep 20, 2021
import 'dayjs/locale/he'
...
<GiftedChat
  locale='he'
...
   />

Read more comments on GitHub >

github_iconTop Results From Across the Web

moment.js change locale not working - Stack Overflow
My website is a mutilanguage website, when I change the web language. moment.locale(lang) not working. My code is: const startDate = moment.utc( ...
Read more >
How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user account: $ locale LANG=C LANGUAGE= LC_CTYPE=fi_FI.
Read more >
locale changes does'nt work · Issue #2962 · moment ... - GitHub
I'm in an angular project, modules are handles with JSPM. I don't understand what you mean by " that may be giving you...
Read more >
locale — Internationalization services — Python 3.11.1 ...
Calling setlocale(LC_ALL, '') lets it use the default locale as defined by the LANG variable. Since we do not want to interfere with...
Read more >
perllocale - Perl locale handling (internationalization and ...
Perl itself (outside the POSIX module) will not use locales unless specifically requested to (but again note that Perl may interact with code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found