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

Support utf-8 in structs, functions and similar just as go does #169

Closed
tpihl opened this issue Mar 15, 2021 · 3 comments
Closed

Support utf-8 in structs, functions and similar just as go does #169

tpihl opened this issue Mar 15, 2021 · 3 comments

Comments

@tpihl
Copy link

tpihl commented Mar 15, 2021

Is your feature request related to a problem? Please describe.
We have some strict language requirements within some of the public sector, where "business" expect to do their work in Swedish (with the crazy character å, ä and even ö).

It is fine to use those characters and other as variable names in go, but we generally avoid that since we define it as IT-specific woke.

However, a rule is something share by IT and busiess, where it really would make sense to be able to use non-ascii characters in structs and functions. Even better if we could translare the few keywords in a rule to Swedish as well (but that is minor).

Describe the solution you'd like
A clear and concise description of what you want to happen.

Allow all runes in rules that are allowed in golang variable name.
(if easy, allow translation of the keywords in a rule as well).

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

  • A preprocessor translating rules where we try to identify any non-ascii characters and figure out if it's inside a comment or is a real identifier will duplicate alot of the parsing already done by the rule engine.
  • Just omit the dots give us a lot of trivial but annoying tries, since we use swedish words not spelled as we have learned to do

Additional context
Add any other context or screenshots about the feature request here.

@newm4n
Copy link
Member

newm4n commented Mar 15, 2021

Hi @tpihl

Thank your for pointing this to us.
We immediately worked out a PR for this #170 and will release a patch for this ASAP.
I hope it covers most unicode's letters.
If you finds any character not supported, please don't hesitate to make another ticket.

Cheers.

newm4n added a commit that referenced this issue Mar 15, 2021
* added index for viewdoc

* pushing first viewdoc

* Added more formating for viewdoc

* Added goornogo coverage test pipeline

* Lowering minimum coverage by 0.1 % to pass on travis

* change circle-ci to use goornogo

* Merge from upstream

* Now simple names is using Unicodes, hopefuly it covers most user's common letters

* Added example to prove that function name, variable names are now accepting unicode in their identifier.

* A little more test to check rule name and retraction can accept unicode.
@newm4n
Copy link
Member

newm4n commented Mar 15, 2021

New patch released for this...
https://github.com/hyperjumptech/grule-rule-engine/releases/tag/v1.8.3

@tpihl
Copy link
Author

tpihl commented Mar 23, 2021

I can confirm it's working beautifully, thank you!!!!

@tpihl tpihl closed this as completed Mar 23, 2021
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

No branches or pull requests

2 participants