تخطَّ إلى المحتوى

يمكنك إدخال إرشادات مخصصة لتحفيز عملية الترجمة. يمكن استخدام هذا لإضافة تعليمات إضافية أو مسرد أو توجيهات أخرى لتحسين جودة الترجمة بشكل عام.

.github/workflows/ct.yml
uses: pelikhan/action-continuous-translation@v0
with:
instructions: Use a casual tone.
.github/workflows/ct.yml
uses: pelikhan/action-continuous-translation@v0
with:
instructions_file: ./instructions.txt

يمكنك أيضًا تحديد تعليمات الترجمة مباشرة في مقدمة المستندات الفردية. يكون هذا مفيدًا عندما تتطلب المستندات المختلفة نهجًا ترجمياً محددًا.

example.md
---
title: "My Document"
translator:
instructions: |
Use formal tone and preserve all technical terms in English.
---
# My Document Content
This document will be translated using the instructions specified in the frontmatter.

يتم تعريف أنواع translator في types.ts. يتم إزالتها من المقدمة قبل بدء الترجمة، لذا فهي لا تؤثر على النتيجة النهائية.

أنواع التكوين
export interface TranslatorConfiguration {
instructions?: string;
}
export interface FrontmatterWithTranslator {
translator?: TranslatorConfiguration;
}

تُطبق التعليمات حسب ترتيب الأولوية التالي:

  1. معامل instructions (أعلى أولوية)
  2. معامل instructions_file
  3. translator.instructions من مقدمة المستند (أقل أولوية)

إذا تم استخدام عدة طرق، فسيتم تطبيق الطريقة ذات الأولوية القصوى فقط.