Repository navigation
feat: Arabic (AR) radio translation foundation - #8031
Merged
Merged
Conversation
pfeerick
added a commit
to EdgeTX/edgetx-sdcard-sounds
that referenced
this pull request
Nov 12, 2026
voices/ar-SA.csv lists every file the Arabic TTS in the firmware (radio/src/translations/tts/tts_ar.cpp, EdgeTX/edgetx#8031) can play, plus all other prompts from en-US.csv, with the Translation column left empty for a native speaker to fill in. The Context column explains the grammatical form each file needs (masculine/feminine number sets, the four thousand forms, and singular/dual/plural/ accusative unit forms) and the gender the firmware assumes per unit. Adds an Azure job (ar-SA-ZariyahNeural -> SOUNDS/ar) so audio can be generated once translations exist; rows without a translation are skipped. README documents the template. No audio or sounds.json entry yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 of 3 tasks
Adds Arabic as a radio language for color LCD radios. Strings only; the screen layout is not mirrored. Firmware - AR added to RADIO_LANGUAGES/TTS_LANGUAGES and RTL_LANGUAGES (bidi). New AP_LANGUAGES / TRANSLATION_NEEDS_AP enables LVGL Arabic letter shaping (LV_USE_ARABIC_PERSIAN_CHARS, lv_txt_ap.c) for AR builds and the simulator. - BitmapBuffer::drawSizedText() also shapes text containing Arabic, since text drawn there bypasses lv_label (custom widgets, Lua). Not compiled into the bootloader, whose strings are never Arabic. - i18n/ar.h: copy of en.h with the main menu strings translated (needs native speaker review). TR_VOICE_ARABIC added to all translations. - Fonts: Noto Sans Arabic (OFL) with get_char_ar.py; the full Arabic Presentation Forms-B block is always included because shaped forms never appear in the source text. lv_font_ar_* generated for all screen sizes; CJK fonts regenerated for the new voice-name glyphs. - tts_ar.cpp: Arabic number/duration grammar based on tts_ru.cpp: 4 unit forms (singular/dual/plural/accusative), separate masculine and feminine 0-99 prompt blocks (gender polarity is in the recordings), dual/plural thousands, and per-unit gender. The prompt layout in the file header is the spec for a voice pack. - Simulator: lang_ar.cpp, font tables and shared font buffer. - cfn sort order regenerated with ar_SA.UTF-8. - B&W radios: AR is not selectable as text language (no fonts). Companion - "ar" added to the firmware language list, and Arabic to the voice language and color text language selectors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cfn_sorter.sh needs ar_SA.UTF-8 to sort the Arabic custom function list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add an empty companion_ar.ts (generated with the companion_translations
target) and list "ar" in the Companion UI languages, so Arabic can be
selected under "Set Menu Language" and translated with Qt Linguist.
The locale is language-only ("ar"), as the translation is Modern
Standard Arabic and not country specific. Qt's own qtbase_ar.qm sets
the application layout direction to right-to-left, so no extra RTL
code is needed. The other .ts changes are lupdate line number updates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B&W radios have no Arabic glyphs, so treat AR like CN/JP/KO/TW and skip it for B&W targets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pfeerick
force-pushed
the
feat/arabic-translation
branch
from
November 13, 2026 03:14
c59fa17 to
a15c675
Compare
The AR block was generated while the ar.h function names were still English placeholders. Re-run `just cfn-sort` now that #8034 translated them, so the Custom function sort order check passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Shorten quick menu labels that were cut off (Flight Reset, Apps) - Use English for the trims/subtrim actions on the Outputs page, where mixed Arabic/English rendered in the wrong word order - Use مستشعر for "sensor"
lz4_font.cpp drops the kerning data for fonts built with NO_KERN but
still copied kern_classes from the source font. decompressFont() then
built a kerning table whose class mappings and values all pointed at
offset 0 (the glyph descriptors), with right_class_cnt = 0, so LVGL
read glyph descriptor bytes as kerning values and shifted glyphs by
up to +-8 px. In Arabic XS tiles letters overlapped so text looked
missing ("التطبيقات" showed as "يقات"), and "إعداد" had a gap.
Only fonts whose source has kerning classes and are built with
NO_KERN are affected; today that is only Arabic (Noto Sans Arabic).
The HE/CN/TW/KO subsets have no kerning classes. Set kern_classes = 0
for NO_KERN fonts and regenerate: only the kern_classes and
lvglFontBufSize lines of the Arabic compressed fonts change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LVGL's default base direction is LTR. A string such as "إضافة كل Trims إلى Subtrims" is split into RTL and LTR runs by the Latin words, and with an LTR base those runs are laid out left to right, so the phrase reads in the wrong order. (Text that is only Arabic words is a single RTL run and was already correct.) When bidi is enabled, give the main screen, top and system layers base_dir AUTO so each text takes its direction from its first strong character, and use AUTO for text drawn through BitmapBuffer::drawSizedText(). AUTO doesn't mirror flex/grid layouts (only RTL does), and text_align LEFT on the same roots keeps unaligned text where it is today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
translations/sim/lang_ar.cpp was created from lang_he.cpp and still included i18n/he.h, so selecting Arabic as the text language in the simulator (and Companion's simulator) showed the Hebrew strings, which the Arabic font can't draw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pfeerick
marked this pull request as ready for review
November 17, 2026 03:15
This was referenced Nov 17, 2026
pfeerick
added a commit
to EdgeTX/edgetx-sdcard-sounds
that referenced
this pull request
Nov 19, 2026
Adds voices/ar-SA.csv following the Arabic TTS prompt layout in the firmware (tts_ar.cpp, EdgeTX/edgetx#8031), the generated SOUNDS/ar audio (Azure ar-SA-ZariyahNeural), a sounds.json entry and a README section. Translations by GyroGhost, partly tested by him as a native Arabic speaker. Co-authored-by: GyroGhost <111621931+GyroGhost@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Related: discussion #8027 (Arabic language support).
Draft / feasibility work. This adds the groundwork for an Arabic (AR) radio language on color LCD radios, so the translation from #8027 has somewhere to go.
ar.his now fully translated (#8034, by GyroGhost). It still needs native-speaker review, and a check that the strings fit on screen. The screen layout is not mirrored. Text is shaped and shown right to left, but menus and labels keep their current left-to-right positions.Summary of changes:
RTL and Arabic letter shaping
ARis added toRADIO_LANGUAGES,TTS_LANGUAGESandRTL_LANGUAGES, which turns on LVGL bidi as it does for Hebrew.AP_LANGUAGES/TRANSLATION_NEEDS_APenables LVGL's Arabic shaping (LV_USE_ARABIC_PERSIAN_CHARS,lv_txt_ap.c) for AR builds and the simulator. Shaping turns each letter into its isolated, initial, medial or final form.lv_label/lv_dropdown, soBitmapBuffer::drawSizedText()now also shapes any string that contains Arabic. That covers text drawn by custom widgets and Lua. It's not compiled into the bootloader, whose strings are always English for AR.Fonts
radio/src/fonts/Noto/.get_char_ar.pycollects the Arabic characters used inar.h, plus the whole Presentation Forms-B block. Shaping produces those forms at runtime, so they never appear in the source text.lv_font_ar_*is generated for all three screen sizes. The CN/TW/KO fonts are regenerated for the new "Arabic" voice-name glyphs.Strings
i18n/ar.his fully translated (Full Arabic translation for ar.h #8034). Common EdgeTX/FPV terms such as Inputs, Mixes and Telemetry are kept in English on purpose. Harakat (diacritic marks) are avoided, because LVGL doesn't position combining marks.TR_VOICE_ARABICis added to every translation, and the sim string list and cfn sort order are regenerated.Voice (TTS)
tts_ar.cppimplements Arabic number and duration grammar, based ontts_ru.cpp:Companion
aris added to the firmware language list, and Arabic to the voice and color text-language selectors.companion_ar.tsis added (all strings still untranslated), and Arabic (العربية) is listed under Settings → Set Menu Language. The locale is plainar, because the translation is Modern Standard Arabic and not tied to one country.qtbase_ar.qmswitches the whole app to RTL. This was already the case for anyone running Companion on an Arabic (or Hebrew) OS.tools/build-multilang.shno longer builds AR firmware for B&W radios.Translating Companion
companion/src/translations/companion_ar.tswith Qt Linguist, and open a PR against this branch (as Full Arabic translation for ar.h #8034 did forar.h).%1/%2placeholders, HTML tags and&shortcut markers.lrelease companion_ar.ts, setEDGETX_APP_TRANSLATIONS_PATHto the folder that holds the.qm, and restart Companion..qm, so Companion shows the mirrored layout with English text.Answers to the questions in #8027
tts_ar.cppadds about 730 bytes on B&W radios (Zorro: 4.24 KB free).just gen-fontsmakeslv_font_ar_*pick up any new letters.just cfn-sortupdates the special function sort order, and needs thear_SA.UTF-8locale installed (seetools/cfn_sorter.sh). The Custom function sort order check fails ifcfn_sort.cppis out of date.Known gaps / TODO
ar.h(Full Arabic translation for ar.h #8034 by GyroGhost, merged into this branch)lv_font_ar_*for the full translation, which adds؟,ـand 8 more Arabic letters (a15835e)tts_ar.cppgrammar and unit genderstts_ar.cppprompt layout. Template PR: feat(ar): add Arabic voice pack edgetx-sdcard-sounds#194ar_SA.UTF-8to thelocale-genlists intools/setup_buildenv_ubuntu2{2,4}.04.shar_SA.UTF-8to thelocale-genlist indev/Dockerfile. chore: add ar_SA locale for Arabic build-edgetx#62, merged. Thear_SAsort order was regenerated in a5868bb.arcompanion_ar.ts(Companion UI)primitives/transparencyscreenshot gtests have no AR reference images. They fail when gtests are built withTRANSLATIONS=AR, as they do for HE. CI runs them in EN.Testing
ar.h.BitmapBufferat every font size from XXS to XL bold. Letters join correctly, the لا ligature forms, and mixed Arabic/Latin/digits come out in the right order.tts_ar.cppcompiled on the host against a stub plays the expected prompt sequence for 1, 2, 3, 11, 21, 103, 1250, 2000, decimals and durations.🤖 Generated with Claude Code