Skip to content

feat: add Arabic (ar) language support with RTL layout - #150

Merged
RoderickQiu merged 3 commits into
RoderickQiu:masterfrom
Taha2053:master
Jul 22, 2026
Merged

feat: add Arabic (ar) language support with RTL layout#150
RoderickQiu merged 3 commits into
RoderickQiu:masterfrom
Taha2053:master

Conversation

@Taha2053

@Taha2053 Taha2053 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Adds Arabic (ar) language support to wnr, including a full translation and RTL (right-to-left) layout support for the Settings, Timer, and Statistics windows.

What's included

  • Translation: locales/ar.json full Modern Standard Arabic translation
  • Wiring: Added ar / العربية to the language arrays in supporter.js, main.js, and ar-TN to the NSIS installer languages in res/builder/nsis.js
  • RTL layout: Scoped [dir="rtl"] CSS overrides for the Settings page and a dedicated .rtl-timer class for the Timer and Statistics time displays
  • Bidi text fix: Arabic strings that embed Latin words/brand names (e.g. "GitHub", "wnr", "WebDAV") could render in the wrong visual order due to how Unicode's bidirectional algorithm handles mixed-direction text. Fixed this at the source by wrapping i18n.__()'s return value in a Unicode First Strong Isolate (U+2068/U+2069) when the locale is Arabic, this way every string returned by the translation function is automatically isolated, regardless of where it's later concatenated or displayed.
  • Timer/Statistics number formatting: number-then-unit order with correct RTL grouping for hours/minutes/seconds, matching natural Arabic reading order

Testing

  • Verified Arabic renders correctly across Settings, Timer, and Statistics (RTL alignment, toggle switches, time display order)
  • Verified English, 简体中文, 正體中文, and 한국어 are all unaffected, every Arabic-specific change is gated behind an exact locale check (=== 'ar' or .startsWith('ar')) with no fallthrough, and I confirmed each locale's UI, timer, and statistics pages render identically to before this change

Also added French (fr) translation support – full French localization included with locales/fr.json.

Taha2053 and others added 3 commits July 21, 2026 03:30
Fall back to English when update metadata is not translated, prevent the
feature announcement from crashing, and give translated settings layouts
the space they need.
@RoderickQiu
RoderickQiu merged commit 2915d55 into RoderickQiu:master Jul 22, 2026
3 checks passed
@RoderickQiu

Copy link
Copy Markdown
Owner

Add some small fixes and now it is very nice, thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants