khepin/drupal-transliterator-bundle
Symfony bundle that integrates Drupal's transliteration functionality, converting non-ASCII text into ASCII-friendly strings. Useful for generating slugs, filenames, and search-safe identifiers in PHP applications.
iconv or a basic ASCII-only slugger) produces empty, truncated, or garbage slugs — post-1, -, or raw percent-encoded strings. Drupal's transliteration table is a large, human-curated, decade-tested character map (Łódź→lodz, Москва→moskva, 北京→bei-jing). The decision this supports is: adopt a curated transliteration dataset rather than hand-rolling one.cocur/slugify or Symfony's AsciiSlugger. With 3 stars and 0 dependents, (b) or (c) almost always wins — this package is most valuable as a reference implementation and a behaviour spec, not a dependency./moskva becomes /moscow). This bundle exists precisely to make the new stack produce byte-identical slugs to the old one — converting a redirect-map project into a configuration change. That is a genuine, quantifiable roadmap saving.cocur/slugify (or spatie/laravel-sluggable) behind cviebrock/eloquent-sluggable. Do not let the "PHP package" label create a false match in the backlog.Consider it only when all of the following hold:
TransliteratorInterface are long obsolete.Look elsewhere — and plan to — in every other case:
cocur/slugify or Symfony's AsciiSlugger / slugger service. Both are maintained, PHP 8-compatible, and cover the same languages with equivalent or better coverage./ru/москва): this package transliterates away from the native script — it is the wrong tool, not a weak one.To executives (one line): This is a small, unmaintained Symfony 2 adapter that lets us reuse Drupal's proven transliteration tables so multilingual URLs stay readable and existing Drupal links keep working after migration — it is cheap to replicate and should be copied, not depended on.
The business case. URLs are SEO surface area and, in a migration, a redirect liability. Bad transliteration shows up as either unreadable slugs (%D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B0, node-1234) or as thousands of 404s when a Drupal slug like /moskva becomes /moscow. Drupal's transliteration data is a de-facto reference, refined across a decade of non-English sites; matching it is a solved problem we should not re-solve. The value is the dataset and a parity guarantee, not the library.
To engineering. Do not add this as a dependency. It targets Symfony 2 and Gedmo Sluggable 2.x (both EOL), has no maintainer, no dependents, and no upgrade path; roughly 90% of it is framework glue we would discard. What we want is the character map and the behaviour. Recommended path: (1) on a modern stack, use the framework's built-in slugger — a one-line service change; (2) if we genuinely need Drupal-identical output for migration parity, vendor the transliteration table into a small, tested, in-house service behind our own Transliterator interface, with a golden-file test suite asserting old-slug == new-slug for a representative content sample; (3) never let slug generation be an implicit side effect — pin it, test it, and treat any change as a breaking change with a redirect plan.
Recommendation. Opportunity is low (solved problem, maintained alternatives) but the migration-parity use case is real and time-boxed. Score it as a one-off spike, not a platform choice: half a day to test whether built-in slugging already matches Drupal output on a content sample; only if it does not do we invest in porting the table. Sequence it as: confirm target scripts (is CJK actually in scope?) and clear the license question first — both are gating and neither requires code — then run the coverage spike, then build the parity harness, then integrate behind an interface so the decision is reversible. Ownership of any vendored code transfers to us on day one; scope it as a small but permanent carrying cost, offset by the fact that a pure function over static arrays is the lowest-churn code we can own.
How can I help you explore Laravel packages today?