Emoji in tag names

I’m creating a multi-language forum, there will be people from different nationalities on it. I’m thinking of using tags for showing in which language is a topic. I thought it would be more visual to use emoji to display a flag, but tags do not seem to display the emoji’s image. Instead, the name of the emoji is displayed.

Topic’s title handle the emoji well, why should’t tags do the same ?

8 Likes

There are no plans to support Emoji in tag names.

However tag names can be full unicode (I think?), so you could use any valid Unicode character. And Unicode includes official Emoji code points.

Ruby don’t have a good Unicode processing library (no good binding to ICU). Neither Rails support it.

I would build some C extension to check the Unicode string. If you agree, I can leave an option for Unicode tags when I finished the gem.

Would it be hard to parse the tag to replace the emoji’s text by its image at display time ?

If the user has to handle the text string at sorting, searching or editing it’s not that big of an issue I think. It could always been improved later on. But displaying the emoji while displaying the topic would be great.

I think you may be making more work than need be.
For example, this CSS adds a “heart” before the tag “css3”

a.discourse-tag.tag-css3::before {
  content: "\2665";
}

This is less than ideal because it requires hard-coding the tag’s class attribute value.
But it is simple, works, and as long as you don’t have many tags you want to do this with shouldn’t be that much trouble to maintain.

4 Likes

Thanks for the tip with the unicode flags for tags.

These: 🇨🇳, 🇩🇪, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇹, 🇯🇵, 🇰🇷, 🇷🇺, and 🇺🇸 work and look really great as tags. (EDIT: apparently it is platform dependent, so e.g. windows users don’t see those as flags by default. :frowning:)

I just haven’t found out how to mention such a tag. #🇩🇪 does nothing.

We at the Fairphone Forum decided to go ahead and start using this feature even though it’s not supported yet.
We hope that giving you an example of a working forum using this cool feature is a better motivation to work on implementing it than just some fancy mockups.

So, please come check it out!

Here is the introduction post to flag-tags in our forum:

and here is the list of tags:

###What works already:

  • Contrary to my last post above in general this works with all Regional Indicator Symbols.
  • Like with all other tags you can now see all threads of the same language and follow or mute a language.
  • So far we have been using discourse’s emojis (:it:, :de:, :es:, …) in the topic title, which is by far the inferior solution. Searching for topics of the same language is a pain. Searching for “:de:” will show all (or better yet 50) topics that contain “de” in the title. Searching for “:it:” will yield zero results as “it” doesn’t count as a word.

###What doesn’t work yet:

  • Not everybody can see (all of) these flags.
  • The post I linked above includes a guide to make it work on almost all computers and Android phones, but a way to let every user see the flags without having to install an emoji font would be great.
  • If you don’t see the flags you see 🇩 🇪, 🇫 🇷, 🇳 🇱, 🇮 🇹, 🇪 🇸... which is usually also quite clear.
  • but still we decided to keep using the flags in the topic title as well (for now).
  • You can’t easily #mention an emoji-tag, you’ll have to enter e.g. [🇬🇧](https://forum.fairphone.com/tags/%F0%9F%87%AC%F0%9F%87%A7)
  • You can’t tag a topic without having to copy-paste the flag unless it’s in the top 5 tags.
  • (Minor issue): Even if you copy paste the flag you get a suggestion as though the tag was never used before. So without the “(x17)”.
    This is only an issue if you e.g. copied the flag of Clipperton Island 🇨🇵 instead of France 🇫🇷 and you don’t see that you are creating a new tag instead of tagging the topic as french (happened to me).
  • PS: Searching for flag-tags also doesn’t work yet. It would be cool to be able to e.g. search all Italian topics on Margherita, if you’re not interested in the Spanish Margherita atm.

###So in conclusion

It’s already quite a nice feature, but if discourse starts supporting it this will be epic.

2 Likes

Wouldn’t most/all of these issues be resolved if you changed the convention from :norway: to Norwegian🇳🇴?

That’d make them easily writable and mentionable.

3 Likes

I’d recommend Norwegian-NO rather than smushing the country and country code together. There is also the issue of which language the country name is in. Absolute, as in “english for all” or, relative as in “how each country spells their own name in their own native language”.

3 Likes

I just tested:

Unfortunately only 2 of the 4 issues are solved by that. Tagging topics is now easier, everybody can see at least the text if not the flag, searching still doesn’t work, #mentioning results in a non-clickable #norwegian-:norway:::tag.

PS: I made a poll and our forum population voted to keep the flag-tag without text and keep the emoji in the topic title for now so everybody can see it - until emoji tags are officially supported. :slight_smile:

3 Likes

Related Basecamp 3 feature, I think emoji → tag is the closest analog we have

4 Likes

Since we already supporting semicolon : in tag names I am able to create a new tag named :thinking: which is equal to :thinking: emoji. Then I explored and found that emoji support in tags is easily doable by editing single line of code. And it is just working on my localhost as below

If you are welcome this in core then I will create PR. Else I can share it as custom theme.

It would need to be emoji + text, the emoji of a tag would have to be defined properly in the tag model

1 Like

It is supporting emoji + text option if - symbol used between normal and emoji texts like text-:emoji: or :emoji:-text.

But it is not working for underscore _ symbol.

As a dedicated column of the table? like tag.emoji

probably… cause if this stuff is not separated properly stuff can get very messy:

This slug is super ugly:

/tags/:email:-email

API ends up returning a bit of a mess.

And does anyone really need the tag ?

:clock:time :football: 17

Also, escalating this to a proper data structure allows you more flexibility with rendering in the topic list. Eg: pull up tag emoji before title and leave tag without emoji in the tag list.

5 Likes

@vinothkannans is it possibe to mention a tag (#:thinking:) with your method?

:thinking: is possible. I am not sure about #:thinking:.

1 Like

Well :thinking: just renders to :thinking: and it’s not a link to all topics with that tag. If you mention a normal tag like #emoji::tag you get a link you can click -> #emoji. If I try the same with a tag with an emoji inside it looks e.g. like this #norwegian-🇳🇴::tag and it can’t be clicked.

That’s the one feature I’m looking for that’s still missing in regards to emoji tags.

So, how does one actually create one of these as a standalone tag? Love the look on your forum.