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 support for French language and improve validation rules #3

Merged
merged 36 commits into from
Oct 25, 2024

Conversation

charleskoko
Copy link
Contributor

This pull request introduces the following key changes to the Blasp package:

Default Language Set to English:
The package now defaults to English (en) for profanity detection.

Support for French:
The package has been extended to support French language. Users can specify the desired language by passing a language code ('en', 'fr'.) as an argument.

Laravel Validation Rule Update:
The custom Laravel validation rule blasp_check now supports language-specific validation. Users can validate French text input for profanities by specifying the blasp_check:fr rule.

$sentence = 'Ce projet est totalement merdique';
$blasp = Blasp::check($sentence, 'fr');

$validated = $request->validate([
    'sentence' => ['blasp_check:fr'],
])

This update makes the package more versatile for multi-language applications, starting with French support.

@deemonic
Copy link
Collaborator

deemonic commented Oct 24, 2024

Hi @charleskoko

Thank you for the PR at first glance it looks great!

I will get it reviewed over the next few days

Many Thanks

Mike

Copy link
Collaborator

@deemonic deemonic left a comment

Choose a reason for hiding this comment

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

Some comments on the PR and some things we could work on together if you like?

config/config.php Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/StringNormalizer.php Outdated Show resolved Hide resolved
src/BlaspExpressionService.php Outdated Show resolved Hide resolved
.idea/.gitignore Outdated Show resolved Hide resolved
composer.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@deemonic deemonic left a comment

Choose a reason for hiding this comment

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

@charleskoko Think I'm happy with this for now, I'll merge and we can work on the remaining

@deemonic deemonic merged commit d8dc4d8 into Blaspsoft:main Oct 25, 2024
1 check passed
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.

2 participants