BlogNational Black Canadians Summit

Passing a locale into an embedded ticket widget

Jean Pierre Georges

A bilingual page can wrap a tool that speaks one language. The page has to tell the tool which language to use, and it has to do that before the tool’s script loads.

What the visitor saw

Registration on the National Black Canadians Summit site stayed in Bizzabo. In August, switching the site to French still loaded the widget without the French language parameter. The button stayed “Order now” instead of “Commandez maintenant.”

The page around the widget was already in French. The header, the travel details, and the language switch had done their job. The button the visitor came to press had not. A bilingual page and a one-language embed can sit on the same screen.

Set the language before the script

The widget now receives ?lang=en or ?lang=fr-ca before Bizzabo’s script loads. The ticket page reads the locale and sets that parameter first. If the script starts without it, the widget chooses its own language and the page cannot talk it back.

fr and fr-CA are different requests. The Summit’s French pages live under /fr. The ticket platform asks for a region, and that region is fr-CA. The path and the parameter each use the code that system expects. Writing both down is what keeps the page and the widget in the same French.

Clear it when the language changes

Passing the parameter once is enough for the first load. A visitor who switches language is still on the page, and the widget is already running. The iframe keeps the previous language unless it is cleared.

The widget remounts when the visitor changes language. The ticket page reads the new locale, sets the Bizzabo language before the script runs again, and clears the widget so the iframe cannot keep “Order now” on a French page, or “Commandez maintenant” on an English one.

The page around the button

English shows “Order now.” French shows “Commandez maintenant.” The Summit page around the widget keeps the header, the travel details, and the youth, gala, and access paths. That surrounding page is keeping registration inside the event site. The locale parameter is what makes the button belong to that page.

The live registration page is blackcanadiansummit.ca/en/ticket. The French page is the same route under /fr/ticket. The widget on each one has to be told which of those pages it is sitting in.