wikimedia/langconv
A PHP library for language variant conversion, providing MediaWiki-compatible rules and support for Chinese script variants such as Simplified and Traditional. Useful for rendering content in a reader's preferred variant.
What it is. LangConv is the conversion engine extracted from MediaWiki's LanguageConverter — the component behind zh-hans/zh-hant/zh-cn/zh-tw/zh-hk/zh-sg variant rendering on Wikipedia. It converts one source text into multiple script variants (Chinese Simplified/Traditional, Serbian Cyrillic/Latin, and a few others) using compiled FSTs and replacement rules. It is an engine, not a dictionary.
Architecture fit
ScriptConverter::convert(string $text, string $variant): string.-{...}- exception markup. That is real semantic coupling, not just an API surface.Integration feasibility
ZhConversion) live in MediaWiki core and must be sourced and compiled/baked separately. Without that pipeline you have a high-quality engine with an empty dictionary. Budget for a build step, an artifact, and a refresh cadence.Technical risk
Key questions
Stack fit
Migration path
Compatibility
zh-hans, zh-hant, zh-cn, zh-tw, zh-hk, zh-sg, zh-my, zh fallback). Do not pass arbitrary BCP-47 tags through.-{...}- is meaningful syntax, user content containing -{ can alter output. Escape or strip it at the boundary.Sequencing (~4–6 weeks for a mid-size team)
Accept-Language + user preference), variant-aware cache keys.Maintenance
Support
Scaling
Failure modes
-{...}- collisions in user content, or conversion applied to HTML instead of text.Ramp-up
Bottom line. Technically low-risk and battle-tested, but the decision hinges on two non-technical items: GPL-2.0 compatibility with your distribution model, and your willingness to own a conversion-table pipeline that the package deliberately does not ship. If legal clears hosted use and you can own the pipeline, adopt behind an interface with OpenCC as the documented fallback. If either fails, go straight to OpenCC and skip this dependency.
How can I help you explore Laravel packages today?