E lumellana ka botlalo ka morao: provider e sa fetoheng ho azure, ka hona li-workflows tse teng tsa Azure li lula li sebetsa li sa fetohe — ha ho na liphetoho tse hlokahalang.
Ho khetha mofani
Beha provider input ho azure (default), aws, kapa google, ebe o fana ka mangolo a mofani eo. Ke mofani a le mong feela ea sebelisoang mohala o mong le o mong oa ketso; ketso e fana ka deterministically ho SDK e lumellanang ka mor'a fektheri.
Papiso ea mofani
subscriptionKey, endpoint, region (ka boikhethelo)
OIDC / default chain, kapa awsAccessKeyId + awsSecretAccessKeyKey; awsRegion
googleApiKey OR googleCredentials (JSON ea ak'haonte ea ts'ebeletso)
Azure AI Translator (default)
Mofani ea fosahetseng. Fana ka mohloli oa Azure AI Translator 'me u fetise subscriptionKey, endpoint, le ka boikhethelo region. Ena ke ts'ebetso e ts'oanang le eo li-workflows tse seng li ntse li li sebelisa.
Official Azure docs
jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5
- id: translator uses: IEvangelist/resource-translator@v3 with: provider: | azure: subscriptionKey: ${{ secrets.TRANSLATOR_KEY }} endpoint: ${{ secrets.TRANSLATOR_ENDPOINT }} region: ${{ secrets.TRANSLATOR_REGION }} sourceLocale: en toLocales: '["es","fr","de"]'Phetolelo ea AWS
Sebelisa @aws-sdk/client-translate. Khetha OIDC ka aws-actions/configure-aws-credentials e le hore ho se be liphiri tse phelang nako e telele tse bolokiloeng — ketso e bala ketane ea boitsebahatso ea AWS SDK. Ho seng joalo, fetisa awsAccessKeyId 'me awsSecretAccessKey ka mokhoa o hlakileng. Sebaka se lula se hlokahala, ka awsRegion kapa AWS_REGION tikoloho e fapaneng.
Official AWS docs
- Amazon Translate overview
- TranslateText API reference
- Setting formality
- Using brevity
- Custom terminology
- Parallel data
- Supported languages
OIDC (e khothalletsoa)
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: translator 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: '["es","fr","de"]'Ho sebelisa linotlolo tse sa fetoheng ho fapana le OIDC, tlohela mohato oa aws-actions/configure-aws-credentials ebe o fetisa awsAccessKeyId / awsSecretAccessKey (ka secrets) hammoho le awsRegion.
Phetolelo ea Google Cloud
Sebelisa @google-cloud/translate (v2). Netefatsa ka senotlolo sa API (googleApiKey) kapa setifikeiti sa JSON sa ak'haonte ea ts'ebeletso (googleCredentials). Fana ka e le 'ngoe; googleProjectId ea boikhethelo e kenngoa ho tsoa ho setifikeiti ha e tlositsoe.
Official Google docs
jobs: translate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5
- id: translator 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: '["es","fr","de"]''Mapa oa Sepheo
Li-specifiers tse ikhethileng tsa mofani li behiloe 'mapa moo e lekanang e leng teng. Tse ling kaofela li khutlela ho liphoso tse utloahalang kahoo boits'oaro bo lula bo tsitsitse.
textTypeprofanityActioncategoryIdallowFallbackawsFormalityawsBrevityawsTerminologyNamesawsParallelDataNamesgoogleModelgoogleApiEndpointLikhoutu tsa lehae li fapana ho ea ka mofani
Mofani e mong le e mong o sebelisa likhoutu tsa hae tsa lehae (mohlala, Sechaena se nolofalitsoeng se zh-Hans ho Azure, zh ho AWS le zh-CN ho Google). Likhoutu li feta joalo ka ha li le teng 'me li khanna mabitso a faele e hlahisang, kahoo khetha litekanyetso toLocales mofani oa hau ea khethiloeng a li tšehetsa.