-
Notifications
You must be signed in to change notification settings - Fork 965
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
Fuzzy month years logic for time span humanize extensions #632
Fuzzy month years logic for time span humanize extensions #632
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Norwegian looks good. I left some comments on the Danish and Swedish translations. Hopefully @thecodejunkie and @madstt can verify my corrections.
<value>en måned</value> | ||
</data> | ||
<data name="TimeSpanHumanize_SingleYear" xml:space="preserve"> | ||
<value>en år</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
et år
// @madstt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is correct, it is called 'et år' in Danish, not 'en år'...
<value>{0} år</value> | ||
</data> | ||
<data name="TimeSpanHumanize_SingleMonth" xml:space="preserve"> | ||
<value>1 månad</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en månad
// @thecodejunkie?
<value>1 månad</value> | ||
</data> | ||
<data name="TimeSpanHumanize_SingleYear" xml:space="preserve"> | ||
<value>1 år</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ett år
// @thecodejunkie?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented with fixes for the Hebrew translations (source: I speak it fluently)
<value>{0} שנים</value> | ||
</data> | ||
<data name="TimeSpanHumanize_MultipleYears_Dual" xml:space="preserve"> | ||
<value>שנים</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 years is either: 2 שנים
or שנתיים
<value>{0} חודשים</value> | ||
</data> | ||
<data name="TimeSpanHumanize_MultipleMonths_Dual" xml:space="preserve"> | ||
<value>חודשים</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 months is either 2 חודשים
or חודשיים
|
||
/// <summary> | ||
/// Turns a TimeSpan into a human readable form. E.g. 1 day. | ||
/// </summary> | ||
/// <param name="timeSpan"></param> | ||
/// <param name="precision">The maximum number of time units to return. Defaulted is 1 which means the largest unit is returned</param> | ||
/// <param name="culture">Culture to use. If null, current thread's UI culture is used.</param> | ||
/// <param name="maxUnit">The maximum unit of time to output.</param> | ||
/// <param name="maxUnit">The maximum unit of time to output. The default value is <see cref="TimeUnit.Week"/>. The time units <see cref="TimeUnit.Month"/> and <see cref="TimeUnit.Year"/> will give approximations for time spans bigger 30 days by calculating with 365.2425 days a year and 30.4369 days a month.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for time spans bigger 30 days
-> for time spans bigger than 30 days
<value>חודש</value> | ||
</data> | ||
<data name="TimeSpanHumanize_SingleYear" xml:space="preserve"> | ||
<value>שנה אחת</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be shortened to just שנה
Out of curiosity, as I can not pull down the code and test it myself, |
Thanks @M-Zuber @khellang @thecodejunkie @madstt for jumping in! I'm trying to get a 2.2 release out by Friday afternoon, and I'd love to get this included if the language updates can be incorporated and validated by then :) |
Chinese translations (all three) look good. |
Can confirm the Russian is all fine from a native speaker. |
@M-Zuber What is displayed if the value is smaller than the TimeUnit passed? |
…ked reviewed language with "Native speaker". Marked 'sv' as reviewed even confirmation is pending.
Swedish looks OK 👍 |
{ | ||
|
||
[Theory] | ||
[Trait("Translation", "Google")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are also verified now 😄
@MaStr11 is this basically ready with the stated manual/machine translations? |
Dutch (nl) looks totally fine |
Farsi translation looks good 👍 |
@onovotny The current state of the Translations is: Missing (timespan related translations are completely absent):
Reviewed by native speakers:
Others: Translated by Google translate. I'm quite confident with the slavic anguages because I can read those and have a minor understanding of basic rules but africans, arabic, chinese korean japanese and the like are just copy&paste. |
merging into branch |
#632 Continued: Fuzzy month years logic for time span humanize extensions
|
||
[Theory] | ||
[Trait("Translation", "Google")] | ||
[InlineData(366, "1 ani")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be "1 an"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please submit a PR? no PR is too small :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are part of #636
Timespan fixes for Romanian (ref. #632)
Fixes #583
This change now allows calls to
TimeSpanHumanizeExtensions.Humanize
with the parametermaxUnit
andminUnit
set toTimeUnit.Month
ormaxUnit: TimeUnit.Year
. The duration in month and years is approximated based on 365.2425 days a year (length of the gregorian calendar). Therefore the month are alternating between 30 and 31 days and the years are alternating between 365 and 366 days.The existing default value for
maxUnit=TimeUnit.Week
is kept because weeks are precise while month and year are not.Most of the changes are related to the translation of the month and year identifiers. All text were translated with google translator except:
I marked the test related to translations with the
[Trait("Translation", "Google")]
attribute to make clear which translations are of poor quality.Checklist for the Translation Reviews: