List Supported languages Stay organized with collections Save and categorize content based on your preferences.
This guide describes how to use your preferred version of the Cloud Translation API tolistsupported languages.
Before you begin
Before you can start using the Cloud Translation API, you must have a project that hasthe Cloud Translation API enabled, and you must have the appropriate credentials. You canalso install client libraries for common programming languages to help you makecalls to the API. For more information, see theSetup page.
Choose your preferred API version:
List supported languages {:id="supported-languages"}
REST
To get a list of all supported languages, make aGET request to thehttps://translation.googleapis.com/v3/projects/project-number-or-id/locations/location/supportedLanguages URL.The following shows an example of aGET request usingcurl and PowerShell. The example uses the access token for a service accountset up for the project using the Google CloudGoogle Cloud CLI.For instructions on installing the Google Cloud CLI,setting up a project with a service account, and obtaining an access token,see theSetup page.
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER_OR_ID: the numeric or alphanumeric ID of your Google Cloud project
HTTP method and URL:
GET https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/global/supportedLanguages
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project:PROJECT_NUMBER_OR_ID" \
"https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/global/supportedLanguages"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "PROJECT_NUMBER_OR_ID" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/global/supportedLanguages" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "languages": [ "languageCode": "af", "supportSource": true, "supportTarget": true }, { "languageCode": "am", "supportSource": true, "supportTarget": true }, { "languageCode": "ar", "supportSource": true, "supportTarget": true }, .... { "languageCode": "zu", "supportSource": true, "supportTarget": true } ]}The list is sorted alphabetically by language code. This query returns ISO-639language codes for supported languages. Some language codes also include acountry code, like zh-CN or zh-TW. For example:
{ "languageCode": "zh-TW", "supportSource": true, "supportTarget": true },Go
Before trying this sample, follow theGo setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationGo API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
import("context""fmt""io"translate"cloud.google.com/go/translate/apiv3""cloud.google.com/go/translate/apiv3/translatepb")// getSupportedLanguages gets a list of supported language codes.funcgetSupportedLanguages(wio.Writer,projectIDstring)error{// projectID := "my-project-id"ctx:=context.Background()client,err:=translate.NewTranslationClient(ctx)iferr!=nil{returnfmt.Errorf("NewTranslationClient: %w",err)}deferclient.Close()req:=&translatepb.GetSupportedLanguagesRequest{Parent:fmt.Sprintf("projects/%s/locations/global",projectID),}resp,err:=client.GetSupportedLanguages(ctx,req)iferr!=nil{returnfmt.Errorf("GetSupportedLanguages: %w",err)}// List language codes of supported languagesfmt.Fprintf(w,"Supported languages:\n")for_,language:=rangeresp.GetLanguages(){fmt.Fprintf(w,"Language code: %v\n",language.GetLanguageCode())}returnnil}Java
Before trying this sample, follow theJava setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationJava API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
importcom.google.cloud.translate.v3.GetSupportedLanguagesRequest;importcom.google.cloud.translate.v3.LocationName;importcom.google.cloud.translate.v3.SupportedLanguage;importcom.google.cloud.translate.v3.SupportedLanguages;importcom.google.cloud.translate.v3.TranslationServiceClient;importjava.io.IOException;publicclassGetSupportedLanguages{publicstaticvoidgetSupportedLanguages()throwsIOException{// TODO(developer): Replace these variables before running the sample.StringprojectId="YOUR-PROJECT-ID";getSupportedLanguages(projectId);}// Getting a list of supported language codespublicstaticvoidgetSupportedLanguages(StringprojectId)throwsIOException{// Initialize client that will be used to send requests. This client only needs to be created// once, and can be reused for multiple requests. After completing all of your requests, call// the "close" method on the client to safely clean up any remaining background resources.try(TranslationServiceClientclient=TranslationServiceClient.create()){// Supported Locations: `global`, [glossary location], or [model location]// Glossaries must be hosted in `us-central1`// Custom Models must use the same location as your model. (us-central1)LocationNameparent=LocationName.of(projectId,"global");GetSupportedLanguagesRequestrequest=GetSupportedLanguagesRequest.newBuilder().setParent(parent.toString()).build();SupportedLanguagesresponse=client.getSupportedLanguages(request);// List language codes of supported languagesfor(SupportedLanguagelanguage:response.getLanguagesList()){System.out.printf("Language Code: %s\n",language.getLanguageCode());}}}}Node.js
Before trying this sample, follow theNode.js setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationNode.js API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
/** * TODO(developer): Uncomment these variables before running the sample. */// const projectId = 'YOUR_PROJECT_ID';// const location = 'global';// Imports the Google Cloud Translation libraryconst{TranslationServiceClient}=require('@google-cloud/translate');// Instantiates a clientconsttranslationClient=newTranslationServiceClient();asyncfunctiongetSupportedLanguages(){// Construct requestconstrequest={parent:`projects/${projectId}/locations/${location}`,};// Get supported languagesconst[response]=awaittranslationClient.getSupportedLanguages(request);for(constlanguageofresponse.languages){// Supported language code, generally consisting of its ISO 639-1 identifier, for// example, 'en', 'ja'. In certain cases, BCP-47 codes including language and// region identifiers are returned (for example, 'zh-TW' and 'zh-CN')console.log(`Language - Language Code:${language.languageCode}`);// Human readable name of the language localized in the display language specified// in the request.console.log(`Language - Display Name:${language.displayName}`);// Can be used as source language.console.log(`Language - Support Source:${language.supportSource}`);// Can be used as target language.console.log(`Language - Support Target:${language.supportTarget}`);}}getSupportedLanguages();Python
Before trying this sample, follow thePython setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationPython API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
fromgoogle.cloudimporttranslatedefget_supported_languages(project_id:str="YOUR_PROJECT_ID",)->translate.SupportedLanguages:"""Getting a list of supported language codes. Args: project_id: The GCP project ID. Returns: A list of supported language codes. """client=translate.TranslationServiceClient()parent=f"projects/{project_id}"# Supported language codes: https://cloud.google.com/translate/docs/languagesresponse=client.get_supported_languages(parent=parent)# List language codes of supported languages.print("Supported Languages:")forlanguageinresponse.languages:print(f"Language Code:{language.language_code}")returnresponseAdditional languages
C#: Please follow theC# setup instructions on the client libraries page and then visit theCloud Translation reference documentation for .NET.
PHP: Please follow thePHP setup instructions on the client libraries page and then visit theCloud Translation reference documentation for PHP.
Ruby: Please follow theRuby setup instructions on the client libraries page and then visit theCloud Translation reference documentation for Ruby.
List supported languages with target language name
REST
Here is another example that returns the list of supported languages with thereturned language names written in the specified target language. The returnedlist is sorted alphabetically according to the target language.
Before using any of the request data, make the following replacements:
- PROJECT_NUMBER_OR_ID: the numeric or alphanumeric ID of your Google Cloud project
HTTP method and URL:
GET https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/global/supportedLanguages?display_language_code=sq
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "x-goog-user-project:PROJECT_NUMBER_OR_ID" \
"https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/global/supportedLanguages?display_language_code=sq"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "PROJECT_NUMBER_OR_ID" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://translation.googleapis.com/v3/projects/PROJECT_NUMBER_OR_ID/locations/global/supportedLanguages?display_language_code=sq" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "languages": [{ "languageCode": "af", "displayName": "Afrikanisht", "supportSource": true, "supportTarget": true }, { "languageCode": "am", "displayName": "Amarikisht", "supportSource": true, "supportTarget": true }, { "languageCode": "en", "displayName": "Anglisht", "supportSource": true, "supportTarget": true }, ...{ "languageCode": "zu", "displayName": "Zulu", "supportSource": true, "supportTarget": true }]}In this case, the query returns the same language codes as above, along withname strings that give the names of the languages written in the targetlanguage. In this example, the language is Albanian (sq).
Go
Before trying this sample, follow theGo setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationGo API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
import("context""fmt""io"translate"cloud.google.com/go/translate/apiv3""cloud.google.com/go/translate/apiv3/translatepb")// getSupportedLanguagesForTarget gets a list of supported language codes with target language names.funcgetSupportedLanguagesForTarget(wio.Writer,projectIDstring,languageCodestring)error{// projectID := "my-project-id"// languageCode := "is"ctx:=context.Background()client,err:=translate.NewTranslationClient(ctx)iferr!=nil{returnfmt.Errorf("NewTranslationClient: %w",err)}deferclient.Close()req:=&translatepb.GetSupportedLanguagesRequest{Parent:fmt.Sprintf("projects/%s/locations/global",projectID),DisplayLanguageCode:languageCode,}resp,err:=client.GetSupportedLanguages(ctx,req)iferr!=nil{returnfmt.Errorf("GetSupportedLanguages: %w",err)}// List language codes of supported languagesfmt.Fprintf(w,"Supported languages:\n")for_,language:=rangeresp.GetLanguages(){fmt.Fprintf(w,"Language code: %v\n",language.GetLanguageCode())fmt.Fprintf(w,"Display name: %v\n",language.GetDisplayName())}returnnil}Java
Before trying this sample, follow theJava setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationJava API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
importcom.google.cloud.translate.v3.GetSupportedLanguagesRequest;importcom.google.cloud.translate.v3.LocationName;importcom.google.cloud.translate.v3.SupportedLanguage;importcom.google.cloud.translate.v3.SupportedLanguages;importcom.google.cloud.translate.v3.TranslationServiceClient;importjava.io.IOException;publicclassGetSupportedLanguagesForTarget{publicstaticvoidgetSupportedLanguagesForTarget()throwsIOException{// TODO(developer): Replace these variables before running the sample.StringprojectId="YOUR-PROJECT-ID";// Supported Languages: https://cloud.google.com/translate/docs/languagesStringlanguageCode="your-language-code";getSupportedLanguagesForTarget(projectId,languageCode);}// Listing supported languages with target language namepublicstaticvoidgetSupportedLanguagesForTarget(StringprojectId,StringlanguageCode)throwsIOException{// Initialize client that will be used to send requests. This client only needs to be created// once, and can be reused for multiple requests. After completing all of your requests, call// the "close" method on the client to safely clean up any remaining background resources.try(TranslationServiceClientclient=TranslationServiceClient.create()){// Supported Locations: `global`, [glossary location], or [model location]// Glossaries must be hosted in `us-central1`// Custom Models must use the same location as your model. (us-central1)LocationNameparent=LocationName.of(projectId,"global");GetSupportedLanguagesRequestrequest=GetSupportedLanguagesRequest.newBuilder().setParent(parent.toString()).setDisplayLanguageCode(languageCode).build();SupportedLanguagesresponse=client.getSupportedLanguages(request);// List language codes of supported languagesfor(SupportedLanguagelanguage:response.getLanguagesList()){System.out.printf("Language Code: %s\n",language.getLanguageCode());System.out.printf("Display Name: %s\n",language.getDisplayName());}}}}Node.js
Before trying this sample, follow theNode.js setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationNode.js API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
/** * TODO(developer): Uncomment these variables before running the sample. */// const projectId = 'YOUR_PROJECT_ID';// const location = 'global';// Imports the Google Cloud Translation libraryconst{TranslationServiceClient}=require('@google-cloud/translate');// Instantiates a clientconsttranslationClient=newTranslationServiceClient();asyncfunctiongetSupportedLanguages(){// Construct requestconstrequest={parent:`projects/${projectId}/locations/${location}`,displayLanguageCode:'en',};// Get supported languagesconst[response]=awaittranslationClient.getSupportedLanguages(request);for(constlanguageofresponse.languages){// Supported language code, generally consisting of its ISO 639-1 identifier, for// example, 'en', 'ja'. In certain cases, BCP-47 codes including language and// region identifiers are returned (for example, 'zh-TW' and 'zh-CN')console.log(`Language - Language Code:${language.languageCode}`);// Human readable name of the language localized in the display language specified// in the request.console.log(`Language - Display Name:${language.displayName}`);// Can be used as source language.console.log(`Language - Support Source:${language.supportSource}`);// Can be used as target language.console.log(`Language - Support Target:${language.supportTarget}`);}}getSupportedLanguages();Python
Before trying this sample, follow thePython setup instructions in theCloud Translation quickstart using client libraries. For more information, see theCloud TranslationPython API reference documentation.
To authenticate to Cloud Translation, set up Application Default Credentials. For more information, seeSet up authentication for a local development environment.
fromgoogle.cloudimporttranslatedefget_supported_languages_with_target(project_id:str="YOUR_PROJECT_ID",)->translate.SupportedLanguages:"""Listing supported languages with target language name. Args: project_id: Your Google Cloud project ID. Returns: Supported languages. """client=translate.TranslationServiceClient()location="global"parent=f"projects/{project_id}/locations/{location}"# Supported language codes: https://cloud.google.com/translate/docs/languagesresponse=client.get_supported_languages(display_language_code="is",parent=parent# target language code)# List language codes of supported languagesforlanguageinresponse.languages:print(f"Language Code:{language.language_code}")print(f"Display Name:{language.display_name}")returnresponseAdditional languages
C#: Please follow theC# setup instructions on the client libraries page and then visit theCloud Translation reference documentation for .NET.
PHP: Please follow thePHP setup instructions on the client libraries page and then visit theCloud Translation reference documentation for PHP.
Ruby: Please follow theRuby setup instructions on the client libraries page and then visit theCloud Translation reference documentation for Ruby.
Additional resources
- For help on resolving common issues or errors, see theTroubleshooting page.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.