« Back Issue #490
  • 2022-03-05 15:14 Reported by patelpa
  • 2022-03-13 18:33 Marked fixed
Status: Marked fixed
Priority: Medium

Emoji Picker to support emojis in messages for Messages activity

patelpa 2022-03-05 15:14

This issue is created for including the patch which contains the code for adding Emojis in the Messages activity which was created by Anirudh Mallya. The code changes are in UsermessagesElement.php which changes the input element for sending new message by adding a button which when clicked draws a emoji picker and surrounding button and input element with a span element. Also few javascript functions are added to toggle emoji picker and also create navigation tabs between different emoji groups. There are changes in messages.css file to apply styles to the affected elements. A new file EmojipickerHelper.php is added which helps to draw the emoji picker by first initialising an array which contains the data for all the emojis and then rendering the elements required.

patelpa 2022-03-08 17:48

Uploading new patch file created as per the guidelines.

administrator 2022-03-08 18:13

applied 5f1cf2184d1 in repository.

Thanks for the patch! It's live on yioop.com if you want to try private messaging me an emoji.

Chris

administrator 2022-03-08 18:18

hey parth,

I just realized you have tons of unlocalized strings in your emoji-picker. Can you rewrite it using the tl() functions so the emoji strings can be localized to other languages than English?

Thanks!

Chris

administrator 2022-03-08 18:21

For example,

"football" => ["�",tl('emojipicker_helper_american_football')],

then give a value for emojipicker_helper_american_football under Manage Locales. (Just for English there is okay.)

Best, Chris

patelpa 2022-03-09 12:59

I thought of adding localized strings but then it slipped off my mind. Anyways I will add those strings. Should I add it for all the available languages? Then what should we do with shortcuts string?

administrator 2022-03-09 21:38

You can just add English and ideally a human localizer would do the correct strings for other languages.

administrator 2022-03-10 11:47

Just to be clear, I want you to use the localization tl() functions, but you only need to provide strings for English.

patelpa 2022-03-12 15:28

I have added strings for English 2 strings for every emoji - 1) Description string which ends with _desc and 2) Shortcut string without _desc at the end. For example emojipicker_helper_football = "football" emojipicker_helper_football_desc = "American football"

Used tl() functions as suggested in above note. tl('emojipicker_helper_football') => ["�",tl('emojipicker_helper_football_desc')]

administrator 2022-03-13 18:33

Applied by 7e21678498b0. Thanks for the updated patch. I applied and modified it. I change the icon on open and close of the picker. I also changed tabs to spaces in the patch.

Best,

Chris

X