# Chinese/Japanese/Korean localized username support 中文用户名支持

**URL:** https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954
**Category:** Plugin
**Created:** [14.Январь.2016 16:18:37 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954 "2016-01-14T16:18:37Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![zh99998](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zh99998/32/100179_2.png) [@zh99998](https://meta.discourse.org/u/zh99998)
#### Post date: [14.Январь.2016 16:18:38 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/1 "2016-01-14T16:18:38Z")

</div>

here is a simple plugin for add CJK charset allowed as username or group name.  
中日韩用户名/群组名支持插件

[https://github.com/zh99998/discourse-username-localization](https://github.com/zh99998/discourse-username-localization)

## Features

Allow Chinese、Japanese、Korean as username or group name.  
允许使用中文、日文、韩文做用户名和群组名称

use Pinyin or Romaji first letter as default avatar for Chinese, Hiragana and Katakana username.  
对于中文和日文假名用户名，将使用拼音首字母作为系统默认头像

## Install

I don’t know how to replace the constant in routes and javascript, so i made a bash script to replace it. you may add it in app.yml like this.

```plaintext
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/zh99998/discourse-username-localization.git
          - bash discourse-username-localization/install.sh

```

## Allowed characters

CJK Unified Ideographs blocks 4E00-9FD5  
CJK Unified Ideographs Extension A 3400-4DBF  
CJK Unified Ideographs Extension B 20000-2A6DF  
CJK Unified Ideographs Extension C 2A700-2B73F  
CJK Unified Ideographs Extension D 2B740–2B81F  
CJK Unified Ideographs Extension E 2B820–2CEAF  
CJK Compatibility Ideographs F900–FAFF  
CJK Compatibility Ideographs Supplement 2F800-2FA1D  
Hangul Syllables AC00–D7AF  
Hiragana 3040–309F  
Katakana 30A0–30FF  
Katakana Phonetic Extensions 31F0–31FF  
Kana Supplement 1B000–1B0FF

see [Plane (Unicode) - Wikipedia](https://en.wikipedia.org/wiki/Plane_(Unicode)) and [http://unicode.org/charts/for](http://unicode.org/charts/for) more information

## Known issue

- Pinyin/Romaji support is hacky, and not support Korean. other characters will make a avatar with “\_” (I’d like to use “#” for unknown characters avatar, but don’t know how to do that)
- Unicode homograph attack [UTS #39: Unicode Security Mechanisms](http://unicode.org/reports/tr39/)
- not well-tested. I only tested in my site.

please make a pull request if you can get them better.

---

<div class="post-metadata">

### Author: ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)
#### Post date: [16.Январь.2016 08:16:39 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/2 "2016-01-16T08:16:39Z")

</div>

不得不赞一个；你刚刚修正了Known issue的第一个问题，可以更新下啦~

---

<div class="post-metadata">

### Author: ![zh99998](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zh99998/32/100179_2.png) [@zh99998](https://meta.discourse.org/u/zh99998)
#### Post date: [16.Январь.2016 09:10:14 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/3 "2016-01-16T09:10:14Z")

</div>

是修正了前两个。已经把这两个从 known issue 里去除了。

---

<div class="post-metadata">

### Author: ![Ninetailz](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@Ninetailz](https://meta.discourse.org/u/Ninetailz)
#### Post date: [16.Январь.2016 18:08:04 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/4 "2016-01-16T18:08:04Z")

</div>

Thanks for this i really needed a Japanese username :3 Btw it shows 404 😕

---

<div class="post-metadata">

### Author: ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)
#### Post date: [17.Январь.2016 10:48:58 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/5 "2016-01-17T10:48:58Z")

</div>

Where shows 404?  
Your site?

---

<div class="post-metadata">

### Author: ![Ninetailz](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@Ninetailz](https://meta.discourse.org/u/Ninetailz)
#### Post date: [19.Январь.2016 00:29:21 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/6 "2016-01-19T00:29:21Z")

</div>

well never mind it worked! 😃

 ![](https://global.discourse-cdn.com/meta/original/3X/4/c/4ce163e36c28b6b5d96e3cd5884bddd4a589d7ac.PNG)

---

<div class="post-metadata">

### Author: ![xiasummer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xiasummer/32/82790_2.png) [@xiasummer](https://meta.discourse.org/u/xiasummer)
#### Post date: [10.Сентябрь.2016 10:05:39 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/7 "2016-09-10T10:05:39Z")

</div>

很好的插件，不知道能不能把这类特别针对中文的链接中好的几个插件搬运到discoursecn论坛上呢？  
@zh99998

比如我发的一个帖子  
[https://meta.discoursecn.org/t/topic/1428](https://meta.discoursecn.org/t/topic/1428)

希望可以在那里集结一批华语用户，对discourse进行大刀阔斧的本土化改造。

---

<div class="post-metadata">

### Author: ![qcmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/qcmc/32/176968_2.png) [@qcmc](https://meta.discourse.org/u/qcmc)
#### Post date: [04.Ноябрь.2017 02:28:13 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/9 "2017-11-04T02:28:13Z")

</div>

非常好的插件！表示Discourse对中文兼容性不高一直是一个蛋疼的问题 😄

---

<div class="post-metadata">

### Author: ![renyuneyun](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renyuneyun/32/120617_2.png) [@renyuneyun](https://meta.discourse.org/u/renyuneyun)
#### Post date: [26.Ноябрь.2017 22:16:07 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/10 "2017-11-26T22:16:07Z")

</div>

话说能否增加一个设置页面，用来设置将一个汉字视为多少个字符？

---

<div class="post-metadata">

### Author: ![cyufu](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@cyufu](https://meta.discourse.org/u/cyufu)
#### Post date: [12.Март.2018 01:16:09 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/11 "2018-03-12T01:16:09Z")

</div>

The plug-in always shows the failure of the installation, is the link valid?

---

<div class="post-metadata">

### Author: ![freemangl](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@freemangl](https://meta.discourse.org/u/freemangl)
#### Post date: [01.Ноябрь.2018 05:42:48 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/12 "2018-11-01T05:42:48Z")

</div>

Please check the new install readme in zh99998’s github page.

---

<div class="post-metadata">

### Author: ![Jacky](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jacky/32/293257_2.png) [@Jacky](https://meta.discourse.org/u/Jacky)
#### Post date: [17.Декабрь.2018 12:14:21 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/13 "2018-12-17T12:14:21Z")

</div>

> [@zh99998](#):
>
> Known issue

Does “Known issue” refer to a security vulnerability?

---

<div class="post-metadata">

### Author: ![honeymoose](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/honeymoose/32/198718_2.png) [@honeymoose](https://meta.discourse.org/u/honeymoose)
#### Post date: [04.Июнь.2022 12:24:52 UTC](https://meta.discourse.org/t/chinese-japanese-korean-localized-username-support/37954/14 "2022-06-04T12:24:52Z")

</div>

Поддержка китайских имён пользователей официально уже реализована.

Согласно официальной документации, начиная с версии Discourse 2.3.0.beta9, Discourse поддерживает Unicode-имена пользователей, включая китайские.

Официальная публикация: [https://meta.discourse.org/t/unicode-usernames-and-group-names/117737](https://meta.discourse.org/t/unicode-usernames-and-group-names/117737)

Вам достаточно настроить свой Discourse.

[![](https://global.discourse-cdn.com/meta/original/3X/5/0/506b1ba992c9b13344cd1416d0fa1197dbe4f4c3.png)](https://global.discourse-cdn.com/meta/original/3X/5/0/506b1ba992c9b13344cd1416d0fa1197dbe4f4c3.png)

## Место настройки

В настройках администратора найдите по ключевому слову «unicode».

Вы увидите опцию под названием «unicode usernames».

Просто включите эту опцию.

 ![unicode usernames-01](https://global.discourse-cdn.com/meta/original/4X/5/4/8/5485baa4e20c292b16e0449b83436ec82521022e.png)

Если вы используете англоязычную версию Discourse,

то эта опция настройки находится здесь.

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/7/0/e70c73f2c5eab1edefd4c00a29815ce632e6c0cd.png)
