Skip to content

A tooltip nobody could translate, in two places - #778

Merged
sridharkalaibala merged 1 commit into
developfrom
fix/a-tooltip-nobody-could-translate
Sep 15, 2026
Merged

sridharkalaibala merged 1 commit into
developfrom
fix/a-tooltip-nobody-could-translate

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

The coverage tool has been reporting one key the interface uses and English cannot answer. Chasing it found the reason, and the reason is worse than the key.

Bootstrap does not show title

On init it moves the title into data-original-title and empties the real attribute, and markup that sets data-original-title itself wins outright. apply() translated title:

els[e].setAttribute(attrs[a], value);

So on a tooltip element that changed an attribute nothing displays, and the tooltip went on saying the English in every language. It rendered perfectly, which is why it survived. Same shape as the requests dock, where a local t() helper hid fourteen words from the scanner: a translation that silently does nothing looks exactly like one that works.

Two elements were in that state:

modules/items_write.html    lang_ai_describe_hint                         english: MISSING
modules/sales_write.html    lang_walk_in_customer_click_to_choose_or_add  english: yes

The other 218 data-t-title elements carry a plain title and were always fine, so this is a narrow bug rather than a class-wide one. Worth saying, since the first thing I did was assume otherwise.

And the collector could not see them either

i18n-coverage.js reads the English out of title, falling back to data-title for select2. Neither exists on a Bootstrap tooltip, so lang_ai_describe_hint was collected as used and never given any English to translate - which is exactly the key the tool has been reporting. One extra fallback and --write-english picked it up immediately:

+  "lang_ai_describe_hint": "Draft a description from the item's own details",

English now answers 3,370 of 3,370 keys for the first time.

What changed

  • apply() also writes data-original-title when the element has one, keeping the English under data-en-original-title; restore() puts it back. title is still set too, because an element can be hovered before Bootstrap has initialised it and the browser's own tooltip reads that one.
  • The collector looks in data-original-title for a title key.
  • lang_ai_describe_hint added to English and translated into all 17 packs.

Checks

  • 2 new tests, both proven failing on the parent commit ("the attribute the tooltip reads was left in English")
  • Root suite 2,562 of 2,565; the three remaining need frontend/public built, which CI does

Bootstrap does not show `title`. On init it moves the title into
data-original-title and empties the real attribute, and markup that sets
data-original-title itself wins outright. So data-t-title on one of those
elements changed an attribute nothing displays, and the tooltip went on
saying the English in every language.

It rendered perfectly, which is why it survived. Same shape as the
requests dock, where a local t() helper hid fourteen words from the
scanner: a translation that silently does nothing looks exactly like one
that works.

Two elements were in that state, and the collector could not see either.
It reads the English out of `title`, which these do not carry, so
lang_ai_describe_hint was counted as used and never given any English to
translate - the one key the tool has been reporting as unanswered.

apply() now also writes the attribute the tooltip reads, restore() puts
it back, the collector looks in data-original-title, and the missing
words are in all seventeen packs. English answers 3,370 of 3,370 keys for
the first time.

218 other data-t-title elements carry a plain title and were always fine.
@sridharkalaibala
sridharkalaibala merged commit 37e8809 into develop Sep 15, 2026
10 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant