Skip to content

feat(i18n): add Arabic (ar-SA) language support#431

Merged
wyuc merged 2 commits intoTHU-MAIC:mainfrom
YizukiAme:i18n/arabic-ar-sa
Apr 16, 2026
Merged

feat(i18n): add Arabic (ar-SA) language support#431
wyuc merged 2 commits intoTHU-MAIC:mainfrom
YizukiAme:i18n/arabic-ar-sa

Conversation

@YizukiAme
Copy link
Copy Markdown
Contributor

@YizukiAme YizukiAme commented Apr 14, 2026

Summary

Add Arabic (ar-SA) language support to the i18n system, addressing #427.

Changes

New file

  • lib/i18n/locales/ar-SA.json — Complete Arabic (Saudi Arabia) translation with all 803 i18n keys

Modified file

  • lib/i18n/locales.ts — Register ar-SA locale entry (العربية / AR)

Translation Quality

  • Base translation generated with LLM, then cross-validated by 3 independent LLMs with domain expertise in Arabic localization
  • 15 targeted corrections applied from review feedback, including:
    • Terminology consistency (Providerالمزوّد uniformly)
    • RTL punctuation fixes (exclamation mark positioning)
    • Translation error fixes (عادلاًعاليًا in voice description)
    • streaming connotation fix (البث المباشرالتدفق)
    • Expanded TTS/ASR abbreviations in user-facing labels
    • Arabic comma (،) instead of English comma (,)
  • All {{interpolation}} variables preserved and verified
  • Brand names and provider names kept in English per convention
  • Language names kept in native script

Known Limitations

  1. RTL layout: This PR only adds the translation file. The UI layout remains LTR. Full RTL support (flex direction, text alignment, margins, icon positioning) is a systematic UI change that should be tracked as a separate issue.
  2. Arabic plural forms: Arabic has singular/dual/few/many/other plural rules. The current i18n keys use a single form. Adding proper plural support (_one/_two/_few/_many/_other suffixes) requires both translation additions and code changes to pass count parameters — tracked as a future enhancement.
  3. Voice descriptions: Some Chinese-cultural voice descriptions (e.g., cross-talk, regional dialects) are translated literally. Native speaker review for cultural adaptation is welcome.

Verification

  • All 803 keys match en-US.json exactly (automated verification)
  • TypeScript compilation passes with zero errors
  • JSON structure valid and well-formed

Closes #427

Translated and audited by Claude Opus 4.6, GPT 5.4 and Gemini 3.1 Pro.
Manually researched and audited.

@YizukiAme YizukiAme force-pushed the i18n/arabic-ar-sa branch 2 times, most recently from c0ee1cf to e127d5f Compare April 15, 2026 23:26
Copy link
Copy Markdown
Contributor

@wyuc wyuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase onto current main. A few PRs landed since this was opened:

Missing 12 keys (added by #418 — classroom ZIP export/import):

export.classroomZip
export.classroomZipDesc
import.classroom
import.error.invalidManifest
import.error.invalidZip
import.error.missingData
import.error.storageFull
import.parsing
import.success
import.validating
import.writingCourse
import.writingMedia

Remove 2 stale keys (deleted in #411/#412):

pbl.chat.welcomeMessage
toolbar.languageHint

@YizukiAme
Copy link
Copy Markdown
Contributor Author

working on it!

Add complete Arabic (Saudi Arabia) translation with 803 i18n keys, cross-validated by multiple LLMs with 15 targeted corrections applied.

Closes THU-MAIC#427
@YizukiAme
Copy link
Copy Markdown
Contributor Author

Rebased onto current main and addressed all feedback~

@YizukiAme YizukiAme requested a review from wyuc April 16, 2026 06:36
@wyuc wyuc merged commit 3e8a304 into THU-MAIC:main Apr 16, 2026
2 checks passed
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.

Add Arabic (العربية) language support to i18n

2 participants