Skip to content

Update list of supported languages#105

Merged
terales merged 1 commit into
mainfrom
develop
Jun 16, 2026
Merged

Update list of supported languages#105
terales merged 1 commit into
mainfrom
develop

Conversation

@terales

@terales terales commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Update list of supported languages

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

TargetLanguages in LanguageConstants.cs is reorganized and significantly expanded, adding many new language codes and regional variants (e.g., DE-CH, EN-GB, EN-US, FR-CA, PT-BR, PT-PT) extending through ZU. The project version is bumped from 1.2.41 to 1.2.42.

Changes

TargetLanguages Expansion and Version Bump

Layer / File(s) Summary
TargetLanguages dictionary expansion and version bump
Apps.DeepL/Constants/LanguageConstants.cs, Apps.DeepL/Apps.DeepL.csproj
The TargetLanguages dictionary is reorganized and extended with many additional language codes and regional variants (DE-CH, EN-GB, EN-US, FR-CA, PT-BR, PT-PT, through ZU), replacing and reordering prior entries. The project version is incremented to 1.2.42.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update list of supported languages' directly and accurately describes the main change in the changeset, which updates LanguageConstants.TargetLanguages with an expanded list of language codes and regional variants.
Description check ✅ Passed The description 'Update list of supported languages' is related to the changeset, as the PR does update the supported languages in the LanguageConstants file, though it lacks detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Apps.DeepL/Constants/LanguageConstants.cs (1)

13-129: ⚠️ Potential issue | 🔴 Critical

Verify all added language codes against current DeepL API support before merge.

This PR adds ~84 language codes to the hardcoded TargetLanguages dictionary, which is used to validate user input before calling the DeepL client. Any unsupported codes will cause runtime failures when users attempt translation.

Current status: The example codes you mentioned (ACE, AF, YUE) are confirmed supported by DeepL, and the regional variants (EN-GB, EN-US, PT-BR, PT-PT, etc.) are valid language code formats.

However: The definitive way to verify all 84 codes is to cross-check them against the DeepL API's /v3/languages endpoint with resource=translate_text. Since the DeepL.net SDK does not provide a static list of all supported languages (the API itself is the authoritative source), manual verification of the full list is necessary to ensure no unsupported codes are included in this dictionary.

Recommend running through the live API endpoint or consulting the official DeepL supported languages list before this PR is merged to prevent user-facing failures on unsupported language selections.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Apps.DeepL/Constants/LanguageConstants.cs` around lines 13 - 129, Verify all
language codes being added to the TargetLanguages dictionary in
LanguageConstants.cs against the DeepL API's authoritative source by querying
the /v3/languages endpoint with resource=translate_text parameter. Cross-check
each of the ~84 codes in the dictionary against the API response to ensure they
are all currently supported; remove or correct any codes that the API does not
recognize as valid translation targets, as unsupported codes will cause runtime
failures when users attempt translations.
🧹 Nitpick comments (1)
Apps.DeepL/Constants/LanguageConstants.cs (1)

7-129: 💤 Low value

Consider updating README.md to reflect the expanded language support.

This PR significantly expands the supported target languages from ~20 to over 100 languages. Users may benefit from documentation that lists or describes the newly supported languages, especially if this is a major feature update.

Per the coding guidelines, check whether the README.md reflects this change.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Apps.DeepL/Constants/LanguageConstants.cs` around lines 7 - 129, The
LanguageConstants.cs file now defines significantly more supported languages
(over 100 language entries in the dictionary) compared to the previous
implementation. Update the README.md documentation to reflect this expanded
language support. Add or revise the section that describes supported languages
to list the newly added languages or provide a comprehensive overview of the
language coverage, ensuring the documentation accurately represents what is now
available in the LanguageConstants dictionary.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Apps.DeepL/Constants/LanguageConstants.cs`:
- Line 13: Before adding base language codes like EN, PT, and ZH to the
LanguageConstants, you must clarify the intended use case and API behavior.
Determine whether the primary use case is translation (where DeepL API accepts
but may default to undocumented variants) or glossary configuration (where base
codes are required for setup). If the use case is translation, decide whether
the plugin should restrict users to explicit variant codes to prevent
unpredictable regional defaults. If glossaries, document that base codes are
setup-only while variants apply the glossary. Once these architectural questions
are resolved, update the code and any related UI/documentation accordingly to
ensure users understand which codes apply to which operations and what behavior
to expect when selecting a base code.

---

Outside diff comments:
In `@Apps.DeepL/Constants/LanguageConstants.cs`:
- Around line 13-129: Verify all language codes being added to the
TargetLanguages dictionary in LanguageConstants.cs against the DeepL API's
authoritative source by querying the /v3/languages endpoint with
resource=translate_text parameter. Cross-check each of the ~84 codes in the
dictionary against the API response to ensure they are all currently supported;
remove or correct any codes that the API does not recognize as valid translation
targets, as unsupported codes will cause runtime failures when users attempt
translations.

---

Nitpick comments:
In `@Apps.DeepL/Constants/LanguageConstants.cs`:
- Around line 7-129: The LanguageConstants.cs file now defines significantly
more supported languages (over 100 language entries in the dictionary) compared
to the previous implementation. Update the README.md documentation to reflect
this expanded language support. Add or revise the section that describes
supported languages to list the newly added languages or provide a comprehensive
overview of the language coverage, ensuring the documentation accurately
represents what is now available in the LanguageConstants dictionary.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 74d2aaf8-d9f1-4b08-b5f4-f15b00147ff1

📥 Commits

Reviewing files that changed from the base of the PR and between fd4732d and 1d5fc7f.

📒 Files selected for processing (2)
  • Apps.DeepL/Apps.DeepL.csproj
  • Apps.DeepL/Constants/LanguageConstants.cs

{ "EL", "Greek" },
{ "EN-GB", "English (British)" },
{ "EN-US", "English (American)" },
{ "EN", "English" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does the DeepL API accept base language codes like "EN", "PT", or "ZH" without regional specifiers, or does it require explicit regional variants like "EN-US" or "PT-BR"?

💡 Result:

The DeepL API accepts base language codes for many languages, but for languages that have multiple regional or script-based variants (specifically English, Portuguese, and Chinese), it often requires or strongly encourages the use of explicit variant codes [1][2]. Key details regarding language code usage: - Supported Formats: DeepL API language codes follow BCP 47 [3][4]. The API is case-insensitive, accepting uppercase, lowercase, or mixed-case codes (e.g., 'pt-BR', 'PT-BR', or 'pt-br' are all valid) [5][1][6]. - Regional/Script Variants: For languages like English (EN), Portuguese (PT), and Chinese (ZH), the API often requires you to specify a variant to ensure the correct output, such as EN-US or EN-GB, PT-BR or PT-PT, and ZH-HANS or ZH-HANT [1][2]. When translating into these languages, if you omit the variant, the API may default to a specific regional variant, but it is best practice to explicitly define the desired variant [1]. - Source vs. Target Usage: Regional variants are generally intended for use in the target_lang parameter [1]. Using a variant code in the source_lang parameter may cause an error [1]. - Customizations: When creating customizations such as glossaries, you must use the root language code (e.g., PT, ZH) rather than a variant code (e.g., PT-BR, ZH-HANS) [7]. Once created with the root code, the glossary can then be applied to translation requests using any of that language's supported variants [7]. - Backward Compatibility: In some cases, DeepL maintains support for original root codes even after introducing specific variants to ensure backward compatibility for existing integrations [4]. However, for new development, you should consult the /v3/languages endpoint to identify the officially supported codes for your specific use case [3][2].

Citations:


Clarify which DeepL API operations support base language codes without variants.

The PR adds base codes EN (English), PT (Portuguese), and ZH (Chinese) alongside regional variants. DeepL API behavior differs depending on context:

  • For translation (target language): The API accepts base codes but may default to an undocumented variant if one is not specified. Best practice requires explicit variant codes (e.g., EN-US, PT-BR, ZH-HANS).
  • For customizations like glossaries: The API requires root codes (e.g., PT, ZH) but then supports any variant of that language.

Before adding base codes to the UI, clarify:

  1. What is the primary use case — translation or glossary configuration?
  2. If translation, should the plugin restrict selection to explicit variants to avoid unexpected behavior?
  3. If glossaries, document that base codes are for setup only and variants apply the glossary.

Without this clarity, users selecting "EN" may receive an unpredictable regional variant.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Apps.DeepL/Constants/LanguageConstants.cs` at line 13, Before adding base
language codes like EN, PT, and ZH to the LanguageConstants, you must clarify
the intended use case and API behavior. Determine whether the primary use case
is translation (where DeepL API accepts but may default to undocumented
variants) or glossary configuration (where base codes are required for setup).
If the use case is translation, decide whether the plugin should restrict users
to explicit variant codes to prevent unpredictable regional defaults. If
glossaries, document that base codes are setup-only while variants apply the
glossary. Once these architectural questions are resolved, update the code and
any related UI/documentation accordingly to ensure users understand which codes
apply to which operations and what behavior to expect when selecting a base
code.

@terales terales merged commit c57986f into main Jun 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant