Skip to content

The placeholder of datetime inputs keeps being localized when spoof English is on

cc @pierov

note

  • this is on my windows 11 machine, with a DPR of 1 (and at 100% default zoom of course). Measurements will most likely differ on other platforms due to fonts used, default sizes etc and also subpixels will come into play most likely due to me using clientRect to measure
  • all date picker chars as per best of my ability (can't exactly copy paste them), not that it really matters
  • bugzillas
    • FF68: 1492587 ensure datepicker does not leak with spoof english

STR

  • test: https://arkenfox.github.io/TZP/tests/applang.html
  • get yourself a control hash/value(s)
    • with en-US (no spoofing) get element widths
    • for you, you only need worry about the date width
  • change app locale to ar,fa, he, ka, or th
    • restart to apply
    • turn on spoof english
    • test: compare control vs now

the good (I think)

  • w/out spoof english
    • these all have the date input with a width 116.33332824707031 (matches english)
    • either we lucked out with them being monospace and/or the delimiters/chars have the same width and/or the old patch is doing something and/or the formatting just happens to be the same
  • w/ spoof english
    • all return the en-US hash
      • so all the text on buttons etc works
    • all retain the app language characters
    • all change format to mm then dd then yyyy (to use the english notation)
      • e.g id changes from w/out spoof [hh / bb / tttt X] to spoofed [bb / hh / tttt X]
      • which doesn't exactly match en-US's d then m then y
      • but irrelevant given we cannot read this property and need to patch this
    • however, if any of these were to change, or a glyph wasn't supported etc we're in trouble (see bad)

en-US

7a6b31db [0 ms]
{
  "button": 12,
  "date": 116.33332824707031,
  "file": 233,
  "reset": 46,
  "submit": 92,
  "time": 82
}
    ca   a8f961bd   [dd / mm / aaaa X]
    da   bb348144   [dd . mm . åååå X]
    de   24d32ef4   [TT . MM . JJJJ X]
 el-GR   19cf59e3   [ηη / μμ / εεεε X]
 en-US   7a6b31db   [dd / mm / yyyy X]
 es-ES   d8a32894   [dd / mm / aaaa X]
 fi-FI   d439631a   [pp . kk . vvvv X]
    fr   9019774e   [jj / mm / aaaa X]
 ga-IE   2117aab0   [ll / mm / bbbb X]
    id   1b078cee   [hh / bb / tttt X]
    is   b602a355   [dd . mm . yyyy X]
 it-IT   f46aeba3   [gg / mm / aaaa X]
    ja   9a8237d5   [yyyy / mm / dd X]
    lt   625731d5   [yyyy - mm - dd X]
 mk-MK   fb9f6379   [дд . мм . гггг X]
    ms   05b516ac   [hh / mm / tttt X]
    my   92c0ce3b   [dd / mm / yyyy X]
 nb-NO   d408d074   [dd . mm . yyyy X]
    nl   c96c2258   [dd - mm - jjjj X]
    pl   f56fa7e2   [dd . mm . rrrr X]
 pt-BR   ffeb8972   [dd / mm / aaaa X]
 ro-RO   68082213   [zz . mm . aaaa X]
 ru-RU   ec7f255b   [дд . мм . гггг X]
    sq   bb9b8600   [dd . mm . yyyy X]
 sv-SE   227b6bbb   [åååå - mm - dd X]
 tr-TR   52624cdd   [gg . aa . yyyy X]
 uk-UA   2bb88114   [дд . мм . pppp X]
 vi-VN   afd1dc4a   [dd / mm / yyyy X]
 zh-CN   24433a2f   [yyyy / mm / dd X]
 zh-TW   244341b1   [yyyy / mm / dd X]

the ugly

  • w/ spoof english
    • see note above re "all change format to mm then dd then yyyy (to use the english notation)"
    • this causes the extra spaces, dot to get removed and they end up matching en-US
      • e.g. hu changes from [éééé . hh . nn . X] to [hh / nn / éééé X]
			  w/o spoof   date-width           datepicker

    cs   16654fd8   130.3333282470703  = [dd . mm . rrrr X] <- an extra space I think
 hu-HU   dd5a84d5   137.3333282470703  = [éééé . hh . nn . X] <- extra dot
 ko-KR   bd60dd13   137.3333282470703  = [yyyy . mm . dd . X] <- extra dot, same as hu-HU

the bad

  • w/o spoof english
    • the date picker is a different width because different chars/delimeters/formatting etc is used
  • w/ spoof english
    • they all retain their app language chars/formatting etc, and thus leak
    • the only element that doesn't match en-US is the date picker which stays as per non-spoofed width
			  w/o spoof   w/ spoof    date-width          datepicker

    ar   c7c70335   7be2b435    115.78334045410156 = [X arabic]
 fa-IR   242fe7af   86afa474    111.81666564941406 = [x persian]
    he   e33d000f   63a6e0d9    140.3333282470703  = [X hebrew]
 ka-GE   1d8ea655   728ae375    137.5              = [რრ . თთ . ნნნნ X]
    th   e03a50ae   afe7de74    120.33332824707031 = [วว / ดด / ปปปป X]
Edited by Thorin
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information