I said, “Do you speak-a my language?”, He just smiled and gave me a Vegemite sandwich

Dall-E generated referencing Men At Work’s Business as Usual Album cover

Today’s post pays tribute to that catchy lyric (seen in the title) from Men At Work’s iconic hit Land Down Under. The song follows a traveler experiencing different cultures, emphasizing the universal human connection—whether through sharing a meal, offering hospitality, or simply exchanging a smile, even when language isn’t shared. The song’s theme of communication—or the challenges of understanding one another—got me thinking about how AI is already solving many of the problems traditionally faced in software systems when it comes to multilingual support.

For a long time, software systems were designed with a single language in mind. If a company wanted to support additional languages, the process was often cumbersome—requiring manual translations, hardcoded text updates, and significant development effort. Adding a new language wasn’t just about translating words; it involved restructuring UI layouts, adapting date and currency formats, and ensuring character encoding compatibility. This made localization a lengthy and expensive process, often leaving non-English speakers with limited access to technology.

As I continue to explore Azure AI’s capabilities, I wanted to put its Translation Service to the test—specifically, its ability to detect and translate languages seamlessly. To do this, I decided to enhance my Bayesian Optimized Neural Output (BONO) search by integrating language translation. This would allow it to not only process and rank results intelligently but also make them accessible in multiple languages, breaking down language barriers in search queries and results.

By leveraging Azure AI’s Translator API, my goal was to dynamically detect the input language and provide real-time translations, ensuring that users receive relevant search results in their preferred language without the need for manual intervention.

To start, I decided to build an API dedicated to language detection and translation. This API would act as an intermediary, making calls to Azure’s Translator API while providing flexibility for future enhancements. By decoupling translation from the UI, I ensured that the system could evolve—whether by expanding features or even swapping out the translation provider (from Azure to say AWS)—without requiring changes to the frontend.

Initially, I considered embedding the translation capability directly into the BONO Search API. While this would have worked, a standalone translation API offered greater reusability. It could handle more than just search queries, allowing me to integrate language detection and translation into other projects.

The new API, called the Multilingual Autodetect Wizard (MAW)—a deliberate nod to Men At Work—was designed to seamlessly integrate into the existing architecture. Its role was to handle language detection and translation independently, ensuring that other services, including BONO Search, could leverage multilingual capabilities without being tightly coupled to a specific translation provider.

The Multilingual Autodetect Wizard (MAW) therefore acts as a language processing layer between the user and the BONO Search API, enabling multilingual support. Here’s how it integrates into the system:

1. Search Query Processing via MAW

  • The user submits a search query in any supported language.
  • The query is first sent to MAW for language detection using Azure Translator’s Detect API.

2. Language Detection & Translation (If Needed)

  • If the detected language is English, the query is sent directly to BONO Search API as usual.
  • If the detected language is not English, MAW calls Azure’s Translate API to convert the query into English before forwarding it to BONO Search.

3. Search Execution

  • The BONO Search API processes the English query, returning relevant search results in English.

4. Translating Results Back to the Source Language

  • If the original query was not in English, MAW translates the search results back into the user’s source language using Azure Translator.
  • If the query was already in English, results are returned as-is.

5. Returning the Final Response

  • MAW sends the translated (or original) search results back to the user, providing the results in their preferred language.
Figure 1: BONO Flow Diagram with MAW API (click to view in another tab)

MAW API – Multilingual Autodetect Wizard

After creating the Azure Translator resource, I began setting up the MAW API .The API just provides 2 basic endpoints so altogether not a complex amount of code, but as I went through a few rounds of testing, I realized the need for extensive logging of requests to ensure I had visibility when debugging.

Key Features:

  • Language Detection: Identifies the language of the input text via the Detect API.
  • Text Translation: Converts text into a target language using the Translate API.
  • RESTful Endpoints:
    • POST /api/translator/detect → Detects the language of provided text.
    • POST /api/translator/translate → Translates text into the target language.

Integrating MAW API with the React UI

With a working MAW API, the next step was to integrate it into the React UI. The React project had 3 main components viz. SearchForm.tsx, SearchResults.tsx and Modal.tsx. The main code changes were in the SearchForm.tsx where I started by adding calls to the MAW endpoint for language detection, followed by translation of the search query before passing the translated results to the BONO Search API.

I’ll admit—it was fun seeing the translation of the search phrase work live on the UI for the first time! At first, I considered stopping on just translating the search phrase since I had successfully demonstrated how the system could detect and translate search queries into English. However, I realized it would be far more valuable to dynamically translate the search results as well, ensuring a fully multilingual experience.

However, after adding the code to translate the movie plots returned in the search results, I ran into some unexpected errors on the MAW API when I discovered the free tier of Azure Translator had a request limit, restricting the number of translations I could make.

Handling Translation Limits with AI-Assisted Development

At first, I naturally considered upgrading to a higher Azure tier to increase my quota. At the suggestion of Claude 3.5, which had a view of my codebase and constraints through the Cursor IDE, it quickly generated a retry mechanism for the translation request, which would first detect the limit, pause and retry the request. This change does introduce a pause when the retry mechanism is triggered and unfortunately with a larger result set, reaching the quota limit is unavoidable. However for test purposes, this worked great.

After getting a working version, I realized that the SearchForm.tsx React component was now getting too cluttered with API requests. Instead of manually refactoring, I simply prompted Cursor to extract API calls into separate services.

Updated BONO Search User Interface

I tested the new search UI with the following phrases:

LanguageQueryDetection ResultTranslation
EnglishBoy learns Karate to defend himself from bulliesenNot Applicable
FrenchUn garçon apprend le karaté pour se défendre contre les intimidateursfrQuery from fr to en
Result from en to fr
SpanishNiño aprende Karate para defenderse de los matonesesQuery from es to en
Result from en to es
ZuluU-Boy ufunda i-Karate ukuze azivikele ezihlungwinizuQuery from zu to en
Result from en to zu

The results of each search phrase can be seen in the video clips below:

English Search Phrase: Boy learns Karate to defend himself from bullies
French Search Phrase: Un garçon apprend le karaté pour se défendre contre les intimidateurs
Spanish Search Phrase: Niño aprende Karate para defenderse de los matones
Zulu Search Phrase: U-Boy ufunda i-Karate ukuze azivikele ezihlungwini

Overall results

Altogether the results were impressive. Azure’s AI language service enabled a system written with content from a single language viz. English to support several other languages without alteration. Even with a language like Zulu, spoken only in Southern Africa, Azure’s AI language service could translate the search phrase with relative accuracy into English.

The full code for the Multilingual Autodetect Wizard API can be found here: https://github.com/ShashenMudaly/MultilingualAutodetectWizard

And finally, let’s cue the following track:

Land Down Under was released in 1981 by the Australian band Men at Work as part of their debut album Business as Usual. The song quickly became an international hit, topping charts in multiple countries, including the U.S., U.K., and Australia. Its catchy flute riff and vivid storytelling capture the spirit of adventure, cultural encounters, and national identity. With lyrics that follow a wandering traveler meeting eccentric characters around the world, the song remains an iconic anthem celebrating Australia’s unique charm and global presence.

Original album cover for Business As Usual