Feature/turkish language support#841
Open
muminkoykiran wants to merge 3 commits into
Open
Conversation
- Create locales folder with translation system (en.ts, tr.ts, index.ts) - Add t() function for string translation with interpolation support - Implement language selector component with persistence - Update header menu, editor, device cards, and dialogs to use translations - Support automatic language detection from browser settings - Language preference stored in localStorage
Updated all Turkish translations to use proper Turkish special characters: - ş, ğ, ü, ö, ç for lowercase letters - Ş, Ğ, Ü, Ö, Ç, İ for uppercase letters - ı for dotless lowercase i Examples: - "Iptal" → "İptal" - "Yukle" → "Yükle" - "Guncelle" → "Güncelle" - "Duzenle" → "Düzenle" - "Cikis Yap" → "Çıkış Yap"
There was a problem hiding this comment.
Pull request overview
This pull request introduces comprehensive internationalization (i18n) support to the ESPHome Dashboard by replacing hardcoded UI strings with translation function calls and adding Turkish language support. The implementation includes a lightweight translation system with locale persistence, browser language detection, and a user-facing language selector component.
Key Changes:
- Implemented a translation system with
t()function for translating UI strings using dot-notation keys (e.g.,t('device.update')) - Added Turkish translations for all user-facing text across the dashboard
- Introduced a language selector component allowing users to switch between English and Turkish
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/locales/index.ts |
Core i18n module with translation function, locale management, and localStorage persistence |
src/locales/en.ts |
Complete English translation strings organized by component and feature area |
src/locales/tr.ts |
Complete Turkish translation strings mirroring the English structure |
src/components/esphome-language-selector.ts |
New language selector component with dropdown menu for switching languages |
src/components/esphome-header-menu.ts |
Updated header menu to use translations and integrate the language selector |
src/editor/esphome-editor.ts |
Replaced hardcoded editor strings with translation calls |
src/devices/configured-device-card.ts |
Replaced device card UI strings with translation calls |
src/delete-device/delete-device-dialog.ts |
Updated delete confirmation dialog to use translations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix Turkish nativeName: "Turkce" → "Türkçe" - Fix mwc-menu anchor positioning (use query decorator and anchor property like esphome-button-menu) - Apply Prettier formatting to all modified files Note: Page reload on locale change is kept for now as implementing reactive updates without reload would require significant changes to all components using the t() function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major internationalization (i18n) update to the ESPHome Dashboard UI. It replaces nearly all hardcoded UI strings with translation function calls, ensuring that all user-facing text is ready for localization. Additionally, it introduces a new language selector component, allowing users to switch between available languages directly from the interface.
The most important changes are:
Internationalization of UI Text:
t()calls across major components, includingesphome-header-menu, device cards, dialogs, and the editor, making all user-facing text ready for localization. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Language Selector Feature:
esphome-language-selectorcomponent, which provides a UI for users to choose their preferred language. This component is integrated into the header menu. [1] [2]Dialog and Confirmation Updates:
Import Updates for Translations:
t()function for UI strings. [1] [2] [3] [4]These changes collectively enable full support for multiple languages in the ESPHome Dashboard interface.