qml: add Arabic and right-to-left layout support #1148

Open
uqlidi wants to merge 5 commits from rtl-arabic into qt6 AGit
uqlidi commented 2026-11-25 00:44:58 +00:00 (Migrated from github.com)

When the app language is Arabic, the interface now mirrors right to left and is translated into Arabic.

  • Layout: windows turn on LayoutMirroring for right-to-left languages. Shared controls also mirror the padding, positions, menus, split view and page transitions that Qt doesn't flip automatically. The left and right caret icons flip. The transaction flow diagram, RPC console and debug log stay left to right.
  • Font: bundles Noto Sans Arabic (OFL) as the fallback for BitcoinCoreSans. Its metrics are adjusted so Arabic and Latin text share a baseline.
  • Dates: dates follow the app language but keep Latin digits, like amounts, addresses and block heights.
  • Translation: adds bitcoin_qml_ar.ts. 1,481 of 1,489 strings are translated. The other 8 are RPC console output and stay in English.
  • Testing without Arabic: the debug-only -reverselayout option mirrors the layout in any language.
English Arabic
en-activity ar-activity
More screenshots
English Arabic
en-activity-typefilter ar-activity-typefilter
en-activity-more ar-activity-more
en-walletselect ar-walletselect
en-settings-mempool ar-settings-mempool
en-settings-network-traffic ar-settings-network-traffic
en-settings-rpc-console ar-settings-rpc-console
en-settings-debug-log ar-settings-debug-log
en-settings-about ar-settings-about
When the app language is Arabic, the interface now mirrors right to left and is translated into Arabic. - **Layout:** windows turn on `LayoutMirroring` for right-to-left languages. Shared controls also mirror the padding, positions, menus, split view and page transitions that Qt doesn't flip automatically. The left and right caret icons flip. The transaction flow diagram, RPC console and debug log stay left to right. - **Font:** bundles Noto Sans Arabic (OFL) as the fallback for BitcoinCoreSans. Its metrics are adjusted so Arabic and Latin text share a baseline. - **Dates:** dates follow the app language but keep Latin digits, like amounts, addresses and block heights. - **Translation:** adds `bitcoin_qml_ar.ts`. 1,481 of 1,489 strings are translated. The other 8 are RPC console output and stay in English. - **Testing without Arabic:** the debug-only `-reverselayout` option mirrors the layout in any language. | English | Arabic | |---|---| | <img alt="en-activity" src="https://git.fish.foo/attachments/747f0ae2-e057-4c1d-a7dc-2adb2935b074" /> | <img alt="ar-activity" src="https://git.fish.foo/attachments/b7c2730b-6335-456a-b4bf-ab644eae8ee6" /> | <details> <summary>More screenshots</summary> | English | Arabic | |---|---| | <img alt="en-activity-typefilter" src="https://git.fish.foo/attachments/c3b044c0-64d1-4750-9993-1c34062c8bbc" /> | <img alt="ar-activity-typefilter" src="https://git.fish.foo/attachments/e5d9cb7b-5f67-4c93-8047-a3e9f0ccb260" /> | | <img alt="en-activity-more" src="https://git.fish.foo/attachments/22140c50-985f-469e-be30-597d7ec9efd3" /> | <img alt="ar-activity-more" src="https://git.fish.foo/attachments/2171d2ac-84ff-44da-b5d3-b94135453beb" /> | | <img alt="en-walletselect" src="https://git.fish.foo/attachments/0da8410c-a9f0-43fc-b63e-4f60266cc7bb" /> | <img alt="ar-walletselect" src="https://git.fish.foo/attachments/4bef825e-24ca-49c4-a0d8-a9ecfc49f116" /> | | <img alt="en-settings-mempool" src="https://git.fish.foo/attachments/fb6299e5-c883-4e72-a54b-0a0b35118250" /> | <img alt="ar-settings-mempool" src="https://git.fish.foo/attachments/d24692b5-422f-4fd3-aa21-8d186c0c5fb2" /> | | <img alt="en-settings-network-traffic" src="https://git.fish.foo/attachments/74201cf9-a94a-4964-8af7-13c180551a11" /> | <img alt="ar-settings-network-traffic" src="https://git.fish.foo/attachments/e0077b70-929f-49bb-b183-737151a0df5e" /> | | <img alt="en-settings-rpc-console" src="https://git.fish.foo/attachments/41adba25-670f-4162-8164-82358c8fa461" /> | <img alt="ar-settings-rpc-console" src="https://git.fish.foo/attachments/a07b6673-0146-4bad-a8af-65ef2e2590cb" /> | | <img alt="en-settings-debug-log" src="https://git.fish.foo/attachments/a7e3fa9f-cca8-4acb-a272-fdcbbf71fcd2" /> | <img alt="ar-settings-debug-log" src="https://git.fish.foo/attachments/fc363225-4929-45e5-978e-d66c18a420ba" /> | | <img alt="en-settings-about" src="https://git.fish.foo/attachments/d77d3071-f30b-49de-b631-d9797b109d18" /> | <img alt="ar-settings-about" src="https://git.fish.foo/attachments/e0069ce0-537f-4ad9-9b2c-eacf50150df8" /> | </details>
rreview commented 2026-11-25 01:43:36 +00:00 (Migrated from github.com)

🟠 Minor · Arrow keys in SegmentedPicker move opposite to the mirrored layout

In RTL layouts, SegmentedPicker selects in the opposite direction to the pressed arrow key; in Send's coin-control picker, this can clear the manual input selection.

Location: qml/pages/MainWindow.qml:21 (head).

🟠 Minor · Date formatting ignores the script selected by @​latin language tags

