Aggiungi alias in inglese e tradotti per gli Emoji

Continuiamo la discussione da Aggiungere il supporto per gli alias alla selezione emoji:

La nostra selezione emoji potrebbe essere notevolmente migliorata aggiungendo il supporto per gli alias di ricerca in inglese e nelle lingue tradotte. Il Consorzio Unicode fornisce tutti i dati necessari:

Questa funzionalità è composta da due parti:

  1. Implementare correttamente tutti gli alias in inglese
  2. Aggiungere il supporto per gli alias specifici per locale, in modo da poter digitare :sourire in francese sui siti in francese e ottenere :smile: nella finestra.

Lo inserirò nella mia lista.

16 Mi Piace

Just as a note here, we need it to be lazy loaded, this is why I haven’t been doing it yet.

7 Mi Piace

I think it is fine to have alias.en and alias.de etc… files, so we can lazy load per locale.

4 Mi Piace

Isn’t this complete @gerhard?

No, not yet. I decided to work on it next month because it was moved to the next release.

5 Mi Piace

Just found out about this “public” list of translated emoji aliases: Translations

3 Mi Piace

Hey

I have a general question. I created my custom emoji group. How do I override this translation key? :slight_smile:

image

Thank you.

Currently you have to add translations into a theme or component, in your case it would be something like:

<script>
    I18n.translations.en.js.emoji_picker.twitch = "Twitch";
</script>

You can also add de if you need a different name for de.

@gerhard I had to ask you about this, do you see a better way to accomplish this given custom group names are set by admins ?

7 Mi Piace

The easiest solution I can think of is to use the custom group name if the translation can’t be found. The only problem I’m seeing is that group names seem to be converted to lowercase.

I18n.t("emoji_picker.twitch", { defaultValue: "twitch" })

The more involved solution would be to make SiteTextsController and TranslationOverride work with custom emoji group names (or any other custom translation that needs to be added at runtime).

2 Mi Piace

Cool might investigate the second one at some point, thanks.

2 Mi Piace

Hey I just did console.log(I18n.translations.en.js) which outputs me the following:

It seems that emoji_picker is not available for a translation for me. There are also no effects if I paste in your code into my theme head.

Thank you.

1 Mi Piace

Questo è stato segnalato di nuovo qui: (ora chiuso)

Lo daremo priorità e lo realizzeremo nella prossima versione.

4 Mi Piace

@j.jaffeux Ho creato una PR per includere gli alias di ricerca nel nostro repository emoji-db.

5 Mi Piace

Fatto in queste PR

Nel frattempo, ho corretto un bug che ha ridotto il payload di emojis.json di 160 KB :smiling_face_with_sunglasses:

Questo introduce gli alias di ricerca completamente localizzati

4 Mi Piace

Ho integrato il supporto per gli alias di emoji localizzati per alcune lingue, così finalmente

nonché

3 Mi Piace