Microsoft Co-Op Translator เป็นเครื่องมือแปลเอกสาร Markdown ที่ทรงพลังและใช้งานง่าย คู่มือนี้จะช่วยคุณแก้ไขปัญหาทั่วไปที่อาจพบขณะใช้งานเครื่องมือนี้
ปัญหา: เอกสาร Markdown ที่แปลแล้วมีแท็ก markdown อยู่ด้านบน ทำให้แสดงผลผิดปกติ
วิธีแก้ไข: เพียงลบแท็ก markdown ที่อยู่ด้านบนสุดของไฟล์ออก ก็จะแสดงผล Markdown ได้ถูกต้อง
ขั้นตอน:
.md) ที่แปลแล้วmarkdown ที่อยู่ด้านบนสุดของเอกสารmarkdown ออกปัญหา: URL ของรูปภาพที่ฝังไว้ไม่ตรงกับภาษาของเอกสาร ทำให้รูปภาพแสดงผิดหรือไม่แสดง
วิธีแก้ไข: ตรวจสอบ URL ของรูปภาพที่ฝังไว้ให้ตรงกับภาษาของเอกสาร รูปภาพทั้งหมดจะอยู่ในโฟลเดอร์ translated_images และชื่อไฟล์จะมีแท็กภาษากำกับ
ขั้นตอน:
ปัญหา: เนื้อหาที่แปลยังไม่ถูกต้องหรือจำเป็นต้องแก้ไขเพิ่มเติม
วิธีแก้ไข: ตรวจทานเอกสารที่แปลแล้วและแก้ไขให้ถูกต้องและอ่านเข้าใจง่ายขึ้น
ขั้นตอน:
หากรูปภาพหรือข้อความไม่ได้แปลเป็นภาษาที่ถูกต้อง และเมื่อรันในโหมด -d debug แล้วพบ error 401 นี่คือปัญหาการยืนยันตัวตน — อาจเป็นเพราะคีย์ไม่ถูกต้อง หมดอายุ หรือไม่ได้เชื่อมกับ region ของ endpoint
ให้รัน co-op translator พร้อม สวิตช์ -d debug เพื่อดูสาเหตุที่แท้จริง
Access denied due to invalid subscription key or wrong API endpoint.Resource Type
Azure AI services → Visionตั้งแต่ระบบ selective translation ใหม่ Co-op Translator จะแจ้ง error ชัดเจนเมื่อยังไม่ได้ตั้งค่าบริการที่จำเป็น
ปัญหา: คุณร้องขอให้แปลรูปภาพ (-img flag) แต่ยังไม่ได้ตั้งค่า Azure AI Service
ข้อความ Error:
Error: Image translation requested but Azure AI Service is not configured.
Please add AZURE_AI_SERVICE_API_KEY and AZURE_AI_SERVICE_ENDPOINT to your .env file.
Check Azure AI Service availability and configuration.
วิธีแก้ไข:
AZURE_AI_SERVICE_API_KEY ในไฟล์ .envAZURE_AI_SERVICE_ENDPOINT ในไฟล์ .env# Instead of: translate -l "ko" -img
# Use: translate -l "ko" -md
ปัญหา: ยังไม่ได้ตั้งค่า LLM ที่จำเป็น
ข้อความ Error:
Error: No language model configuration found.
Please configure either Azure OpenAI or OpenAI in your .env file.
วิธีแก้ไข:
.env มีการตั้งค่า LLM อย่างน้อยหนึ่งแบบดังนี้:
AZURE_OPENAI_API_KEY และ AZURE_OPENAI_ENDPOINTOPENAI_API_KEYคุณต้องตั้งค่าอย่างใดอย่างหนึ่งระหว่าง Azure OpenAI หรือ OpenAI
ปัญหา: ไม่มีไฟล์ใดถูกแปลทั้งที่คำสั่งสำเร็จ
สาเหตุที่เป็นไปได้:
-md, -img, -nb)วิธีแก้ไข:
translate -l "ko" -md -d
# For markdown files
find . -name "*.md" -not -path "./translations/*"
# For notebooks
find . -name "*.ipynb" -not -path "./translations/*"
# For images
find . -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -not -path "./translations/*"
# Translate everything (default)
translate -l "ko"
# Translate specific types
translate -l "ko" -md -img
ปัญหา: คำสั่งที่เคย fallback เป็น markdown-only อัตโนมัติจะไม่ทำงานแบบเดิมอีกต่อไป
พฤติกรรมเดิม:
# This used to automatically switch to markdown-only mode
translate -l "ko" # (when Azure AI Vision was not configured)
พฤติกรรมใหม่:
# This now produces an error if image translation is requested but not configured
translate -l "ko" -img
วิธีแก้ไข:
translate -l "ko" -md # Only markdown
translate -l "ko" -md -img # Markdown and images
translate -l "ko" # Everything (if all services configured)
ปัญหา: ลิงก์ในไฟล์ที่แปลแล้วชี้ไปยังตำแหน่งที่ไม่คาดคิด
สาเหตุ: การประมวลผลลิงก์แบบไดนามิกเปลี่ยนไปตามประเภทไฟล์ที่เลือก
วิธีแก้ไข:
-nb: ลิงก์ notebook จะชี้ไปยังไฟล์ที่แปลแล้ว-nb: ลิงก์ notebook จะชี้ไปยังไฟล์ต้นฉบับ-img: ลิงก์รูปภาพจะชี้ไปยังไฟล์ที่แปลแล้ว-img: ลิงก์รูปภาพจะชี้ไปยังไฟล์ต้นฉบับ# All internal links point to translated versions
translate -l "ko" -md -img -nb
# Only markdown translated, other links point to originals
translate -l "ko" -md
อาการ: ใน workflow logs ของ peter-evans/create-pull-request แสดงว่า:
Branch ‘update-translations’ is not ahead of base ‘main’ and will not be created
สาเหตุที่เป็นไปได้:
.gitignore ไม่รวมไฟล์ที่ต้องการ commit (เช่น *.ipynb, translations/, translated_images/)วิธีตรวจสอบ/แก้ไข:
translations/ และ/หรือ translated_images/
.ipynb ถูกเขียนไว้ใน translations/<lang>/....gitignore: อย่า ignore ไฟล์ output ที่สร้างขึ้น ตรวจสอบว่าไม่ได้ ignore:
translations/translated_images/*.ipynb (ถ้าแปล notebook)with:
add-paths: |
translations/
translated_images/
with:
commit-empty: true
-d ในคำสั่งแปลเพื่อดูว่าเจอไฟล์อะไรและเขียนไฟล์อะไรบ้างpermissions:
contents: write
pull-requests: write
เมื่อเจอปัญหาเกี่ยวกับการแปล:
-d เพื่อดู log รายละเอียด-md, -img, -nb ตรงกับที่ต้องการ.env มีคีย์ที่จำเป็นครบ-md อย่างเดียว แล้วค่อยเพิ่มประเภทอื่นดูรายละเอียดเพิ่มเติมเกี่ยวกับคำสั่งและ flag ได้ที่ Command Reference
ข้อจำกัดความรับผิดชอบ: เอกสารฉบับนี้ได้รับการแปลโดยใช้บริการแปลภาษา AI Co-op Translator แม้เราจะพยายามให้การแปลมีความถูกต้อง แต่โปรดทราบว่าการแปลโดยอัตโนมัติอาจมีข้อผิดพลาดหรือความไม่ถูกต้อง เอกสารต้นฉบับในภาษาต้นทางควรถือเป็นแหล่งข้อมูลที่เชื่อถือได้ สำหรับข้อมูลสำคัญ ขอแนะนำให้ใช้บริการแปลโดยนักแปลมืออาชีพ ทางเราจะไม่รับผิดชอบต่อความเข้าใจผิดหรือการตีความที่เกิดขึ้นจากการใช้การแปลนี้