Qhib ib qho kev thov rub tom qab txhua khiav
- 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: scope txhais lus ib pob
with: sourceLocale: en include: | apps/web/**/*.en.resx packages/shared/**/*.en.json exclude: | **/dist/** **/__tests__/**Glossary rau hom npe thiab cov khoom lag luam
Poob ib .github/resource-translator.yml rau hauv lub repo:
glossary: Acme: Contoso Octocat: Octocat ".NET": ".NET" "C++": "C++"Glossary cov ntsiab lus yog siv tom qab txhais lus, li ntawd, lub tshuab-txhais tso zis khaws koj nyiam branding txawm thaum tus qauv swapped nws rau ib tug synonym.
Kev cai txhais lus qeb (kev lag luam / domain)
with: sourceLocale: en subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} categoryId: 1234abcd-5678-90ef-... Cob qhia ib qho Azure Custom Translator qeb ntawm lub corpus uas ntes koj cov lus lag luam thiab lub suab nrov (kev cai lij choj, kev kho mob, kev lag luam, sab hauv-engineering, thiab lwm yam) thiab dhau nws tus ID los ntawm categoryId. Qhov no yog qhov muaj zog tshaj plaws tone lever Azure muab.
Tone tswj + nruj rov qab
# .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 Ua ke ib qho kev cai txhais lus categoryId profanityAction thiab allowFallback: false kom tswj hwm lub suab zoo ib yam thiab ua tsis tiav kev ua haujlwm yog tias qeb xaiv tsis muaj kev xa tawm rau ib qho ntawm koj lub hom phiaj hauv zos.
Qhuav khiav ua ntej tig lub workflow rau
with: dryRun: true failOnError: false Qhov kev txiav txim tseem emits cov ntsiab lus thiab ib kauj ruam ntsiab lus, tab sis tsis muaj ntaub ntawv sau. Ua ke nrog failOnError: false kom nto txhua qhov teeb meem raws li kev ceeb toom thaum koj rov ua dua.