Skip to content

feat: add Turkish localization support#13762

Open
enscskn wants to merge 1 commit into
langflow-ai:mainfrom
enscskn:feat/turkish-locale
Open

feat: add Turkish localization support#13762
enscskn wants to merge 1 commit into
langflow-ai:mainfrom
enscskn:feat/turkish-locale

Conversation

@enscskn

@enscskn enscskn commented Jun 20, 2026

Copy link
Copy Markdown

Summary

Adds Turkish localization support to the Langflow frontend.

Changes

  • Added tr.json locale bundle using the same flat dot-key format as the existing locale files
  • Registered tr in i18n supported languages
  • Added Turkish to the language selector
  • Added tests for Turkish bundle loading, locale key parity, and interpolation placeholder parity

Verification

  • npm test -- i18n.test.ts --runInBand
  • npx @biomejs/biome check src/i18n.ts src/constants/languages.ts src/__tests__/i18n.test.ts src/locales/tr.json
  • Verified tr.json has the same 2062 keys and matching interpolation placeholders as en.json
  • Verified tr.json has zero non-whitespace control/format characters

Copilot AI review requested due to automatic review settings June 20, 2026 21:54
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Turkish ("tr") is added as a supported language by inserting an entry in the SUPPORTED_LANGUAGES constant, adding "tr" to the i18n normalizer's accepted codes, and adding a Jest test that verifies loadLanguage("tr") registers the bundle and resolves settings.languageTitle to "Dil".

Changes

Turkish Language Support

Layer / File(s) Summary
Turkish language constant, i18n normalizer, and test
src/frontend/src/constants/languages.ts, src/frontend/src/i18n.ts, src/frontend/src/__tests__/i18n.test.ts
Adds { code: "tr", label: "Türkçe" } to SUPPORTED_LANGUAGES, adds "tr" to the i18n normalizer's accepted set, and adds a test asserting the bundle registers and settings.languageTitle resolves to "Dil".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Quality And Coverage ⚠️ Warning The test is a minimal smoke test covering only 0.05% of the Turkish locale (1 of 2062 keys). It validates bundle registration and a single translation key but fails to test the PR's stated constrai... Add tests validating: (1) Turkish locale has all 2062 keys matching English, (2) sample keys with interpolation placeholders (e.g., errors.fileTooLarge), (3) missing key fallback behavior. The test validates functionality but not the cor...
✅ Passed checks (8 passed)
Check name Status Explanation
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.
Test Coverage For New Implementations ✅ Passed PR includes appropriate test coverage for Turkish language feature: new test case in i18n.test.ts verifies locale loading, bundle registration, and translation retrieval with proper naming conventi...
Test File Naming And Structure ✅ Passed Test file follows correct frontend testing patterns: *.test.ts naming, Jest structure with describe/it blocks, descriptive test names, proper setup/teardown via beforeEach, and coverage of both pos...
Excessive Mock Usage Warning ✅ Passed New Turkish test avoids mocks entirely, testing real i18n behavior. Existing tests use spies appropriately for external dependencies. No excessive mocking detected.
Title check ✅ Passed The title 'feat: add Turkish localization support' clearly and accurately summarizes the main change of adding Turkish language support across the codebase.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Turkish (tr) localization support to the Langflow frontend by introducing a new Turkish locale bundle and wiring it into the existing lazy-loaded language selection/i18n flow.

Changes:

  • Added a Turkish translation resource file (tr.json).
  • Registered "tr" as a supported language in the i18n loader and UI language selector list.
  • Extended i18n unit tests to validate that the Turkish bundle can be loaded.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/frontend/src/locales/tr.json Adds Turkish translation strings as a new locale bundle.
src/frontend/src/i18n.ts Adds "tr" to the supported language list used by normalization and lazy-loading.
src/frontend/src/constants/languages.ts Adds Turkish to the language selector options (Türkçe).
src/frontend/src/__tests__/i18n.test.ts Adds a test to ensure the Turkish bundle is registered when loaded.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/frontend/src/__tests__/i18n.test.ts
Comment thread src/frontend/src/locales/tr.json Outdated
Langflow already supports lazy-loaded locale bundles, so this adds a Turkish resource file and registers it with the existing language selector flow. The locale follows the same flat dot-key format as the existing bundles and the tests now guard key and interpolation placeholder parity with English.

Constraint: Locale files must preserve the en.json key map and interpolation placeholders
Rejected: Replace existing language loading flow | the current lazy-loading path already supports new locale bundles
Confidence: medium
Scope-risk: narrow
Tested: npm test -- i18n.test.ts --runInBand
Tested: npx @biomejs/biome check src/i18n.ts src/constants/languages.ts src/__tests__/i18n.test.ts src/locales/tr.json
Tested: tr.json has 2062 keys, zero missing/extra keys, zero placeholder mismatches, and zero non-whitespace control/format characters
Not-tested: Full visual review of every translated UI string
@enscskn enscskn force-pushed the feat/turkish-locale branch from 9b57be3 to a7fb772 Compare June 21, 2026 12:36
@enscskn enscskn changed the title Make Langflow usable for Turkish-speaking users feat: add Turkish localization support Jun 21, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants