FriendsOfFlarum URL Transliterator
- Edited
datitisev Wouldn't be easier to just use transliterator_transliterate()
if intl is available and fallback to default transliterator if not? Yii transliterator works in that way.
- Edited
0.2.0
- !! Removed non-English locales
- Added two different vanilla PHP transliterator methods
- They both require the
intl
PHP extension - They use different rules, I won't attempt to explain them because I don't know what they mean
- #1 -
Any-Latin; Latin-ASCII; [\u0100-\u7fff] remove;
- #2 -
Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();
- #1 -
- They both require the
- Added dropdown to settings modal to choose transliterator method
- Added extender for developers/forum owners to add their own methods
return [ (new \FoF\Transliterator\Extend()) ->add('test', function (string $str) { // transliterate/slugify return $str; }) ];
Updating
composer require fof/transliterator
Thanks for extension..
Found it over my old 200,000 discussions.
hi. i need to instal this, but comand failed. i have composer at server, but in flarum directory i havent composer.json file. Please help
Crypto77777 If you don't have a composer.json
file in the Flarum directory, you may want to open a support dioscussion as that's not related to this extension.
Every once in a while there are users in this community asking for the possibility to remove the discussion title from the slug alltogether, e.g. here.
This could be easily achieved by adding one more "transliteration" option in /src/Transliterator.php
. What do you think @datitisev?
Great, didn't expect it to be that easy without forking your extension.
datitisev there's a missing translation:
Littlegolden there's a missing translation
You added that blank option yourself in your extend.php
file, how can there be a translation provided by others?
If you want to see a translation there, you need to provide it yourself. I use my own custom language pack, so it was quite easy for me to add a translation. If I hadn't one already I would probably do without a translation.
Pollux Well, I thought it was a new function after the plugin update.
Is it compatible with beta 14?
0.2.1
- beta 14 ready
Updating
composer require fof/transliterator:^0.2.1
php flarum cache:clear
0.3.0
- Flarum beta 15 support
When you enable the extension, the admin panel breaks:
flarum.ERROR: Error: Class 'FoF\Transliterator\Transliterator' not found in /.../vendor/fof/transliterator/extend.php:22
Lolu how did you install the extension? Can you share the output of php flarum info
?
- Edited
clarkwinkelmann Problem solved by installing php7.4-intl
For those interested in installing this extension: In my short experience it seems
Compatible with beta 16
Extiverse Helper shows this is not compatible with beta 16?