morethanwords/tweb/master • d3bf83c • 1 files, +21/-6 Fix day period rendering for locales that don'

Telegram github commits and releases

Telegram github commits and releases

@tgappsupdates

Broadcast from the most important Telegram clients' repositories

4,538 subscribers
Open in Telegram
morethanwords/tweb/masterd3bf83c1 files, +21/-6
Fix day period rendering for locales that don't put it last

updateAmPm() obtained the AM/PM string by splitting the formatted time on
whitespace and taking index 1. That assumes the "12:00 AM" shape, which only
holds for locales placing the day period last, separated by a space.

Locales that place it first render "undefined", because the split yields a
single element (zh 上午12:34, ja 午後12:34 — no separator at all), or repeat
the time, because index 1 lands on the time itself (ko 오전 12:34, tr ÖÖ 12:34).
Locales whose day period contains a space get truncated (es/ca "12:34 p. m."
turns into "12:34 p.").

Read the dayPeriod part by type via formatToParts() instead, and remember
whether it comes first and which separator Intl uses, so the time is assembled
in the locale's own order.

Verified across 26 locales: the 6 broken ones now match Intl's native output,
the remaining 20 are byte-identical to before.

morethanwords/tweb/masterdae12939 files, +14/-7
Split the quote icon into quote and blockquote

The markup tooltip's quote button drew the block-quote mark - a vertical bar
with indented lines - which is what the formatting does, but not what the
button means next to bold/italic/spoiler. Give it a real pair of quotation
marks and keep the old glyph under its own name for the places that render
the quote block itself.

- assets/icons/quote.svg is now the quotation marks; its previous path moves
verbatim to assets/icons/blockquote.svg
- regenerated the tgico font (blockquote = eb7e, cache-buster akge1f)
- markupTooltip drops the ['quote', 'quote', 'quote_filled'] triple: the new
glyph has no filled variant, so the button no longer swaps icon when active

blockquote has no callers yet - it is meant for the rendered quote block
(see the commented-out --quote-icon in index.ts and Icon('quote_filled',
'quote-icon') in wrapRichText.ts), which stays as it is for now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

#webk
Open post in Telegram