-
Notifications
You must be signed in to change notification settings - Fork 966
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
time span format verbosity #1183
base: main
Are you sure you want to change the base?
Conversation
b182b10
to
56d4937
Compare
c2e0979
to
061c11b
Compare
I think it's ready, but there are some questions in the description |
de46b36
to
0689a46
Compare
0689a46
to
8dbdfa7
Compare
@hazzik thoughts on this one? one note is that it significantly increase the number of entries in all the resource files. but if the entry is missing it can sensibly fall back to an acceptable value |
I'm refactoring this whole thing into using fewer resources:
After that refactoring we could start thinking about abbreviations. |
@hazzik awesome. love your work |
I've tried to refactor *Ago and *FromNow. Unfortunately it is not an easy task :( Too many language specific rules. |
Fixes #571
Fixes #642
Fixes #969
Based on
HeadingStyle
(although that's inconsistent withWordForm
).Replace
timeSpan.Humanize(toWords: true)
withtimeSpan.Humanize(timeSpanStyle: TimeSpanStyle.Words)
.This is a breaking change.
timeSpan.Humanize()
remains unchanged, although the optional parameter has changed fromtoWords: false
totimeSpanStyle: TimeSpanStyle.Full
.Added
timeSpan.Humanize(timeSpanStyle: TimeSpanStyle.Abbreviated)
andtimeSpan.Humanize(timeSpanStyle: TimeSpanStyle.Short)
.These return English regardless of the locale.
Question: how do you normally handle translation in this project? I could add tests for every language, where
Abbreviated
andShort
return English for every locale, or not, or I could create translations (and tests) for every language (I could make a best guess for Latin and Cyrillic alphabets, but not the others).Question: should we use uppercase for
Y
,D
,W
? (M
is already uppercase in order to disambiguate with minute)Here is a checklist you should tick through before submitting a pull request:
main
branch (more info below)fixes #<the issue number>
build.cmd
orbuild.ps1
and ensure there are no test failures