diff --git a/README.md b/README.md index 0073a2c..652b3e6 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ Pull requests are welcome, but please make sure you provide unit tests to cover - Spanish - Italian ( provided by @aletundo ) - Brazilian Portuguese ( provided by @ianrodriguesbr ) +- Traditional Chinese ( provided by @Nationalcat ) ## License This project is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT). diff --git a/src/dict/zh-tw.php b/src/dict/zh-tw.php new file mode 100644 index 0000000..cad3c14 --- /dev/null +++ b/src/dict/zh-tw.php @@ -0,0 +1,87 @@ + ':attribute欄位內容包含粗俗用詞,請您修正:)' +]; diff --git a/tests/ProfaneValidatorTest.php b/tests/ProfaneValidatorTest.php index d93a3b2..d3c4b4c 100644 --- a/tests/ProfaneValidatorTest.php +++ b/tests/ProfaneValidatorTest.php @@ -28,8 +28,8 @@ class ProfaneValidatorTest extends PHPUnit_Framework_TestCase { $this->mockConfigs(); $attribute = 'description'; - $text = 'fck you bitch'; - $parameters = ['es', 'en']; + $text = 'fck you bitch. 幹!'; + $parameters = ['es', 'en' , 'zh-tw']; $profane = new ProfaneValidator(); @@ -117,9 +117,9 @@ class ProfaneValidatorTest extends PHPUnit_Framework_TestCase $this->mockConfigs(); $profane = new ProfaneValidator(); - $profane->setDictionary(['es', 'en']); + $profane->setDictionary(['es', 'en', 'it', 'zh-tw']); - $expected = array_merge(include __DIR__.'/../src/dict/es.php', include __DIR__.'/../src/dict/en.php'); + $expected = array_merge(include __DIR__.'/../src/dict/es.php', include __DIR__.'/../src/dict/en.php', include __DIR__.'/../src/dict/it.php', include __DIR__.'/../src/dict/zh-tw.php'); $this->assertEquals($profane->getBadwords(), $expected); }