Apri una pull request dopo ogni run
- 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: traduzione scope per pacchetto
with: sourceLocale: en include: | apps/web/**/*.en.resx packages/shared/**/*.en.json exclude: | **/dist/** **/__tests__/**Glossario per nomi di marchi e termini di prodotto
Inserisce un .github/resource-translator.yml nel repository:
glossary: Acme: Contoso Octocat: Octocat ".NET": ".NET" "C++": "C++"I termini del glossario vengono applicati dopo traduzione, quindi l'output tradotto automaticamente mantiene il tuo marchio preferito anche quando il modello lo ha sostituito con un sinonimo.
Categoria Traduttore personalizzato (settore / dominio)
with: sourceLocale: en subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} categoryId: 1234abcd-5678-90ef-... Addestra una categoria Azure Custom Translator su un corpus che cattura il vocabolario e il tono del tuo settore (legale, medico, marketing, ingegneria interna, ecc.) e supera il suo ID tramite categoryId. Questa è la leva tonale più potente che Azure offre.
Controllo del tono + fallback rigoroso
# .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 Combina un categoryId Traduttore Personalizzato con profanityAction e allowFallback: false per imporre una voce coerente e fallire il flusso di lavoro se la categoria scelta non ha un deployment per una delle tue località target.
Prova preliminare prima di attivare il flusso di lavoro
with: dryRun: true failOnError: false L'azione continua a emettere output riassuntivi e un riassunto dei passaggi, ma non vengono scritti file. Combina con failOnError: false per mettere in evidenza ogni problema come avvertimento mentre iteri.