เปิดคําขอดึงข้อมูลหลังจากการเรียกใช้แต่ละครั้ง
- id: translate uses: IEvangelist/resource-translator@v3 with: sourceLocale: en subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} region: ${{ secrets.TRANSLATOR_REGION }}
- if: steps.translate.outputs.has-new-translations == 'true' uses: peter-evans/create-pull-request@v7 with: branch: machine-translation title: ${{ steps.translate.outputs.summary-title }} body: ${{ steps.translate.outputs.summary-details }} labels: localizationMonorepos: การแปลขอบเขตต่อแพ็คเกจ
with: sourceLocale: en include: | apps/web/**/*.en.resx packages/shared/**/*.en.json exclude: | **/dist/** **/__tests__/**อภิธานศัพท์สําหรับชื่อแบรนด์และข้อกําหนดของผลิตภัณฑ์
วาง .github/resource-translator.yml ลงในที่เก็บ:
glossary: Acme: Contoso Octocat: Octocat ".NET": ".NET" "C++": "C++"คําศัพท์อภิธานศัพท์ถูกนําไปใช้ หลังจาก การแปล ดังนั้นผลลัพธ์ที่แปลด้วยเครื่องจะรักษาแบรนด์ที่คุณต้องการไว้แม้ว่าโมเดลจะเปลี่ยนเป็นคําพ้องความหมายก็ตาม
หมวดหมู่นักแปลแบบกําหนดเอง (อุตสาหกรรม / โดเมน)
with: sourceLocale: en subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} categoryId: 1234abcd-5678-90ef-... ฝึกอบรมหมวดหมู่ Azure Custom Translator บนคลังข้อมูลที่รวบรวมคําศัพท์และโทนเสียงในอุตสาหกรรมของคุณ (กฎหมาย การแพทย์ การตลาด วิศวกรรมภายใน ฯลฯ) และส่ง ID ผ่าน categoryId นี่คือคันโยกโทนที่แข็งแกร่งที่สุดที่ Azure นําเสนอ
การควบคุมโทนเสียง + สํารองที่เข้มงวด
# .github/resource-translator.yml# Industry / domain — choose your tone via a Custom Translator categorycategoryId: legal-en
# Treat profanity strictly for content aimed at younger audiencesprofanityAction: MarkedprofanityMarker: Tag
# Fail the run rather than silently fall back to the general modelallowFallback: false รวม categoryId ตัวแปลแบบกําหนดเองกับ profanityAction และ allowFallback: false เพื่อบังคับใช้เสียงที่สอดคล้องกันและทําให้เวิร์กโฟลว์ล้มเหลวหากหมวดหมู่ที่เลือกไม่มีการปรับใช้สําหรับตําแหน่งที่ตั้งเป้าหมายของคุณ
Dry run ก่อนเปิดเวิร์กโฟลว์
with: dryRun: true failOnError: false การกระทํายังคงส่งผลลัพธ์สรุปและสรุปขั้นตอน แต่ไม่มีการเขียนแฟ้ม รวมกับ failOnError: false เพื่อแสดงทุกปัญหาเป็นคําเตือนในขณะที่คุณทําซ้ํา