Comments (3)
In theory this would be possible by adding a rules for Emoji or other unicode characters. However, we do not have such a list at the moment, because I think there would be a lot of discussion around what is the correct name. Just looking at your example, you would translate ❤️ into love
, some people would translate it into heart
and the official description is red heart
.
from slugify.
I'm closing this issue, if you're interesting you can create a rule set which you can use just for your project (here is a database with emoji names) and you can create a PR and we will take it under consideration.
from slugify.
@ShivPandey you can use the following code with the https://github.com/ausi/slug-generator library:
$slugGenerator = new SlugGenerator([
'preTransforms' => [
':: [:Symbol:]; :: Any-Name; \'\N{\' > \' \'; \'}\' > \' \';',
],
]);
$slugGenerator->generate('💩'); // pile-of-poo
$slugGenerator->generate('🙃'); // upside-down-face
$slugGenerator->generate('unicode ♥'); // unicode-black-heart-suit
$slugGenerator->generate('unicode ❤'); // unicode-heavy-black-heart
$slugGenerator->generate('unicode ❤️'); // unicode-heavy-black-heart
$slugGenerator->generate('unicode 👍'); // unicode-thumbs-up-sign
This converts symbols to their unicode names, but as you can see in the examples above they might not be the exact names you are looking for.
from slugify.
Related Issues (20)
- User Deprecated HOT 5
- Issue with usage, example doesnt work after installing with composer HOT 3
- how to get slug without translation HOT 1
- Laravel 9 Support HOT 3
- Sign « changes on quot HOT 1
- Split DefaultRules into deparate files
- Add command-line interface to this package? HOT 1
- release for php 8.2 HOT 2
- Remove reserved characters like ­ and
- New release does not work on PHP 7.4 HOT 2
- The version 4.4.0 have been removed from Packagist? HOT 3
- Requirements Version 4.5 HOT 2
- version 4.5.0 is not compatible with PHP 7 although mentioned in packagist HOT 3
- Czech rules missing several characters
- Syntax error, unexpected '|', expecting variable {t_variable} HOT 3
- Issue with Php Composer (Slugify)
- What about non supported languages HOT 1
- Please update for Symfony > 7 HOT 3
- Dependencies between rulesets?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slugify.