We added an optional language switch to customer sites. It is Google’s Translate widget behind one site setting. The hard part was deciding where it was allowed to run.

What the widget does to a page

The feature was small on paper. A site owner turns on a “Visitor language selector” and picks which languages to offer. A visitor gets a small dropdown that swaps the page into their language on the fly. The widget rewrites the rendered text in place, so it translates whatever it can see, including team names and event descriptions the owner typed themselves.

That is the point of the feature, and it is also the risk. The widget has no idea which text is public content and which control belongs to the owner. So the boundary had to be ours.

Where the boundary went

Three decisions did most of the work:

  • The setting is off by default and lives under Advanced Settings, International. Nothing changes on a site until its owner flips it.
  • The selector renders on visitor pages only. Admin pages run under a different zone in the code, and the check returns early for anything that is not the visitor zone, so the owner’s own dashboard never loads the widget.
  • The list of languages is a fixed set of 22 codes. The save handler filters against it on write, and the page filters against it again at render time, because the list ends up inside an inline script and a stored value is not something to trust there.

Saving any of those settings also clears the page cache in the same request, so a toggle takes effect on the next visitor view instead of racing a cached page.

The layout guess that did not survive the demo

The first version pinned the dropdown to the top right with absolute positioning. In the demo it came out as a full-width bar under the nav. The container around it had no positioned ancestor, so the browser measured against the whole page. Making that container relative would have touched a template used on every visitor page, ads included. So the selector stayed a normal-flow row under the nav, right-aligned and small, the lowest-risk spot in the template for a control that has to be on every page.

What happened before it shipped

The design went through Manus and Codex as two independent reviewers, then a separate verification pass that checked the finished behavior against the design instead of against the code. The widget was then run end to end on a look-alike copy of a real site, not a real customer’s. The hotfix landed on a review branch with dev notes and a summary on the ticket, and stopped there for a human to sign off before anything reached production.