feat: internationalization (i18n) system — EN, RU, ES#134
Open
flathead wants to merge 9 commits intoAxenide:devfrom
Open
feat: internationalization (i18n) system — EN, RU, ES#134flathead wants to merge 9 commits intoAxenide:devfrom
flathead wants to merge 9 commits intoAxenide:devfrom
Conversation
Author
Merge order for related PRsThis repo currently has 4 open PRs from this fork. They touch some of the same files, so merging them in the right order avoids most conflicts:
If you merge #134 last, the only conflicts will be in:
All conflicts are straightforward - no logic changes, just placement of new blocks alongside each other. |
Introduces a full i18n infrastructure and migrates all hardcoded UI
strings across the codebase to use the new translation system.
## New files
- modules/services/I18n.qml — singleton service that loads JSON
translation files at runtime based on system locale or config
- translations/en.json — English (base, ~637 keys)
- translations/ru.json — Russian translation
- translations/es.json — Spanish translation
- translations/languages.json — language metadata registry
## Infrastructure
- I18n.qml detects locale via Qt.locale(), falls back to "en"
- Config.qml: added `language` property (default "auto") for manual
language override; added `rus` bool to OCR config
- config/defaults/system.js: added language and rus defaults
- .pragma library JS files (notification_utils.js, notes_utils.js)
receive `t` as a parameter from callers since they cannot access
QML singletons directly
## String migration
All hardcoded UI strings across 67 files replaced with I18n.t("key"):
- Bar: battery, layout selector, controls button, tools button
- Clock: month/day names (fixes Qt.locale() genitive case in RU),
weather day labels, pomodoro controls
- Dashboard controls: all settings panels (Compositor, Theme, Shell,
System, Binds, Color Picker, Wallpapers, Audio, Bluetooth, WiFi,
EasyEffects, Gradient editor, Variant editor)
- Dashboard widgets: calendar, clipboard (relative timestamps),
notes (relative timestamps), notifications, launcher, overview,
tmux, emoji, metrics, full/compact player, quick controls,
presets, power menu
- Tools: screenshot overlay/tool, screen recorder
- Sidebar: AI assistant slash command descriptions
- Dock, Desktop, CodeBlock, ModelSelectorPopup
## Bug fixes included
- ToolsMenu.qml: fixed `i18n()` calls (undefined function) that
caused OCR panel crash — replaced with `I18n.t()`
- WallpapersTab.qml: fixed Tint label showing "OLED" (key mismatch)
- CompositorPanel, ThemePanel, SystemPanel: subsection titles now
translated dynamically (was using raw capitalize() fallback)
- SchemeSelector.qml: added missing `import qs.modules.services`
## Translation notes
- Russian: uses nominative month names (not genitive from Qt.locale())
- All 637 keys verified present in all three locale files
- Dynamic key patterns (e.g. settings.shell.{sectionId}) verified
OSD.qml: fix i18n.t() -> I18n.t() (lowercase caused empty strings) Ai.qml: migrate hardcoded user-visible strings to I18n.t(): - /model command: model not found, switched to model messages - /help command: full help message - API key missing error (with model name and key_id substitution) - Network request failed error - No response from API message - Command executed successfully (no output) message - Model descriptions for all 6 providers translations: add 13 new keys to en/ru/es (ai.api_key_missing, ai.cmd_no_output, ai.desc_*, ai.env_variable, ai.help_message, ai.model_not_found, ai.network_failed, ai.no_response, ai.switched_to_model)
Adds keys for the new resource monitor settings screen: enabled toggle, location (bar/dashboard), bar side, visible items (CPU/RAM/GPU/disk), disk list title, save/unsaved status, and bar tooltip. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
Wow nice, I was gonna add this to 1.3.0 lol but if this works it would be great. I'll test when I have the time. :) |
Adds 39 keys under calendar.bar.*, calendar.event.*, calendar.form.*, and calendar.settings.* namespaces for the calendar integration feature. Covers bar indicator labels, event form fields, validation errors, reminder options, and the barAlwaysShow setting toggle.
Add calendar.panel.* keys for all CalendarPanel UI strings (accounts, settings, form fields, section headers, arrival settings) and missing calendar.form.* keys (new_event, edit_event, time_placeholder) for EventPopup. All three languages: en, ru, es. 37 new keys each.
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.
What this does
Adds a runtime i18n system to Ambxst and migrates all hardcoded UI strings to use it. Three languages included: English, Russian, Spanish.
Translation quality
Russian and Spanish were translated mostly with machine translators and AI tools, then manually spot-checked. Quality may be uneven - wrong grammatical forms, unnatural phrasing, context mismatches are possible. Native speaker corrections are welcome.
How to add a new language
translations/en.jsontotranslations/{lang}.json(use standard locale codes:fr,de,ja, etc.)translations/languages.json:{ "code": "fr", "name": "Français", "direction": "ltr" }Config.system.language = "fr"in their configHow to fix or improve existing translations
Just edit the relevant
translations/{lang}.jsonfile. Keys are sorted alphabetically. Each key maps directly to a UI string - the key name usually makes the context clear (e.g."wallpapers.oled","settings.theme.colors").Architecture
modules/services/I18n.qml- new singleton that loads the JSON file and exposesI18n.t("key"). Detects locale viaQt.locale(), falls back to"en"..pragma libraryworkaround - JS files with.pragma librarycannot access QML singletons, sonotification_utils.jsandnotes_utils.jsreceive thetfunction as a parameter from their callers.Bug fixes included
ToolsMenu.qml:i18n()calls (undefined function) were crashing the OCR panel - replaced withI18n.t()WallpapersTab.qml: Tint label was showing "OLED" due to wrong keyCompositorPanel,ThemePanel,SystemPanel: subsection titles are now translated dynamicallySchemeSelector.qml: was usingI18n.t()without the required importFiles
72 files changed. New files:
modules/services/I18n.qml,translations/en.json,translations/ru.json,translations/es.json,translations/languages.json.Screenshots (idk what for 😄)