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

Support locale-specific formatting of date/time #206

Merged
merged 7 commits into from
Oct 9, 2021

Conversation

lyricnz
Copy link
Collaborator

@lyricnz lyricnz commented Oct 8, 2021

On chart X-axis labels and last_updated column. See #188

@lyricnz
Copy link
Collaborator Author

lyricnz commented Oct 8, 2021

This code obeys $LC_TIME first, then the (platform-specific) locales second - see https://github.com/jeandeaual/go-locale
(I have submitted upstream issue to use LC_xxx variables - jeandeaual/go-locale#10)

The actual formatting uses https://github.com/goodsign/monday to translate day/month names (including abbreviations).

@lyricnz
Copy link
Collaborator Author

lyricnz commented Oct 8, 2021

Further work:

  • use local-specific formats (not just translations) doesn't seem to be good alignment
  • change Numericf() and Monetaryf() to use the same locale-detection (with $LC_NUMERIC and $LC_MONETARY overrides)

@lyricnz
Copy link
Collaborator Author

lyricnz commented Oct 8, 2021

Example LC_TIME=hu-HU ./bin/cointop

Screen Shot 2021-10-08 at 11 25 15 am

@miguelmota miguelmota merged commit 4ba9f52 into cointop-sh:master Oct 9, 2021
@miguelmota
Copy link
Member

Thanks @lyricnz! Merged

@lyricnz lyricnz deleted the feature/locale-dates branch October 9, 2021 00:54
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.

2 participants