Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make emojis work as placeables #458

Closed
iafan opened this issue Apr 3, 2020 · 3 comments
Closed

Make emojis work as placeables #458

iafan opened this issue Apr 3, 2020 · 3 comments
Assignees

Comments

@iafan
Copy link
Contributor

iafan commented Apr 3, 2020

With the increasing use of emojis in translation, a nice usability improvement would be to make all emojis act like placeables (i.e. clickable entities in source text).

Example: https://translate.evernote.com/ru/android_evernote/translate/strings.xml.po#unit=1254182
(here, in source text, tags <i> and </i> are highlighted and can be placed into the translation field at current caret position with a single click).

Relevant code: https://github.com/evernote/zing/blob/8157b44d7a46cf4bdc230a22ec83fa24ce56bcdc/pootle/static/js/utils.js#L116-L138

Relevant discussion on matching emojis with regular expressions in JavaScript:
https://stackoverflow.com/questions/22006218/replace-emoji-unicode-symbol-using-regexp-in-javascript

@benjamimo1
Copy link

benjamimo1 commented Apr 6, 2020

Hello @iafan ! I'm trying to get into this request and noticed that when clicking the placeable in the example you provided; white-font text is added to the text-field instead of text in a readable color. Is this the expected behavior or a bug?
(In the example provided I clicked several times on the placeable ,"<i>)
image
Should the format of the placeable clicked be kept when inserted?
I'll start trying to replicate a similar behavior for emojis as requested.

@iafan
Copy link
Contributor Author

iafan commented Apr 6, 2020

@benjamimo1 Since the field is grayed out, this means that you are in read-only mode, and placeables should not be inserted at all. So looks like a separate bug, good catch! I filed #460

The white text seems like a styling issue. Not sure why it's white for you; it's supposed to be gray:
Screen Shot 2020-04-05 at 18 08 11
Can you experiment in different browsers and see if it's different there?

When you have editing permissions, the text area will have a black text on white background.

@julen
Copy link
Contributor

julen commented Apr 6, 2020

The styling issue for a disabled textarea is a problem in Safari, will fix that now.

julen added a commit that referenced this issue Apr 6, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 4, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 4, 2020
@benjamimo1 benjamimo1 self-assigned this May 5, 2020
@iafan iafan closed this as completed in b487a39 May 7, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 12, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 12, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 14, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 14, 2020
Improved comments on regex

Got comments mixed up. Fixed

Fix serge-community#458: make emojis work as placeables.

Fix serge-community#458: make emojis work as placeables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants