Closed Bug 1563457 Opened 5 months ago Closed 3 months ago

[Translate.Next] Cursor in Fluent editor is completely off with scripts w/out monospace font

Categories

(Webtools :: Pontoon, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flod, Assigned: mathjazz)

Details

Attachments

(3 files)

Yeah, this is a known deficiency of all html code editors I know of. The cursor is done on a different layer, and assumes a monospace font. If your script doesn't have one, you're toast.

Maybe we can help with fonts, though. https://www.google.com/get/noto/#sans-guru maybe?

Summary: [Translate.Next] Cursor in Fluent editor is completely off with larger characters → [Translate.Next] Cursor in Fluent editor is completely off with scripts w/out monospace font

I tried to reproduce the problem with the same string in Codepen and GitHub, and failed.

It turns out they both use CodeMirror as their editor, which AFAICT handles cursor position fine even if non-monospace font is used.

Priority: -- → P3
Blocks: 1543345

Looks like Noto Sans Gurmukhi isn't a monospaced font:
https://github.com/mozilla/pontoon/pull/1380

For reference, this is a list of all scripts currently used by locales on pontoon.mozilla.org with a sample locale:

Tamil: ta
Latin: ace
Korean: ko
Traditional Chinese: zh-HK
Cyrillic: ab
Japanese: ja
Arabic: ar
Thaana: dv
Odia: or
Gujarati: gu-IN
Armenian: hy-AM
Ethiopic: am
Thai: th
Tfng: zgh
Greek: el
Georgian: ka
Myanmar: my
Tibetan: bo
Simplified Chinese: zh-CN
Hebrew: he
Bengali: as
Gurmukhi: pa-IN
Khmer: km
Malayalam: ml
Telugu: te
Lao: lo
Kannada: kn
Devanagari: anp
Sinhalese: si

I've confirmed Latin, Hebrew, Arabic, Greek and Cyrillic work fine.

No longer blocks: 1543345

I've tried the following font with with Gurmukhi (pa-IN) script:
http://www.billie.grosse.is-a-geek.com/resources-03.html?s=punj#punj

The picture shows the result. There are two problems:

  1. It doesn't fix the bug (mind the cursor position).
  2. It actually makes things worse (the Message ID should stay in Latin).
Assignee: nobody → m
Status: NEW → ASSIGNED

I've analyzed the scripts listed in comment 4. I was able to reproduce the bug with the following scripts:

Tamil: ta
Odia: or
Gurmukhi: pa-IN
Gujarati: gu-IN
Armenian: hy-AM
Thai: th
Myanmar: my
Bengali: as
Khmer: km
Malayalam: ml
Telugu: te
Lao: lo
Kannada: kn
Devanagari: anp
Sinhalese: si
Ethiopic: am
Thaana: dv
Tfng: zgh
Tibetan: bo

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.