Skip to content

Multilingual Problem Translation and Simplified Problem Statements #1024

Description

@BhadaneAaditya

🚀 Feature Proposal

Add an optional multilingual problem translation and simplification feature that allows users to translate LeetCode problem statements from English into other languages and optionally simplify complex wording for easier understanding.

The feature should preserve the technical meaning and structure of the original problem, including:

Code blocks and inline code
Variable and function names
Mathematical expressions
Constraints
Input/output examples
Markdown formatting
Technical programming terminology

For example:

English

Hindi / Marathi / Spanish / etc.

Users could also have an option such as:

Translate Problem
Simplify Problem
Show Original

The translation provider should remain implementation-agnostic initially, allowing the project to evaluate suitable translation APIs or models rather than being tied to a single provider.

Motivation

LeetCode is widely used by developers and students around the world, but understanding complex English problem statements can be an additional barrier for non-native English speakers.

The difficulty of a coding problem should primarily come from understanding and solving the algorithmic problem, rather than from struggling with the language used to describe it.

A multilingual option could make problem-solving more accessible to users who are more comfortable learning in their native language while still keeping the original English version available for reference.

This could also be useful for learners who understand programming concepts but find technical English difficult to interpret.

A coding-aware translation system would be preferable to generic webpage translation because programming problems contain mixed natural language, code, mathematical notation, constraints, and technical terminology. Code and identifiers must remain unchanged during translation.

The feature could eventually support languages such as Hindi, Marathi, Spanish, Portuguese, Tamil, Telugu, Bengali, Chinese, Japanese, and others.

Contribution

I would like to contribute an initial MVP if this feature is considered within the scope of the project.

The proposed first implementation would be intentionally small:

Add a Translate Problem Description command.
Allow the user to select a target language.
Translate only the natural-language portions of the problem.
Preserve code blocks, variables, mathematical expressions, constraints, examples, and Markdown.
Provide an easy way to switch between the original and translated versions.
Add appropriate error handling for translation failures.
Keep the translation provider behind an abstraction so the implementation is not tightly coupled to a single service.
Add tests to verify that code blocks, placeholders, numbers, and formatting remain unchanged.
Document the feature and its configuration.

A possible future extension could add Simplify Problem Description, allowing users to understand a difficult problem in simpler English or their selected language.

I would prefer to discuss the architecture and preferred translation provider with the maintainers before implementing the full feature, and I am happy to start with a small prototype/PR based on the project's existing architecture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions