Tired of setting up internationalization (i18n) and Right-To-Left (RTL) text support every time you start a new React project? This starter template has you covered.
Bilingual Starter is a clean, modern template designed to help you build bilingual (or multilingual) React applications quickly. It comes pre-configured with English and Arabic support, automatic RTL/LTR switching, and a professional look using Tailwind CSS v4.
@theme
in index.css
).react-i18next
setup with English & Arabic JSON files./en/about
, /ar/about
).public/README.md
).Follow these steps to get started:
Clone the repo:
git clone https://github.com/YounesElhjouji/react-vite-bidi-starter.git bilingual-starter
cd bilingual-starter
Install dependencies:
yarn install
Run the dev server:
yarn dev
Your project should now be running at http://localhost:5173
(or the next available port).
src/i18n
. The i18n.ts
file initializes everything. Use the useTranslation
hook in your components.src/App.tsx
. The /:locale
parameter handles the language in the URL. The Layout
component wraps pages.src/index.css
using @theme
for custom fonts (--font-cairo
) and colors (--color-beige
). Apply utility classes directly in your components (like bg-beige
or font-cairo
).Layout
component checks the current language (i18n.language
) and sets document.documentElement.dir
to 'rtl'
or 'ltr'
automatically./public
README.md # Content for the About page
/src
/components # Reusable UI (Navbar, Layout)
/i18n # Language files (en.json, ar.json) & config (i18n.ts)
/pages # Route components (Home, About)
App.tsx # Main routing setup
main.tsx # App entry point, CSS/i18n imports
index.css # Tailwind v4 setup, custom @theme definitions, and markdown styling
xx.json
file in src/i18n
, import it, and add it to the resources
in src/i18n/i18n.ts
. Update the language switcher logic if needed.@theme
block within src/index.css
.src/App.tsx
.public/README.md
file.This project is licensed under the MIT License.
هل سئمت من إعداد التدويل (i18n) ودعم النصوص من اليمين إلى اليسار (RTL) في كل مرة تبدأ فيها مشروع React جديد؟ هذا القالب جاهز لتلبية احتياجاتك.
القالب ثنائي اللغة هو قالب نظيف وحديث مصمم لمساعدتك في بناء تطبيقات React ثنائية اللغة (أو متعددة اللغات) بسرعة. يأتي مُعدًا مسبقًا لدعم اللغتين الإنجليزية والعربية، مع التبديل التلقائي بين النصوص من اليمين إلى اليسار (RTL) ومن اليسار إلى اليمين (LTR)، ومظهر احترافي باستخدام Tailwind CSS v4.
@theme
في index.css
).react-i18next
مع ملفات JSON للغتين الإنجليزية والعربية./en/about
و/ar/about
).public/README.md
).اتبع هذه الخطوات للبدء:
git clone https://github.com/YounesElhjouji/react-vite-bidi-starter.git bilingual-starter
cd bilingual-starter
yarn install
yarn dev
يجب أن يعمل مشروعك الآن على http://localhost:5173
(أو المنفذ المتاح التالي).
src/i18n
. يقوم ملف i18n.ts
بتهيئة كل شيء. استخدم الخطاف useTranslation
في مكوناتك.src/App.tsx
. يتعامل المعامل /:locale
مع اللغة في عنوان URL. يلتف مكون Layout
حول الصفحات.src/index.css
باستخدام @theme
لتعريف الخطوط المخصصة (--font-cairo
) والألوان (--color-beige
). قم بتطبيق فئات الأدوات مباشرة في مكوناتك (مثل bg-beige
أو font-cairo
).Layout
من اللغة الحالية (i18n.language
) ويضبط الخاصية document.documentElement.dir
إلى 'rtl'
أو 'ltr'
تلقائيًا./public
README.md # محتوى صفحة "حول"
/src
/components # واجهة مستخدم قابلة لإعادة الاستخدام (شريط التنقل، التخطيط)
/i18n # ملفات اللغات والإعدادات
/pages # مكونات المسارات (الرئيسية، حول)
App.tsx # إعداد التوجيه الرئيسي
main.tsx # نقطة دخول التطبيق واستيراد التنسيقات
index.css # إعداد Tailwind وتعريفات التصميم المخصصة وتنسيق Markdown
xx.json
جديدًا في src/i18n
، وقم باستيراده، وأضفه إلى resources
في src/i18n/i18n.ts
. قم بتحديث منطق مبدل اللغة إذا لزم الأمر.@theme
داخل src/index.css
.src/App.tsx
.public/README.md
.هذا المشروع مرخص بموجب رخصة MIT.