arabic-localization
Skill1 starsChanged 35 days agoMITView on GitHub
Localizes web and mobile apps into Arabic end to end. Extracts strings, writes all six Arabic plural forms (zero, one, two, few, many, other) in i18next or ICU MessageFormat, handles gender, Latin vs Arabic-Indic digits, SAR/EGP/AED currency, Gregorian and Hijri (Umm al-Qura) dates, fonts, and an Arabic QA pass. Use when adding Arabic or ar-SA/ar-EG/ar-AE to an app, translating locale files to Arabic, fixing broken Arabic plurals, numbers or dates, or setting up i18next, react-intl, next-intl, vue-i18n, Laravel or Flutter for Arabic.
In this repository13 other files it gives its agents.
- agent-ready-siteSkill
- arabic-copySkill
- arabic-seoSkill
- client-briefSkill
- design-tokens-extractorSkill
- freelance-quoteSkill
- product-sheetSkill
- rtl-uiSkill
- shared-server-deploySkill
- ui-inventorySkill
- vat-worksheetSkill
- video-readerSkill
- zatca-invoiceSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Only flipping layout to RTL with no translation work → rtl-ui.
- Distinctive: line 24
Decide the locale and the defaults with the user: Ask, or infer from the brief:
- Very specific: line 29
Write the decisions into the i18n config as explicit locale extensions, for example ar-SA-u-nu-latn-ca-gregory.
- Very specific: line 30
Extract every string: Search for hard-coded user-facing text in components, templates, validation messages, emails, notifications, and …
- Very specific: line 33
Format, don't concatenate: Every number, price, percent, date, time, list and relative time goes through Intl (or the library's formatter, …
- Distinctive: line 46
Never build sentences from translated pieces.
- Very specific: line 47
Always pass a calendar and a numbering system explicitly.
- Very specific: line 48
Use islamic-umalqura for Saudi Hijri dates, never islamic or islamic-civil.
- Distinctive: line 50
Don't strip the invisible direction marks Intl adds to currency and percent output.
- Distinctive: line 74
Run before saying the work is done:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Arabic localization
Take an app from English-only to correct Arabic: strings, plurals, numbers, dates, currency, fonts, and a QA pass. Layout direction (RTL) is a separate job; hand it to the rtl-ui skill if it is available.
When to use
- Adding Arabic (
ar,ar-SA,ar-EG,ar-AE, …) to an existing app. - Translating or reviewing Arabic locale files.
- Fixing Arabic plurals that read wrong, digits that look mixed, or dates that show the wrong calendar.
When not to use
- Only flipping layout to RTL with no translation work → rtl-ui.
- Writing Arabic marketing or UI copy from scratch → arabic-copy.
Workflow
- Find the stack. Identify the i18n library and its version (
package.json,composer.json,pubspec.yaml). Open the matching section ofreferences/frameworks.md. If there is no i18n library, propose one that fits the stack before touching strings. - Decide the locale and the defaults with the user. Ask, or infer from the brief:
- Region:
ar-SA,ar-EG,ar-AE, or genericar. - Digits: Latin (123) or Arabic-Indic (١٢٣). One app-wide setting.
- Calendar: Gregorian only, or Gregorian with Hijri (Umm al-Qura) beside it.
- Tone: Modern Standard Arabic (default) or a dialect.
Write the decisions into the i18n config as explicit locale extensions, for example
ar-SA-u-nu-latn-ca-gregory. Never rely on locale defaults; they differ between runtimes (seereferences/formatting.md).
- Region:
- Extract every string. Search for hard-coded user-facing text in components, templates, validation messages, emails, notifications, and server responses. Replace each with a key. Keys describe meaning, not position:
checkout.payButton, notbutton3. One full sentence per key; never concatenate translated fragments. - Mark counts as plurals in the source language first. Any string with a number in it becomes a plural message in English (
_one/_otheror ICUplural). Then the Arabic file can add its six forms. - Write the Arabic messages. For every plural, write all six categories with the correct noun form for each (
references/plurals.md). Useselectfor gendered sentences or rephrase neutrally. Keep placeholders, HTML tags and ICU syntax exactly as in the source. - Format, don't concatenate. Every number, price, percent, date, time, list and relative time goes through
Intl(or the library's formatter, which usesIntl). Normalize Arabic-Indic digits in user input before parsing. - Set language and direction on the root.
lang="ar"anddir="rtl"on<html>(or the platform equivalent). Load an Arabic font. Then hand layout to rtl-ui. - Check plurals mechanically.
Fix everything it reports. Runnode scripts/check-plurals.mjs --source locales/en/common.json locales/ar/*.jsonnode scripts/plural-table.mjs arif anyone doubts which form a number takes. - Run the QA pass in
references/qa.mdand report what still needs a native reviewer.
Rules
- Arabic has six plural categories.
fewis n%100 in 3–10 andmanyis n%100 in 11–99, so 103 isfewand 111 ismany. All decimals areother. Never hand-code ranges. oneandtwodo not show the digit: رسالة واحدة, رسالتان. Not "1 رسالة".- Never build sentences from translated pieces. Arabic word order and agreement differ.
- Always pass a calendar and a numbering system explicitly.
ar-SAdefaults have changed between ICU versions. - Use
islamic-umalqurafor Saudi Hijri dates, neverislamicorislamic-civil. - Phone numbers, IDs, codes, IBANs and card numbers stay in Latin digits in an LTR span.
- Don't strip the invisible direction marks Intl adds to currency and percent output.
- No
letter-spacing, synthetic italics or uppercase-only hierarchy on Arabic text. - Machine translation is a draft. Say so when you used it and list strings that need a native reviewer.
Before / after
Before:
`${count} ${count === 1 ? "item" : "items"}` // English-only logic
price.toFixed(2) + " SAR" // no locale, wrong order
date.toLocaleDateString() // calendar depends on the machineAfter:
t("cart.items", { count }) // six Arabic forms in ar.json
new Intl.NumberFormat("ar-SA-u-nu-latn", { style: "currency", currency: "SAR" }).format(price)
new Intl.DateTimeFormat("ar-SA-u-ca-gregory-nu-latn", { dateStyle: "long" }).format(date)Verification checklist
Run before saying the work is done:
scripts/check-plurals.mjsexits 0 for every Arabic file.- No user-facing string is left hard-coded (search templates for Latin-letter text nodes).
- Locale config states the numbering system and calendar explicitly.
- One screen checked at counts 0, 1, 2, 3, 11, 100.
langanddirare set on the root, and an Arabic font loads.- Prices and dates on one real screen match the outputs in
references/formatting.mdfor the chosen locale. - Remaining items for a native Arabic reviewer are listed for the user.
Files
references/plurals.md— the six categories, noun forms, i18next and ICU examples, gender with plurals.references/formatting.md— digits, input parsing, currency (including the new Saudi riyal sign), Gregorian and Hijri dates, time, lists.references/frameworks.md— i18next, FormatJS, next-intl, vue-i18n, Laravel, Flutter, iOS, Android.references/qa.md— fonts, text length, pseudo-localization, the Arabic QA checklist.scripts/plural-table.mjs— prints which plural category each number gets in your runtime.scripts/check-plurals.mjs— reports Arabic messages missing plural forms (i18next JSON and ICU). Exit 1 on problems, for CI.examples/— sample English and Arabic locale files, good and bad, for the checker.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

