Markdown
ترجمة بالذكاء الاصطناعي لملفات Markdown باستخدام Lingo.dev CLI
ما هو Markdown؟
Markdown هي لغة ترميز خفيفة الوزن تستخدم صيغة تنسيق نص عادي لإنشاء مستندات منظمة. تُستخدم على نطاق واسع للتوثيق وملفات README والمدونات وأنظمة إدارة المحتوى.
على سبيل المثال:
---
title: "Product Launch Guide"
description: "Everything you need to know about our latest product features"
author: "Product Team"
---
# Welcome to Our New Dashboard
Discover powerful new features designed to streamline your workflow and boost productivity.
## Getting Started
Follow these simple steps to set up your account and begin using our platform effectively.

ما هو Lingo.dev CLI؟
Lingo.dev CLI هو واجهة سطر أوامر مجانية ومفتوحة المصدر لترجمة التطبيقات والمحتوى باستخدام الذكاء الاصطناعي. تم تصميمه ليحل محل برامج إدارة الترجمة التقليدية مع التكامل مع خطوط الأنابيب الحالية.
لمعرفة المزيد، راجع نظرة عامة.
حول هذا الدليل
يشرح هذا الدليل كيفية ترجمة ملفات Markdown باستخدام Lingo.dev CLI.
ستتعلم كيفية:
- إنشاء مشروع من الصفر
- تكوين خط أنابيب الترجمة
- إنشاء ترجمات باستخدام الذكاء الاصطناعي
المتطلبات الأساسية
لاستخدام Lingo.dev CLI، تأكد من تثبيت Node.js الإصدار 18 أو أحدث:
❯ node -v
v22.17.0
الخطوة 1. إعداد المشروع
في دليل مشروعك، أنشئ ملف i18n.json:
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.10",
"locale": {
"source": "en",
"targets": ["es"]
},
"buckets": {}
}
يحدد هذا الملف سلوك خط أنابيب الترجمة، بما في ذلك اللغات المراد الترجمة بينها ومكان وجود المحتوى القابل للترجمة على نظام الملفات.
لمعرفة المزيد حول الخصائص المتاحة، راجع i18n.json.
الخطوة 2. تكوين اللغة المصدر
اللغة المصدر هي اللغة والمنطقة الأصلية التي تمت كتابة المحتوى بها. لتكوين اللغة المصدر، قم بتعيين خاصية locale.source في ملف i18n.json:
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.10",
"locale": {
"source": "en",
"targets": ["es"]
},
"buckets": {}
}
يجب توفير اللغة المصدر كـ علامة لغة BCP 47.
للحصول على القائمة الكاملة لرموز اللغات التي يدعمها Lingo.dev CLI، راجع رموز اللغات المدعومة.
الخطوة 3. تكوين اللغات المستهدفة
اللغات المستهدفة هي اللغات والمناطق التي تريد ترجمة المحتوى الخاص بك إليها. لتكوين اللغات المستهدفة، قم بتعيين خاصية locale.targets في ملف i18n.json:
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.10",
"locale": {
"source": "en",
"targets": ["es"]
},
"buckets": {}
}
الخطوة 4. إنشاء المحتوى المصدر
إذا لم تكن قد قمت بذلك بالفعل، قم بإنشاء ملف أو أكثر من ملفات Markdown التي تحتوي على المحتوى المراد ترجمته. يجب أن تكون هذه الملفات موجودة في مسار يتضمن اللغة المصدر في مكان ما من المسار (على سبيل المثال، كاسم دليل مثل en/ أو كجزء من اسم الملف مثل messages.en.md).
الخطوة 5. إنشاء حاوية
-
في ملف
i18n.json، أضف كائن"markdown"إلى كائنbuckets:{ "$schema": "https://lingo.dev/schema/i18n.json", "version": "1.10", "locale": { "source": "en", "targets": ["es"] }, "buckets": { "markdown": {} } } -
في كائن
"markdown"، قم بتعريف مصفوفة من نمط أو أكثر من أنماطinclude:{ "$schema": "https://lingo.dev/schema/i18n.json", "version": "1.10", "locale": { "source": "en", "targets": ["es"] }, "buckets": { "markdown": { "include": ["./[locale]/example.md"] } } }تحدد هذه الأنماط الملفات المراد ترجمتها.
الأنماط نفسها:
- يجب أن تحتوي على
[locale]كعنصر نائب للغة المكونة - يمكن أن تشير إلى مسارات الملفات (على سبيل المثال،
"[locale]/docs.md") - يمكن استخدام النجوم كعناصر نائبة عامة (على سبيل المثال،
"[locale]/*.md")
أنماط glob العودية (على سبيل المثال،
**/*.md) غير مدعومة. - يجب أن تحتوي على
الخطوة 6. تكوين نموذج لغوي كبير
يستخدم Lingo.dev CLI نماذج لغوية كبيرة (LLMs) لترجمة المحتوى باستخدام الذكاء الاصطناعي. لاستخدام أحد هذه النماذج، تحتاج إلى مفتاح API من مزود مدعوم.
للبدء بأسرع وقت ممكن، نوصي باستخدام Lingo.dev Engine — منصتنا المستضافة الخاصة التي توفر 10,000 رمز من الاستخدام المجاني الشهري:
-
قم بتشغيل الأمر التالي:
npx lingo.dev@latest loginسيؤدي هذا إلى فتح المتصفح الافتراضي الخاص بك ومطالبتك بالمصادقة.
-
اتبع التعليمات.
الخطوة 7. إنشاء الترجمات
في الدليل الذي يحتوي على ملف i18n.json، قم بتشغيل الأمر التالي:
npx lingo.dev@latest run
يقوم هذا الأمر بما يلي:
- قراءة ملف
i18n.json. - العثور على الملفات التي تحتاج إلى ترجمة.
- استخراج المحتوى القابل للترجمة من الملفات.
- استخدام نموذج اللغة الكبير المُكوَّن لترجمة المحتوى المستخرج.
- كتابة المحتوى المترجم مرة أخرى إلى نظام الملفات.
في المرة الأولى التي يتم فيها إنشاء الترجمات، يتم إنشاء ملف i18n.lock. يتتبع هذا الملف المحتوى الذي تمت ترجمته، مما يمنع إعادة الترجمة غير الضرورية في عمليات التشغيل اللاحقة.
مثال
en/example.md
---
title: "Product Launch Guide"
description: "Everything you need to know about our latest product features"
author: "Product Team"
date: 2024-01-15
tags: ["apples", "bananas", "pears"]
---
# Welcome to Our New Dashboard
Discover powerful new features designed to streamline your workflow and boost productivity.
## Getting Started
Follow these simple steps to set up your account and begin using our platform effectively.
---
Our advanced analytics help you make data-driven decisions with confidence.

The intuitive interface makes it easy to navigate between different features and tools.
[View documentation](https://example.com)
Need help getting started? Our support team is available 24/7 to assist you.
***
Join thousands of satisfied customers who have transformed their business with our platform.
es/example.md
---
title: Guía de lanzamiento de producto
description: Todo lo que necesitas saber sobre las últimas características de
nuestro producto
author: Equipo de producto
date: 2024-01-15
tags:
- apples
- bananas
- pears
---
# Bienvenido a nuestro nuevo panel de control
Descubre nuevas y potentes funciones diseñadas para optimizar tus flujos de trabajo y aumentar la productividad.
## Primeros pasos
Sigue estos sencillos pasos para configurar tu cuenta y comenzar a utilizar nuestra plataforma de manera efectiva.
---
Nuestros análisis avanzados te ayudan a tomar decisiones basadas en datos con confianza.

La interfaz intuitiva facilita la navegación entre diferentes funciones y herramientas.
[Ver documentación](https://example.com)
¿Necesitas ayuda para empezar? Nuestro equipo de soporte está disponible 24/7 para asistirte.
---
Únete a miles de clientes satisfechos que han transformado su negocio con nuestra plataforma.
i18n.json
{
"$schema": "https://lingo.dev/schema/i18n.json",
"version": "1.10",
"locale": {
"source": "en",
"targets": ["es"]
},
"buckets": {
"markdown": {
"include": ["./[locale]/example.md"]
}
}
}
i18n.lock
version: 1
checksums:
eed9ef23a605b747d38b8916cee1d500:
md-section-0: d53f61b8c8922fb62d9df5678d9b44a8
md-section-1: 98aec271471bedce0e12b530c7060827
md-section-2: 9e5a786192608844493dfbb6e4100886
md-section-3: 1a5299c38bb20c1b8af0e64e33d7b2b0
md-section-4: 51adf33450cab2ef392e93147386647c
md-section-5: e56cc804e3e06b5f5fb2484e88c18adc
md-section-6: 0ea86a3338305070c865e8fe138da890
md-section-7: bbabf7f391569a72099001e3d81eb251
md-section-8: 36cbfd93f42528edce4faac2ac3c2c12
md-section-9: a1c50054ab23d70be8d453789b214580
md-section-10: 51adf33450cab2ef392e93147386647c
md-section-11: cb596c9608828f7b87a0ab8fa37beb07
fm-attr-title: f3469c4e3d3377c39a705c844930b3a5
fm-attr-description: 2e988d98001e44997a3f5fa3fb487ca6
fm-attr-author: ec8c8711fce61265a4fe296ce2ba3b6f
fm-attr-tags: 313ac6f17ee08e4f4a6a2ca95e5ae024