# Zh [![Build Status](https://travis-ci.com/zh-locale/zh.rb.svg?branch=master)](https://travis-ci.com/zh-locale/zh.rb) [![Maintainability](https://api.codeclimate.com/v1/badges/e41546e0a90d9b9aaa20/maintainability)](https://codeclimate.com/github/zh-locale/zh.rb/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/e41546e0a90d9b9aaa20/test_coverage)](https://codeclimate.com/github/zh-locale/zh.rb/test_coverage) ## Description This project aims to help people use proper Mandarin in different locale settings. In the English world, you may already know even British and American people are speaking English, these two versions of English are not the same. And even in the United States, there are words used differently from different areas. This is not only happening in English, Japanese, for example, is sometimes spoken differently in the Kanto and Kansai region (or more). In the Mandarin world, two versions of Mandarin are known: Simplified and Traditional Chinese. However, there are more than just these two versions. Language is used differently in different regions, areas, and countries. More examples are provided below. You can use this library to get the proper Mandarin usage between any combination of regional dialects. (Version: Simplified and Traditional Chinese; Region: China, Hong Kong, Singapore, and Taiwan). ### Examples Hong Kong vs Taiwan (both use Traditional Chinese) English: Digital single-lens reflex camera tw|hk ---|--- 數位單眼相機|數碼單鏡反光機 China vs Singapore (both use Simplified Chinese) English: New Zealand cn|sg ---|--- 新西兰|纽西兰 China vs Taiwan. The difference is not only between in Simplified Chinese and Traditional Chinese, but also the character usage. The word is translated according to the pronunciation in China, but the meaning in Taiwan. English: Clone cn|tw ---|--- 克隆人|複製人 ## Installation Add this line to your application's Gemfile: ``` gem 'zh' ``` And then execute: ``` $ bundle ``` Or install it yourself as: ``` $ gem install zh ``` ## Usage ```ruby require 'zh' puts Zh.to_tw("面包") #=> "麵包" ``` ## Special thanks & Source: I borrow many ideas from this project: [siuying/zhconv](https://github.com/siuying/zhconv). ## Contributing 1. Fork it ( https://github.com/zh-locale/zh/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request