Selecting sr@latin, sr@ijekavianlatin or kk@latin passes the raw tag to QLocale, causing word-based dates to use the language's default Cyrillic script instead of the selected Latin script.

Location: qml/localeformat.cpp:26 (head).

🟠 Minor · Choosing a language also replaces regional date and calendar conventions

Choosing en on an en_GB system now selects US month-first dates, 12-hour time and a Sunday week start, rather than changing only the language of month and weekday names.

Location: qml/localeformat.h:33 (head).

🔵 Suggestion · The font checks can pass CTest without running their assertions

FontsTests skips the entire class when application fonts are unavailable, while its only CTest invocation forces minimal, allowing the fallback, semibold and baseline checks to remain unexecuted.

Location: test/CMakeLists.txt:49 (head).

🔵 Suggestion · The modified Noto font binaries lack a reproducible generation step

The two bundled OTFs have documented metric edits but no checked-in procedure or hashes for reproducing them, making verification of the binary changes unnecessarily manual.

Location: qml/res/fonts/NotoSansArabic-NOTICE.txt:8 (head).

🔵 Suggestion · The console-direction decision is split across consecutive commits

3b650f8 adds mirrored console-popup positioning and fixed input alignment, then 3403e62 immediately removes or rewrites both when making the console left to right.

Location: qml/pages/node/CommandConsole.qml:168 at 3b650f8f9ab1 (commit) (commit).

Review coverage was incomplete.


Reviewed: d72c4d9aa262 · Review report

<!-- ralph-major:bitcoin-core/gui-qml --> **🟠 Minor · Arrow keys in `SegmentedPicker` move opposite to the mirrored layout** In RTL layouts, `SegmentedPicker` selects in the opposite direction to the pressed arrow key; in Send's coin-control picker, this can clear the manual input selection. Location: [qml/pages/MainWindow.qml:21](<https://github.com/bitcoin-core/gui-qml/blob/d72c4d9aa262fc999ac2956c032a19ad3ea7683c/qml/pages/MainWindow.qml#L21>) (head). **🟠 Minor · Date formatting ignores the script selected by `@​latin` language tags** Selecting `sr@latin`, `sr@ijekavianlatin` or `kk@latin` passes the raw tag to `QLocale`, causing word-based dates to use the language's default Cyrillic script instead of the selected Latin script. Location: [qml/localeformat.cpp:26](<https://github.com/bitcoin-core/gui-qml/blob/d72c4d9aa262fc999ac2956c032a19ad3ea7683c/qml/localeformat.cpp#L26>) (head). **🟠 Minor · Choosing a language also replaces regional date and calendar conventions** Choosing `en` on an `en_GB` system now selects US month-first dates, 12-hour time and a Sunday week start, rather than changing only the language of month and weekday names. Location: [qml/localeformat.h:33](<https://github.com/bitcoin-core/gui-qml/blob/d72c4d9aa262fc999ac2956c032a19ad3ea7683c/qml/localeformat.h#L33>) (head). **🔵 Suggestion · The font checks can pass CTest without running their assertions** `FontsTests` skips the entire class when application fonts are unavailable, while its only CTest invocation forces `minimal`, allowing the fallback, semibold and baseline checks to remain unexecuted. Location: [test/CMakeLists.txt:49](<https://github.com/bitcoin-core/gui-qml/blob/d72c4d9aa262fc999ac2956c032a19ad3ea7683c/test/CMakeLists.txt#L49>) (head). **🔵 Suggestion · The modified Noto font binaries lack a reproducible generation step** The two bundled OTFs have documented metric edits but no checked-in procedure or hashes for reproducing them, making verification of the binary changes unnecessarily manual. Location: [qml/res/fonts/NotoSansArabic-NOTICE.txt:8](<https://github.com/bitcoin-core/gui-qml/blob/d72c4d9aa262fc999ac2956c032a19ad3ea7683c/qml/res/fonts/NotoSansArabic-NOTICE.txt#L8>) (head). **🔵 Suggestion · The console-direction decision is split across consecutive commits** `3b650f8` adds mirrored console-popup positioning and fixed input alignment, then `3403e62` immediately removes or rewrites both when making the console left to right. Location: [qml/pages/node/CommandConsole.qml:168 at 3b650f8f9ab1 (commit)](<https://github.com/bitcoin-core/gui-qml/blob/3b650f8f9ab120e5b194b2a14ba651d1e45def42/qml/pages/node/CommandConsole.qml#L168>) (commit). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`d72c4d9aa262`](<https://github.com/bitcoin-core/gui-qml/commit/d72c4d9aa262fc999ac2956c032a19ad3ea7683c>) · [Review report](<https://review.fish.foo/report/gui/1148-d72c4d9aa262fc999ac2956c032a19ad3ea7683c-3126-2.html>)
ValeraFinebits commented 2026-11-26 14:50:22 +00:00 (Migrated from github.com)

I ran into this on d72c4d9 while testing Send with -lang=en -reverselayout. With one input selected and Manual focused on the left, pressing the left arrow switches to Automatic on the right. When I switch back to Manual, the input I picked is gone.

Could SegmentedPicker make the arrow keys follow the visual order in RTL layouts? In this case, there's no segment to the left of Manual, so I'd expect the keypress to keep Manual active and preserve the selected input.

I ran into this on d72c4d9 while testing Send with `-lang=en -reverselayout`. With one input selected and `Manual` focused on the left, pressing the left arrow switches to `Automatic` on the right. When I switch back to `Manual`, the input I picked is gone. Could `SegmentedPicker` make the arrow keys follow the visual order in RTL layouts? In this case, there's no segment to the left of `Manual`, so I'd expect the keypress to keep `Manual` active and preserve the selected input.
Sign in to join this conversation.
No description provided.