-
Notifications
You must be signed in to change notification settings - Fork 467
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
Added support for fortnight and century #987
base: master
Are you sure you want to change the base?
Changes from 9 commits
ddff3eb
96d2e52
e826a06
7185282
127149b
2f1f8fc
7edac70
9a585be
ec50655
5b55b2a
b461617
ceae086
52582cd
83c593d
e9ab0d0
b97612e
fcab861
93863fb
baec3b6
11c6a5f
7649958
472cf9b
e13c925
6f7630c
d89210c
46dcbc9
10ce3a4
a36c48b
2738b28
0943ee1
da174a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ november: | |
- नवम्बर | ||
december: | ||
- दिसम्बर | ||
decade: | ||
- दशक | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can add the plural for this as well, e.g. दशकों There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Thanks For Suggestions I'll be Implementing Them ASAP .... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. |
||
|
||
year: | ||
- साल | ||
|
@@ -33,3 +35,15 @@ in: | |
relative-type: | ||
2 day ago: | ||
- परसों | ||
1 decade ago: | ||
- पिछला दशक | ||
in 1 decade: | ||
- अगला दशक | ||
|
||
relative-type-regex: | ||
in \1 decade: | ||
- (\d+) दशक में | ||
\1 decade ago: | ||
- (\d+) दशक पहले | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just a nitpick: there is an extra line here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,19 @@ def test_relative_past_dates_with_time_as_period(self, date_string, ago, period) | |
|
||
@parameterized.expand([ | ||
# English dates | ||
param('1 fortnight', ago={'days': 14}, period='day'), | ||
param('last fortnight', ago={'days': 14}, period='day'), | ||
param('14 fortnight', ago={'days': 196}, period='day'), | ||
param('a fortnight ago', ago={'days': 14}, period='day'), | ||
param('last fortnight', ago={'days': 14}, period='day'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is repeated and the same as in line 61. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. |
||
param("1 century", ago={'years': 100}, period='year'), | ||
param("1 century 2 years", ago={'years': 102}, period='year'), | ||
param("1 century 12 months", ago={'years': 100, 'months': 12}, period='month'), | ||
param("1 century and 11 months", ago={'years': 100, 'months': 11}, period='month'), | ||
param("last century", ago={'years': 100}, period='year'), | ||
param("a century ago", ago={'years': 100}, period='year'), | ||
param("6 centurys", ago={'years': 600}, period='year'), | ||
param("10 centuries", ago={'years': 1000}, period='year'), | ||
param("1 decade", ago={'years': 10}, period='year'), | ||
param("1 decade 2 years", ago={'years': 12}, period='year'), | ||
param("1 decade 12 months", ago={'years': 10, 'months': 12}, period='month'), | ||
|
@@ -353,6 +366,8 @@ def test_relative_past_dates_with_time_as_period(self, date_string, ago, period) | |
param('1 वर्ष, 8 महीने, 2 सप्ताह', ago={'years': 1, 'months': 8, 'weeks': 2}, period='week'), | ||
param('1 वर्ष 7 महीने', ago={'years': 1, 'months': 7}, period='month'), | ||
param('आज', ago={'days': 0}, period='day'), | ||
param('1 दशक', ago={'years': 10}, period='year'), | ||
param('1 दशक पहले', ago={'years': 10}, period='year'), | ||
Comment on lines
+370
to
+371
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have added a few suggestions above to improve the Hindi test cases. Please have a look. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe these test cases can be added here as well
|
||
|
||
# af | ||
param("2 uur gelede", ago={'hours': 2}, period='day'), | ||
|
@@ -576,6 +591,19 @@ def test_relative_past_dates(self, date_string, ago, period): | |
|
||
@parameterized.expand([ | ||
# English dates | ||
param('1 fortnight', ago={'days': 14}, period='day'), | ||
param('last fortnight', ago={'days': 14}, period='day'), | ||
param('14 fortnight', ago={'days': 196}, period='day'), | ||
param('a fortnight ago', ago={'days': 14}, period='day'), | ||
param('last fortnight', ago={'days': 14}, period='day'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above. It is repeated as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. |
||
param("1 century", ago={'years': 100}, period='year'), | ||
param("1 century 2 years", ago={'years': 102}, period='year'), | ||
param("1 century 12 months", ago={'years': 100, 'months': 12}, period='month'), | ||
param("1 century and 11 months", ago={'years': 100, 'months': 11}, period='month'), | ||
param("last century", ago={'years': 100}, period='year'), | ||
param("a century ago", ago={'years': 100}, period='year'), | ||
param("6 centurys", ago={'years': 600}, period='year'), | ||
param("10 centuries", ago={'years': 1000}, period='year'), | ||
param("1 decade", ago={'years': 10}, period='year'), | ||
param("1 decade 2 years", ago={'years': 12}, period='year'), | ||
param("1 decade 12 months", ago={'years': 10, 'months': 12}, period='month'), | ||
|
@@ -841,6 +869,7 @@ def test_relative_past_dates(self, date_string, ago, period): | |
param('1 वर्ष, 8 महीने, 2 सप्ताह', ago={'years': 1, 'months': 8, 'weeks': 2}, period='week'), | ||
param('1 वर्ष 7 महीने', ago={'years': 1, 'months': 7}, period='month'), | ||
param('आज', ago={'days': 0}, period='day'), | ||
param('1 दशक पहले', ago={'years': 10}, period='year'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a few more test cases for the Hindi version here? For e.g.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. |
||
|
||
# af | ||
param("2 uur gelede", ago={'hours': 2}, period='day'), | ||
|
@@ -1066,6 +1095,13 @@ def test_normalized_relative_dates(self, date_string, ago, period): | |
|
||
@parameterized.expand([ | ||
# English dates | ||
param('in a fortnight', in_future={'days': 14}, period='day'), | ||
param('next fortnight', in_future={'days': 14}, period='day'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure, but do we support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. |
||
param('in 1 century 2 months', in_future={'years': 100, 'months': 2}, period='month'), | ||
param('in 10 century', in_future={'years': 1000}, period='year'), | ||
param('in 1 century 12 years', in_future={'years': 112}, period='year'), | ||
param('next century', in_future={'years': 100}, period='year'), | ||
param('in a century', in_future={'years': 100}, period='year'), | ||
param('in 1 decade 2 months', in_future={'years': 10, 'months': 2}, period='month'), | ||
param('in 100 decades', in_future={'years': 1000}, period='year'), | ||
param('in 1 decade 12 years', in_future={'years': 22}, period='year'), | ||
|
@@ -1160,6 +1196,7 @@ def test_normalized_relative_dates(self, date_string, ago, period): | |
param('17 सेकंड बाद', in_future={'seconds': 17}, period='day'), | ||
param('1 वर्ष, 5 महीने, 1 सप्ताह में', | ||
in_future={'years': 1, 'months': 5, 'weeks': 1}, period='week'), | ||
param('1 दशक में', in_future={'years': 10}, period='year'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we also add a few more test cases for the Hindi version here? For e.g.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gutsytechster Done this change, Please Look into it 😊. |
||
|
||
# af | ||
param("oor 10 jaar", in_future={'years': 10}, period='year'), | ||
|
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.
This is not correct. The
?
indicates an optional letter.Doing this it will accepts "in 1 century" but also "in 1 centur". You need to add an
s
before the?
.Also, you should need to add support for
centuries
here.You can check if both thigns work with this
and:
Now both are failing.
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.
@noviluni sure fixing the bug.
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.
@noviluni The tests are failing for centuries , even I added them on en.yaml.