Skip to content

bug: relative times like "5 minutes ago" read in the panel's language and follow a language switch - #912

Open
lukepolo wants to merge 1 commit into
mainfrom
bug/time-ago-follows-locale
Open

lukepolo wants to merge 1 commit into
mainfrom
bug/time-ago-follows-locale

Conversation

@lukepolo

Copy link
Copy Markdown
Contributor

Relative times like "5 minutes ago" now read in the panel's language and follow a language switch; until now they were English in all 16 locales.

  • TimeAgo picks its javascript-time-ago locale from the i18n locale (zh-Hans → zh, zh-Hant → zh-Hant, the rest by code)
  • Only the language in use is downloaded, as a small chunk; English stays bundled and shows until that chunk arrives
  • One formatter per language, shared by every TimeAgo; the shared minute and second tickers are unchanged
  • A spec mounts TimeAgo in German, Portuguese and both Chinese scripts, and switches language on a mounted one

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

Successfully merging this pull request may close these issues.

1 participant