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

I18N of operators #12

Open
seizmo opened this issue Jan 16, 2015 · 1 comment
Open

I18N of operators #12

seizmo opened this issue Jan 16, 2015 · 1 comment

Comments

@seizmo
Copy link

seizmo commented Jan 16, 2015

Is there an easy way to switch the operators to another language ('AND' -> 'UND', 'OR' -> 'ODER') or could that be easily implemented (e.g. by having pluggable grammars)?

@mrkamel
Copy link
Owner

mrkamel commented Jan 16, 2015

A pluggable grammar would currently not be easily possible, as we'd need a .treetop file for every language - and that would probably mean a lot of duplicate treetop code ...

https://github.com/mrkamel/search_cop/blob/master/lib/search_cop_grammar.treetop#L11-L17

It could be possible to factor out the operators from the grammar alltogether and to construct AND/OR expressions in ruby directly. Have to think about this, but you better don't expect this to be release any time sooner or later.

Besides being not perfectly elegant, you can of course always map operators before handing the query out to search cop, via e.g. gsub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants