PHPackages                             rny/zhconverter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. rny/zhconverter

ActiveLibrary[Localization &amp; i18n](/categories/localization)

rny/zhconverter
===============

convert between Simplified Chinese(zh-Hans) and Traditional Chinese(zh-Hant)

1.0.0(9y ago)435.6k3MITPHP

Since Oct 30Pushed 9y ago2 watchersCompare

[ Source](https://github.com/rny/ZhConverter)[ Packagist](https://packagist.org/packages/rny/zhconverter)[ RSS](/packages/rny-zhconverter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

ZhConverter
===========

[](#zhconverter)

[![Build Status](https://camo.githubusercontent.com/5e9b00f3b342ced12a4e6e8542f3d3a6798e5cf015c288d54d83aacfbea1a38f/68747470733a2f2f7472617669732d63692e6f72672f726e792f5a68436f6e7665727465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rny/ZhConverter)

ZhConverter is a simple PHP library to convert between Simplified Chinese(zh-Hans) and Traditional Chinese(zh-Hant). ZhConverter is using WikiMedia [ZhConverter.php](https://github.com/wikimedia/mediawiki/tree/master/languages/data) as convertion table.

For those rquire better convertion quality, the C++ project [OpenCC](https://github.com/BYVoid/OpenCC) may be considered.

Highlights
----------

[](#highlights)

- One line code to do the convertion
- Composer ready, PSR-4 compatible.
- PHPUnit tested.

Install
-------

[](#install)

Install `ZhConverter` using Composer.

```
$ composer require rny/zhconverter

```

Usage
-----

[](#usage)

```
use Rny\ZhConverter\ZhConverter;

$text = ZhConverter::zh2hant($text);
$text = ZhConverter::zh2hans($text);
$text = ZhConverter::zh2TW($text);
$text = ZhConverter::zh2HK($text);
$text = ZhConverter::zh2CN($text);

```

```
$text = \Rny\ZhConverter\ZhConverter::zh2hant($text);
$text = \Rny\ZhConverter\ZhConverter::zh2hans($text);
$text = \Rny\ZhConverter\ZhConverter::zh2TW($text);
$text = \Rny\ZhConverter\ZhConverter::zh2HK($text);
$text = \Rny\ZhConverter\ZhConverter::zh2CN($text);

```

Testing
-------

[](#testing)

```
$ composer test

```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3477d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/57f8ac72dbd341bf716252fb1d3d3d9234f6b55e9207570064e5061c1f1cbac6?d=identicon)[rny](/maintainers/rny)

---

Top Contributors

[![rny](https://avatars.githubusercontent.com/u/7847940?v=4)](https://github.com/rny "rny (5 commits)")

---

Tags

convertionphpzh-hanszh-hantzhconverterChinese

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rny-zhconverter/health.svg)

```
[![Health](https://phpackages.com/badges/rny-zhconverter/health.svg)](https://phpackages.com/packages/rny-zhconverter)
```

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.0k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M491](/packages/illuminate-translation)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
