Closed guoyunhe closed 6 years ago
There are lots of languages with different characters, we cannot support all of them, for this reason the module exposes generator
function which you can override and use any transformation you want before the slug is saved.
Give it a try and let me know how it works for you.
Currently, mongoose-url-slugs will remove all CJK characters. If the name is totally CJK characters, the slug will become empty.
Here are some node packages that can convert CJK to alphabeta, like Pinyin in Chinese, and Romaji in Japanese. Then they can be convert to slug. For example, the
chinese-to-pinyin
package can convert Chinese characters to Pinyin:Pinyin is easy to slugify as English.