Agor cais tynnu ar ôl pob rhediad
- 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: cyfieithiad cwmpas fesul pecyn
with: sourceLocale: en include: | apps/web/**/*.en.resx packages/shared/**/*.en.json exclude: | **/dist/** **/__tests__/**Geirfa ar gyfer enwau brand a thelerau cynnyrch
Gollyngwch .github/resource-translator.yml i'r depo:
glossary: Acme: Contoso Octocat: Octocat ".NET": ".NET" "C++": "C++"Mae termau geirfa yn cael eu cymhwyso ar ôl cyfieithu, felly mae'r allbwn wedi'i gyfieithu gan beirianyddol yn cadw'ch brand dewisol hyd yn oed pan fydd y model yn ei gyfnewid am gyfystyr.
Categori Cyfieithydd Custom (diwydiant / parth)
with: sourceLocale: en subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} categoryId: 1234abcd-5678-90ef-... Hyfforddi categori Azure Custom Translator ar gorpws sy'n dal geirfa a thôn eich diwydiant (cyfreithiol, meddygol, marchnata, peirianneg fewnol, ac ati) a phasio ei ID trwy categoryId. Dyma'r lifer tôn cryfaf y mae Azure yn ei gynnig.
Rheoli tôn + wrth gefn llym
# .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 Cyfunwch categoryId Cyfieithydd Custom gyda profanityAction a allowFallback: false i orfodi llais cyson a methu'r llif gwaith os nad oes gan y categori a ddewiswyd ddefnydd ar gyfer un o'ch lleoliadau targed.
Rhedeg yn sych cyn troi'r llif gwaith ymlaen
with: dryRun: true failOnError: false Mae'r weithred yn dal i allyrru allbynnau cryno a chrynodeb cam, ond nid oes unrhyw ffeiliau wedi'u hysgrifennu. Cyfunwch â failOnError: false i wynebu pob mater fel rhybudd wrth i chi ailadrodd.