各実行後にプルリクエストを開きます
- 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を組み合わせて一貫した音声を強制し、選択したカテゴリにターゲット地域への展開がなければワークフローが失敗します。
ワークフローをオンにする前にリハーサルを行ってください
with: dryRun: true failOnError: false アクションは依然として要約出力とステップサマリーを出力しますが、ファイルは書き込まれません。failOnError: falseと組み合わせて、反復しながらすべての問題を警告として浮き彫りにしましょう。