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

add filters.genie for Chinese #11

Merged
merged 4 commits into from
Mar 12, 2019
Merged

add filters.genie for Chinese #11

merged 4 commits into from
Mar 12, 2019

Conversation

johnnychhsu
Copy link
Contributor

translate filters.genie for Chinese

@johnnychhsu
Copy link
Contributor Author

@gcampax
I need something like timeGetPredicate for constant_Date, should I add in ast_manip?
For example, d1:constant_Date '和' d2:constant_Date '之間' => C.dateGetPredicate($options, d1, d2);

@gcampax
Copy link
Contributor

gcampax commented Feb 27, 2019

You can add the helpers and new code to ast_manip yeah.
The question is, why do you need it?
Get predicates are used to add extra conditions to programs (or, more commonly, access control policies). A condition on dates seems odd? What's your use case?

@johnnychhsu
Copy link
Contributor Author

johnnychhsu commented Feb 27, 2019

for example, if I want my blood pressure records between 2019/01/01~2019/02/25, then I need that.

@gcampax
Copy link
Contributor

gcampax commented Mar 1, 2019

A get predicate is a filter on the current date when the code is evaluated, not on the date of the record. What you want is a range filter of type Date.

@johnnychhsu
Copy link
Contributor Author

I see. Thank you!

@johnnychhsu johnnychhsu requested a review from gcampax March 5, 2019 03:07
@gcampax gcampax requested a review from sileix March 5, 2019 03:29
};
v1:constant_Date ('和' | '跟') v2:constant_Date '之間'=> {
if (!v1.getType().equals(v2.getType()))
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will never trigger, because range_filter only pairs the range to a numeric (number, currency, measure) parameter, not a date parameter.

Also, the v1.getType().equals( v2.getType()) check is redundant because you're asking for Date constants through the grammar non-terminal.

Copy link
Contributor

@gcampax gcampax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at it and I didn't see anything obviously wrong, but I'm adding @rayslxu to take a look at it too

Copy link
Member

@sileix sileix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add some comments based on Chinese in Mainland China. (things might be slightly different in Taiwan, I don't know)

languages/zh-tw/filters.genie Show resolved Hide resolved
languages/zh-tw/filters.genie Outdated Show resolved Hide resolved
languages/zh-tw/filters.genie Outdated Show resolved Hide resolved
languages/zh-tw/filters.genie Outdated Show resolved Hide resolved
languages/zh-tw/filters.genie Outdated Show resolved Hide resolved
languages/zh-tw/filters.genie Outdated Show resolved Hide resolved
languages/zh-tw/filters.genie Outdated Show resolved Hide resolved
@johnnychhsu
Copy link
Contributor Author

johnnychhsu commented Mar 6, 2019

I add some comments based on Chinese in Mainland China. (things might be slightly different in Taiwan, I don't know)

Thank you! I modified some according to your review.

@johnnychhsu johnnychhsu merged commit f13ac45 into master Mar 12, 2019
@johnnychhsu johnnychhsu deleted the zh-tw_filters branch April 3, 2019 06:50
gcampax added a commit that referenced this pull request Jun 23, 2020
In particular bump consumer-queue to 1.0.1, which fixes a pretty
bad bug

Fixes #11
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.

None yet

3 participants