Step 1: ᠨᠢᠭᠡ ᠣᠷᠴᠢᠭᠤᠯᠤᠭᠴᠢ ᠰᠣᠩᠭᠣᠬᠤ
ᠡᠨᠡ ᠠᠵᠢᠯᠯᠠᠭᠠ ᠨᠢ ᠨᠢᠭᠡ Azure AI Translator API ᠂ AWS Translate ᠂ Google ᠡᠭᠦᠯᠡᠨ ᠣᠷᠴᠢᠭᠤᠯᠭᠠ ᠢᠶᠠᠷ ᠠᠵᠢᠯᠯᠠᠨᠠ ᠃ ᠨᠢᠭᠡ ᠤᠳᠠᠭᠠ ᠳᠤ ᠨᠢᠭᠡ ᠬᠠᠩᠭᠠᠭᠴᠢ ᠰᠤᠩᠭ᠋ᠤᠨᠠ ᠂ ᠣᠷᠴᠢᠮ provider ᠢᠶᠠᠷ ᠨᠢᠭᠡ ᠬᠠᠩᠭᠠᠭᠴᠢ ᠶᠢ ᠰᠤᠩᠭ᠋ᠤᠨᠠ ᠂ ᠠᠵᠢᠯ ᠤᠨ ᠶᠠᠪᠤᠴᠠ ᠨᠢ ᠬᠠᠩᠭᠠᠭᠴᠢ ᠶᠢ ᠬᠠᠮᠢᠶᠠᠷᠬᠤ ᠦᠭᠡᠢ ᠂ ᠠᠵᠢᠯ ᠤᠨ ᠶᠠᠪᠤᠴᠠ ᠨᠢ ᠪᠦᠷ ᠠᠳᠠᠯᠢᠬᠠᠨ ᠪᠠᠶᠢᠳᠠᠭ ᠃ ᠵᠦᠪᠬᠡᠨ ᠭᠡᠷᠡᠴᠢ ᠦᠨᠡᠮᠯᠡᠯ ᠨᠢ ᠠᠳᠠᠯᠢ ᠦᠭᠡᠢ᠃ ᠲᠠᠨ ᠤ ᠣᠷᠴᠢᠭᠤᠯᠤᠭᠴᠢ ᠳᠤ ᠨᠠᠷᠢᠨ ᠠᠳᠠᠯᠢᠳᠬᠠᠵᠤ ᠦᠵᠡ ᠃
Step 2: ᠭᠡᠷᠡᠴᠢ ᠪᠠᠷᠢᠮᠲᠠ ᠪᠣᠯᠣᠨ ᠠᠵᠢᠯ ᠤᠨ ᠵᠢᠭ᠌ᠰᠠᠭᠠ ᠨᠡᠮᠡᠬᠦ
ᠲᠠᠨ ᠤ ᠬᠠᠩᠭᠠᠭᠰᠠᠨ ᠲᠠᠨ ᠤ ᠭᠡᠷᠡᠴᠢ ᠦᠨᠡᠮᠯᠡᠯ ᠢ GitHub ᠬᠥᠮᠥᠷᠭᠡ ᠶᠢᠨ ᠨᠢᠭᠤᠴᠠ ᠶᠢ ᠬᠠᠳᠠᠭᠠᠯᠠᠭᠠᠳ ᠳᠠᠬᠢᠨ .github/workflows/translate.yml ᠃ ᠲᠠᠨ ᠤ ᠲᠠᠨ ᠤ ᠬᠠᠩᠭᠠᠭᠰᠠᠨ ᠬᠤᠳᠠᠯᠳᠤᠭᠠᠴᠢᠨ ᠳᠡᠭᠡᠷᠡ ᠰᠣᠩᠭᠣᠵᠤ ᠲᠡᠭᠦᠨ ᠦ ᠲᠤᠰᠭᠠᠢ ᠲᠣᠬᠢᠷᠠᠭᠤᠯᠤᠯᠲᠠ ᠶᠢ ᠠᠪᠤᠶᠠ ᠂ ᠦᠯᠡᠳᠡᠭ᠍ᠰᠡᠨ ᠠᠵᠢᠯ ᠤᠨ ᠶᠠᠪᠤᠴᠠ ᠶᠢᠨ ᠦᠯᠡᠳᠡᠪᠦᠷᠢ ᠨᠢ ᠠᠪ ᠠᠳᠠᠯᠢᠬᠠᠨ ᠃
Azure AI Translator
Azure ᠪᠣᠯ ᠤᠳᠤᠷᠢᠳᠤᠮᠵᠢ ᠶᠢᠨ ᠬᠠᠩᠭ᠋ᠠᠭᠴᠢ ᠪᠣᠯᠣᠨᠠ ᠂ ᠡᠶᠢᠮᠦ provider ᠢ ᠲᠣᠪᠴᠢᠯᠠᠵᠤ ᠪᠣᠯᠣᠨᠠ ᠃ Provision an Azure AI Translator resource in Azure portal, sau đó lưu trữ thông tin đăng nhập:
ᠡᠳᠡᠭᠡᠷ ᠬᠥᠮᠥᠷᠭᠡ ᠶᠢ ᠬᠠᠳᠠᠭᠠᠯᠠᠬᠤ ᠨᠢᠭᠤᠴᠠ ᠪᠣᠯᠭᠠᠬᠤ
TRANSLATOR_KEY— ᠡᠬᠢ ᠪᠠᠶᠠᠯᠢᠭ ᠢ ᠬᠤᠳᠠᠯᠳᠤᠨ ᠠᠪᠬᠤ ᠬᠠᠮᠢᠭᠠ ᠶᠢᠨ ᠬᠥᠮᠥᠷᠭᠡTRANSLATOR_ENDPOINT— 4. ᠭᠠᠵᠠᠷ ᠣᠷᠣᠨ ᠤ ᠲᠡᠭᠦᠰᠬᠡᠯ ᠦᠨ ᠴᠡᠭ URL ᠃TRANSLATOR_REGION— ᠡᠬᠢ ᠪᠠᠶᠠᠯᠢᠭ ᠤᠨ ᠵᠠᠮ ᠤᠨ ᠣᠷᠣᠨ
ᠠᠵᠢᠯ ᠤᠨ ᠬᠠᠪᠲᠠᠰᠤ ᠨᠡᠮᠡᠬᠦ
name: translate
on: push: branches: [main] paths: - "src/**/*.en.resx" - "src/**/*.en.json"
permissions: contents: write pull-requests: write
jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - id: translate uses: IEvangelist/resource-translator@v3 with: provider: | azure: subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} region: ${{ secrets.TRANSLATOR_REGION }} sourceLocale: en toLocales: '["fr","de","es"]' - if: steps.translate.outputs.has-new-translations == 'true' uses: peter-evans/create-pull-request@v7 with: title: ${{ steps.translate.outputs.summary-title }} body: ${{ steps.translate.outputs.summary-details }} branch: machine-translationAWS Translate
provider ᠶᠢ aws ᠪᠣᠯᠭᠠᠬᠤ OIDC ᠢ ᠠᠪᠬᠤ ᠶᠢ ᠳᠤᠷᠠᠲᠠᠢ᠂ aws-actions/configure-aws-credentials ᠤᠷᠲᠤ ᠤᠳᠠᠭᠠᠨ ᠨᠢᠭᠤᠴᠠ ᠨᠢ ᠬᠠᠳᠠᠭᠠᠯᠠᠭᠳᠠᠬᠤ ᠦᠭᠡᠶ᠂ ᠠᠯᠬᠤᠮ ᠳᠠᠷᠠᠭᠠ ᠪᠠᠷ ᠲᠠᠨ ᠳᠤ AWS_REGION ᠭᠠᠷᠭᠠᠨᠠ᠃ ᠲᠠᠢ᠌ᠪᠤᠩ ᠳᠠᠷᠤᠭᠤᠯ ᠢ ᠣᠷᠣᠯᠠᠭᠤᠯᠬᠤ ᠳᠤ ᠂ ᠬᠠᠳᠠᠭᠠᠯᠠᠨᠠ ᠭᠡᠪᠡᠯ ᠄
ᠡᠳᠡᠭᠡᠷ ᠬᠥᠮᠥᠷᠭᠡ ᠶᠢ ᠬᠠᠳᠠᠭᠠᠯᠠᠬᠤ ᠨᠢᠭᠤᠴᠠ ᠪᠣᠯᠭᠠᠬᠤ
AWS_ACCESS_KEY_ID— AWS ចូលប្រើ ᠨᠡᠭᠡᠭᠡᠯᠲᠡ ᠶᠢᠨ លេខសម្គាល់ ᠃AWS_SECRET_ACCESS_KEY— ᠲᠠᠨ ᠤ AWS ᠨᠢᠭᠤᠴᠠ ᠵᠠᠯᠭᠠᠬᠤ ᠨᠡᠭᠡᠭᠡᠯ ᠢ ᠃
ᠨᠢᠭᠡ ᠭᠠᠵᠠᠷ ᠤᠷᠤᠨ ᠬᠡᠵᠢᠶᠡᠳᠡ ᠱᠠᠭᠠᠷᠳᠠᠭᠳᠠᠵᠤ ᠂ awsRegion ᠪᠤᠶᠤ AWS_REGION ᠵᠦᠷᠢᠶᠡᠨ ᠤ ᠬᠡᠮᠵᠢᠶ ᠡ ᠵᠢ ᠦᠯᠡᠳᠡᠭᠡᠬᠦ ᠴᠢᠬᠤᠯᠠᠲᠠᠢ᠃
ᠠᠵᠢᠯ ᠤᠨ ᠬᠠᠪᠲᠠᠰᠤ ᠨᠡᠮᠡᠬᠦ
name: translate
on: push: branches: [main] paths: - "src/**/*.en.resx" - "src/**/*.en.json"
permissions: id-token: write # for aws-actions/configure-aws-credentials (OIDC) contents: write pull-requests: write
jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::123456789012:role/gh-actions-translate aws-region: us-east-1 - id: translate uses: IEvangelist/resource-translator@v3 with: provider: | aws: region: us-east-1 # or rely on AWS_REGION from the step above formality: FORMAL brevity: true sourceLocale: en toLocales: '["fr","de","es"]' - if: steps.translate.outputs.has-new-translations == 'true' uses: peter-evans/create-pull-request@v7 with: title: ${{ steps.translate.outputs.summary-title }} body: ${{ steps.translate.outputs.summary-details }} branch: machine-translationGoogle ᠡᠭᠦᠯᠡᠨ ᠣᠷᠴᠢᠭᠤᠯᠭᠠ
provider ᠶᠢ google ᠪᠣᠯᠭᠠᠬᠤ ᠦᠢᠯᠡᠴᠢᠯᠡᠭᠡᠨ ᠦ ᠳᠠᠩᠰᠠᠨ ᠤ ᠵᠠᠰ ᠤᠨ ᠲᠡᠮᠳᠡᠭ ᠦᠨ ᠭᠡᠷᠡᠴᠢ ᠪᠠᠷᠢᠮᠲᠠ ᠪᠤᠶᠤ API key ᠪᠠᠷ ᠭᠡᠷᠡᠴᠢᠯᠡᠭᠡ ︱ ᠨᠢᠭᠡ ᠵᠦᠢᠯ ᠢ ᠨᠢ ᠣᠨᠣᠪᠴᠢᠲᠠᠢ ᠬᠠᠩᠭᠠᠬᠤ ᠄
ᠡᠳᠡᠭᠡᠷ ᠬᠥᠮᠥᠷᠭᠡ ᠶᠢ ᠬᠠᠳᠠᠭᠠᠯᠠᠬᠤ ᠨᠢᠭᠤᠴᠠ ᠪᠣᠯᠭᠠᠬᠤ
GCP_TRANSLATE_CREDENTIALS— a service-account JSON key (as a JSON string).GCP_TRANSLATE_API_KEY— ᠡᠰᠡᠬᠦᠯᠡ Google Cloud API ᠨᠣᠮᠧᠷ ᠦᠨ ᠭᠣᠪᠢᠭ ᠢ ᠠᠪᠤᠨᠠ ᠃
11 ᠰᠣᠩᠭᠣᠯᠲᠠ googleProjectId ᠦᠨᠡᠮᠯᠡᠯ ᠦᠨ ᠦᠭᠡ ᠡᠴᠡ ᠰᠢᠯᠵᠢᠭᠦᠯᠭ᠍ᠳᠡᠬᠦ ᠦᠶᠡ ᠳᠦ ᠦᠨᠡᠮᠯᠡᠯ ᠡᠴᠡ ᠬᠠᠷᠢᠴᠠᠩᠭᠤᠢ ᠲᠣᠭᠲᠠᠯᠲᠠ ᠪᠣᠯᠣᠨᠠ ᠃
ᠠᠵᠢᠯ ᠤᠨ ᠬᠠᠪᠲᠠᠰᠤ ᠨᠡᠮᠡᠬᠦ
name: translate
on: push: branches: [main] paths: - "src/**/*.en.resx" - "src/**/*.en.json"
permissions: contents: write pull-requests: write
jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - id: translate uses: IEvangelist/resource-translator@v3 with: provider: | google: # Provide EITHER a service-account JSON credential... credentials: ${{ secrets.GCP_TRANSLATE_CREDENTIALS }} # ...OR an API key: # apiKey: ${{ secrets.GCP_TRANSLATE_API_KEY }} model: nmt sourceLocale: en toLocales: '["fr","de","es"]' - if: steps.translate.outputs.has-new-translations == 'true' uses: peter-evans/create-pull-request@v7 with: title: ${{ steps.translate.outputs.summary-title }} body: ${{ steps.translate.outputs.summary-details }} branch: machine-translationStep 3: ᠡᠬᠢ ᠪᠠᠶᠠᠯᠢᠭ ᠤᠨ ᠪᠢᠴᠢᠭ᠌ ᠪᠠᠷᠢᠭᠤᠯᠬᠤ
ᠡᠬᠢ ᠪᠠᠶᠠᠯᠢᠭ ᠤᠨ ᠪᠢᠴᠢᠭ᠌ ᠮᠠᠲ᠋ᠧᠷᠢᠶᠠᠯ ᠨᠢ Name.<sourceLocale>.<ext> ᠵᠤᠷᠰᠢᠯ ᠢ ᠬᠡᠷᠡᠭ᠍ᠯᠡᠨᠡ ᠃ ᠵᠢᠱᠢᠶᠡ ᠪᠡᠷ ᠂ Greetings.en.resx ᠤᠨ Greetings.fr.resx ᠂ Greetings.de.resx ᠬᠥᠶᠦᠭᠰᠡᠭᠡᠷ ᠭᠡᠬᠦ ᠮᠡᠲᠦ ᠃
Step 4: Let smart change detection protect your bill
changeDetection defaults to smart and stores a compact .github/resource-translator-state.json manifest in the repo. Commit that file so future runs can reuse stable translations, preserve manual target edits, and send only new, missing, changed, or settings-invalidated keys to the provider. If localized files already exist, run once with snapshotOnly: true to create the manifest without provider calls.
Step 5: ᠭᠠᠷᠭᠠᠬᠤ ᠬᠡᠮᠵᠢᠶᠡ ᠶᠢ ᠰᠢᠯᠭᠠᠬᠤ
ᠠᠵᠢᠯ ᠤᠨ ᠴᠤᠤᠷᠢᠶᠠᠳᠤᠯᠭᠠ ᠳᠠᠭᠤᠰᠤᠭᠰᠠᠨ ᠤ ᠳᠠᠷᠠᠭᠠ ᠂ ᠡᠨᠡ ᠬᠦᠳᠡᠯᠭᠡᠭᠡᠨ ᠨᠢ 3 ᠭᠠᠷᠭᠠᠬᠤ ᠭᠠᠷᠭᠠᠯᠲᠠ ᠶᠢ ᠢᠯᠡᠷᠡᠭᠦᠯᠵᠦ ᠪᠣᠯᠣᠨᠠ ᠂ summary-title ᠂ summary-details ᠪᠣᠯᠣᠨ has-new-translations ᠃ ᠡᠭᠦᠨ ᠦ ᠬᠠᠮᠲᠤ ᠪᠠᠰᠠ core.summary ᠢᠶᠠᠷ ᠳᠠᠮᠵᠢᠨ ᠲᠡᠮᠳᠡᠭ᠍ᠯᠡᠵᠦ ᠬᠠᠳᠠᠭᠰᠠᠨ ᠳ᠋ᠦᠩᠨᠡᠯᠲᠡ ᠶᠢ ᠠᠵᠢᠯ ᠤᠨ ᠬᠠᠭᠤᠳᠠᠰᠤ ᠳᠤ ᠪᠢᠴᠢᠨᠡ ᠃