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.

Chatbox day indicator not correctly formatted, according to the i18n configuration

See original GitHub issue

Describe the bug The date that is shown at the top of a chat box is not being correctly formatted according to the i18n configuration. Using i18n = 'pt-BR' I expected the date to be formatted in brazilian portuguese language, but it’s being formatted in english.

To Reproduce Steps to reproduce the behavior:

  1. Open conversejs with i18n: 'pt_BR' configuration
  2. Open a chatbox that has a message and look at the day indicator

Expected behavior I expected the day indicator to be localized with the locale configured with i18n.

Screenshots image

Environment (please complete the following information):

  • Desktop or Mobile? = Desktop
  • Browser [e.g. Chrome, Firefox] = Chrome Version 86.0.4240.75
  • Converse.js version = 6.0.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jcbrandcommented, Oct 15, 2020

Looks like DayJS doesn’t get initialized with the right locale, or perhaps initialized too late.

Here’s where it gets initialized: https://github.com/conversejs/converse.js/blob/e49f97472a797c9722e5b51f65c159dc6ca1bb14/src/i18n/index.js#L81

@guusdk: Maybe this is something that @bernard-ng could take a look at?

0reactions
bernard-ngcommented, Oct 15, 2020

There is pt-br, so maybe it’s just a matter of having a - instead of _ and making it all lowercase?

Oh my bad, let me try it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Converting between 12 hour and 24 hour clock with i18n in ...
I ended up solving the simplified problem of choosing between 12 and 24 hour time using separate handlebars dates with I18n.l.
Read more >
Rails Internationalization (I18n) API - Ruby on Rails Guides
Every string inside Rails is internationalized in this way, see for instance Active Model validation messages in the activemodel/lib/active_model/locale/en. ...
Read more >
How to Localize a Svelte App with svelte-i18n | Phrase
Svelte-i18n is a light wrapper around FormatJS that uses Svelte stores to provide a no-frills i18n solution. Learn how to use it.
Read more >
8.4.4 Patch Resolved Issues - Pega Documentation
has been resolved by adding code to set the correct context for ... Investigation showed that the busy indicator was not set to....
Read more >
React i18n: A step-by-step guide to React-intl - Lokalise Blog
In fact, localization goes beyond translation. With localization, you can customize not only the language preference but also number formats ...
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