Analyzing Challenges in Neural Machine Translation for Software Localization

Sai Koneru, Matthias Huck, Miriam Exel, Jan Niehues

Introduction

Neural Machine Translation (NMT) has revolutionized language processing, yet it consistently falters in the specialized domain of software localization. User interface (UI) strings—such as "Cancel," "Home," or "Login"—are often short, isolated, and highly ambiguous. Without context, a model cannot determine if "Login" should be translated as a verb (e.g., German Anmelden for a button) or a noun (e.g., German Anmeldung for a header).

Standard NMT models operate under the "Locality Assumption," which posits that a single sentence contains sufficient information for its own translation. In software localization, this assumption is frequently violated. Human translators rely on metadata, such as the string's location in the source code or its surrounding menu items, to resolve these ambiguities.

Example of a UI string in Klondike and its corresponding metadata in a .po file.

Methodology

To address the lack of context, this research evaluates "context-aware" NMT models using three distinct metadata-driven approaches:

  1. Domain Tags: A unique identifier for the specific software project (e.g., <KLONDIKE>) is prepended to every string, allowing the model to learn project-specific terminology and style.
  2. Neighbours (Doc-NMT): The strings immediately preceding and following the target text in the translation file are included. This provides a textual "neighborhood" that mimics the structure of the UI.
  3. Source Reference: The source code file path (e.g., src/ui/menu.c) is provided as a prefix, offering a functional hint about the string's role (e.g., menu item vs. dialog text).

The models were tested in two scenarios: Intra-application (updating known apps) and Cross-application (translating entirely new software).

Dataset Overview

The study introduces the Multilingual UI Corpus, a significant new resource comprising approximately 1.3 million English-German sentence pairs. These were extracted from public GitHub repositories using .po (Portable Object) files, which naturally preserve the metadata required for context-aware training. Smaller datasets were also compiled for Japanese, Spanish, and Hindi.

Additionally, the authors developed a Targeted Disambiguation Test Set. This hand-curated "challenge set" contains 95 entries where identical source words (e.g., "Volume") require different translations based on their specific context (e.g., disk storage vs. audio levels).

Results and Discussion

The inclusion of metadata proved to be a powerful proxy for visual context. The models demonstrated a significant ability to "memorize" the specific requirements of known applications.

Disambiguation Performance

The most striking improvements were observed in the targeted disambiguation tasks. A standard NMT model, lacking any context, achieved only 21.05% accuracy. However, by incorporating a simple Domain Tag, accuracy nearly doubled to 41.03%.

Accuracy improvements in word disambiguation using different context types.

The Generalization Gap

While context-aware models excel in Intra-application scenarios—improving BLEU scores from 49.03 to 51.09 with "Source Reference" metadata—they struggle to generalize these lessons to Cross-application tasks. On new software, improvements were marginal, suggesting that current models learn specific project associations rather than a generalized logic of UI layouts.

Furthermore, the models showed high sensitivity to "false context." When provided with incorrect metadata, performance dropped significantly, indicating that the models actively rely on these cues rather than ignoring them.

Conclusion

While metadata-enriched NMT significantly improves software localization, a "generalization wall" remains. Current models can effectively memorize the quirks of specific projects but lack the reasoning capabilities to infer context for unfamiliar applications. Future research should explore the integration of actual visual data, such as screenshots or UI element types, and expand testing to morphologically diverse languages to build truly robust localization systems.

Summary updated

BibTeX
@inproceedings{koneru2023analyzing,
  author = {Sai Koneru and Matthias Huck and Miriam Exel and Jan Niehues},
  title = {{Analyzing Challenges in Neural Machine Translation for Software Localization}},
  booktitle = {EACL},
  year = {2023},
  doi = {10.18653/v1/2023.eacl-main.179},
}
Figure