Allow emojis directly after a Chinese character

If we post two pictograms consecutively, one pictogram is not displayed as shown in the picture below.

Is there a solution?

25

like this?
:bowing_man: :two_hearts:
* note the space between the colons
text :bowing_man: :two_hearts:

3 лайка

Yes!
I understood that two emoticons will be displayed if space is entered.

However, in my web site, when I put two emoji characters, the space does not come in automatically.

This is an error caused by a difference in notation between languages.

While English puts a space between words, on the other hand, Japanese and Chinese do not put space between words.

1 лайк

You’re saying your keyboard doesn’t have a space bar?

2 лайка

No it is not

As a premise, Japanese and Chinese do not put spaces between words.
So pictograms are inserted consecutively after the word without inserting a space.

Then, in discourse pictograms are not displayed correctly, text is displayed instead.

So instead of the ASCII space character, you have only the “full width space” character and Discourse is not interpreting that as a “space”.

Or users are conflating words and emojis and entering them as though they were the same.

I imagine recognition of the full-width space could be coded in. But educating members to treat words and emojis as different things might not be so easy.

Maybe if the auto-complete emoji picker automatically added a space before the first and after the last colons?

1 лайк

I understand this problem and we may look at adding some sort of setting for Chinese. The problem is it is fairly expensive to figure out if a letter is in Chinese as it is a massive regular expression and we do not want to carry all this code.

What I would be open here for is a “mode” where we do not do a “is letter” check prior to emojis which we can enable in Chinese sites so you can butt up emojis against letters. But this change would be global so test:small_airplane: would render as test​:small_airplane: which I guess is fine for you.

2 лайка

In my opinion, if discorse automatically puts a space before an emoticon, problems will be solved in all Chinese, Korean and Japanese.

Initially, this problem arises because Japanese and Chinese people insert pictograms without putting a space at the end of the sentence or in the middle of the sentence.
This is because it is based on the language notation that it creates sentences without spaces, so there is no choice.

There is no need to let the program decide whether it is Chinese or not. Would not it be okay for the program to judge only whether or not there is space before emoji?

:smiley::space_invader::japanese_goblin:
こんにちは:smiley::space_invader::japanese_goblin:

1 лайк

Привет. Было ли когда-либо внедрено исправление для этой проблемы?

Думаю, регулярное выражение здесь не совсем то, что вам нужно. (Как обычно.¹) Гораздо более перспективным кажется проверка, принадлежит ли символ блоку Объединённых иероглифов CJK или, возможно, каким-либо связанным блокам.


¹ «Некоторые люди, столкнувшись с проблемой, думают: „Ага, я использую регулярные выражения“. Теперь у них две проблемы.» — Джейми Завински, http://regex.info/blog/2006-09-15/247

1 лайк

Думаю, это исправлено.

Это было реализовано в виде параметра сайта enable inline emoji translation. Он позволяет использовать 你好:smile:, не пытаясь идентифицировать отдельные иероглифы CJK, и по умолчанию включён для китайской, японской и корейской локалей.

Вы уверены, что это зависит от локали? Локали автора или читателя?

Я надеюсь, что нет, потому что по определённым причинам я использую локаль en_US.UTF-8, хотя я не нахожусь в США, никогда не говорил и не писал на американском английском, и когда я набираю おはよ御座います :slight_smile:, я даже не набираю английский.

Могу сказать, что в редакторе эмодзи выше выглядит у меня нормально, и я смогу сообщить вам через секунду, нормально ли он отображается при чтении опубликованного сообщения.

(Да, при чтении с en_US.UTF-8 он всё ещё выглядит нормально. Я предполагаю, что на самом деле это не зависит от локали, хотя также предполагаю, что проблема правильно решена. Мне любопытно, как именно вы её решили, хотя и не настолько, чтобы заставлять вас серьёзно разбираться, вызовет ли это какие-либо трудности.)

Существуют настройки сайта для форумов, которые настраиваются в зависимости от значения, выбранного в настройке сайта default locale (локаль по умолчанию). Они не зависят от предпочтений читателей или авторов, а помогают администратору настроить форум для конкретного языка. Подробнее об этом можно прочитать здесь: Locale-specific defaults for site settings (`locale_default`)

Администраторы по-прежнему могут настраивать все эти параметры по своему усмотрению. Так, администратор сайта, где локаль по умолчанию — английский, может по-прежнему разрешать более короткие заголовки и сообщения или использование большего количества символов в именах пользователей. Меняется только значение по умолчанию для настройки, которое может быть наиболее подходящим. Поэтому даже на форуме, где локаль по умолчанию — английский, администратор может настроить параметр сайта enable_inline_emoji_translation (включить перевод эмодзи в тексте) так, чтобы не требовался пробел.

1 лайк