SPB Git

Repository Public

multilingual-support.md 9.0 KB 220 lines markdown

1---2title: Multilingual support3url: https://platform.claude.com/docs/en/build-with-claude/multilingual-support4description: Claude excels at tasks across multiple languages, maintaining strong cross-lingual performance relative to English.5---67## Overview89Claude demonstrates robust multilingual capabilities, with particularly strong performance in zero-shot tasks across languages. The model maintains consistent relative performance across both widely spoken and lower-resource languages, making it a reliable choice for multilingual applications.1011Claude is capable in many languages beyond those benchmarked in the following table. Test with any languages relevant to your specific use cases.1213## Performance data1415The following table shows zero-shot chain-of-thought evaluation scores for Claude models across languages, expressed as a percentage relative to English performance (100%):1617| Language                          | Claude Sonnet 4.51 | Claude Haiku 4.51 |18| --------------------------------- | ------------------ | ----------------- |19| English (baseline, fixed to 100%) | 100%               | 100%              |20| Spanish                           | 98.2%              | 96.4%             |21| Portuguese (Brazil)               | 97.8%              | 96.1%             |22| Italian                           | 97.9%              | 96.0%             |23| French                            | 97.5%              | 95.7%             |24| Indonesian                        | 97.3%              | 94.2%             |25| German                            | 97.0%              | 94.3%             |26| Arabic                            | 97.2%              | 92.5%             |27| Chinese (Simplified)              | 96.9%              | 94.2%             |28| Korean                            | 96.7%              | 93.3%             |29| Japanese                          | 96.8%              | 93.5%             |30| Hindi                             | 96.7%              | 92.4%             |31| Bengali                           | 95.4%              | 90.4%             |32| Swahili                           | 91.1%              | 78.3%             |33| Yoruba                            | 79.7%              | 52.7%             |34351 With [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking).3637<Note>38  These metrics are based on [MMLU (Massive Multitask Language Understanding)](https://en.wikipedia.org/wiki/MMLU) English test sets that were translated into 14 additional languages by professional human translators, as documented in [OpenAI's simple-evals repository](https://github.com/openai/simple-evals/blob/main/multilingual_mmlu_benchmark_results.md). The use of human translators for this evaluation ensures high-quality translations, particularly important for languages with fewer digital resources.39</Note>4041***4243## Set the response language4445Claude infers the response language from the conversation, but for production applications you should state the target language explicitly. The most reliable place to do this is the system prompt, which keeps the instruction stable across every turn of a conversation.4647<CodeGroup>48  ```bash cURL49  curl https://api.anthropic.com/v1/messages \50    -H "content-type: application/json" \51    -H "x-api-key: $ANTHROPIC_API_KEY" \52    -H "anthropic-version: 2023-06-01" \53    -d '{54      "model": "claude-opus-5",55      "max_tokens": 1024,56      "system": "Always respond in French, regardless of the language the user writes in.",57      "messages": [58        {"role": "user", "content": "How do I reset my password?"}59      ]60    }'61  ```6263  ```bash CLI64  ant messages create \65    --model claude-opus-5 \66    --max-tokens 1024 \67    --system "Always respond in French, regardless of the language the user writes in." \68    --message '{role: user, content: "How do I reset my password?"}'69  ```7071  ```python Python72  client = anthropic.Anthropic()7374  message = client.messages.create(75      model="claude-opus-5",76      max_tokens=1024,77      system="Always respond in French, regardless of the language the user writes in.",78      messages=[{"role": "user", "content": "How do I reset my password?"}],79  )8081  print(message.content)82  ```8384  ```typescript TypeScript85  const client = new Anthropic();8687  const message = await client.messages.create({88    model: "claude-opus-5",89    max_tokens: 1024,90    system: "Always respond in French, regardless of the language the user writes in.",91    messages: [{ role: "user", content: "How do I reset my password?" }]92  });9394  console.log(message.content);95  ```9697  ```csharp C#98  AnthropicClient client = new();99100  var parameters = new MessageCreateParams101  {102      Model = Model.ClaudeOpus5,103      MaxTokens = 1024,104      System = "Always respond in French, regardless of the language the user writes in.",105      Messages =106      [107          new() { Role = Role.User, Content = "How do I reset my password?" }108      ]109  };110111  var message = await client.Messages.Create(parameters);112  Console.WriteLine(message);113  ```114115  ```go Go116  client := anthropic.NewClient()117118  message, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{119  	Model:     anthropic.ModelClaudeOpus5,120  	MaxTokens: 1024,121  	System: []anthropic.TextBlockParam{122  		{Text: "Always respond in French, regardless of the language the user writes in."},123  	},124  	Messages: []anthropic.MessageParam{125  		anthropic.NewUserMessage(anthropic.NewTextBlock("How do I reset my password?")),126  	},127  })128  if err != nil {129  	log.Fatal(err)130  }131  fmt.Println(message.Content)132  ```133134  ```java Java135  AnthropicClient client = AnthropicOkHttpClient.fromEnv();136137  MessageCreateParams params = MessageCreateParams.builder()138      .model(Model.CLAUDE_OPUS_5)139      .maxTokens(1024)140      .system("Always respond in French, regardless of the language the user writes in.")141      .addUserMessage("How do I reset my password?")142      .build();143144  Message message = client.messages().create(params);145  System.out.println(message.content());146  ```147148  ```php PHP149  $client = new Client();150151  $message = $client->messages->create(152      maxTokens: 1024,153      messages: [154          ['role' => 'user', 'content' => 'How do I reset my password?']155      ],156      model: 'claude-opus-5',157      system: 'Always respond in French, regardless of the language the user writes in.',158  );159160  echo json_encode($message->content, JSON_PRETTY_PRINT), PHP_EOL;161  ```162163  ```ruby Ruby164  client = Anthropic::Client.new165166  message = client.messages.create(167    model: "claude-opus-5",168    max_tokens: 1024,169    system: "Always respond in French, regardless of the language the user writes in.",170    messages: [171      { role: "user", content: "How do I reset my password?" }172    ]173  )174175  puts message.content176  ```177</CodeGroup>178179If your application lets users pick a language at runtime, interpolate that choice into the system prompt rather than relying on Claude to infer it from the user's message. To translate between two specific languages, name both: `Translate the user's message from German to Korean. Respond with only the translation.`180181***182183## Best practices184185When working with multilingual content:1861871. **Provide clear language context:** Although Claude can detect the target language automatically, explicitly stating the desired input and output languages improves reliability. For enhanced fluency, you can prompt Claude to use "idiomatic speech as if it were a native speaker."1882. **Use native scripts:** Submit text in its native script rather than transliteration for optimal results.1893. **Consider cultural context:** Effective communication often requires cultural and regional awareness beyond pure translation.190191Also follow the general guidance in [Prompt engineering overview](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview) to further improve output quality.192193***194195## Language support considerations196197* Claude processes input and generates output in most world languages that use standard Unicode characters.198* Performance varies by language, with particularly strong capabilities in widely spoken languages.199* Even in languages with fewer digital resources, Claude maintains meaningful capabilities.200201## Next steps202203<CardGroup cols={2}>204  <Card title="Prompt engineering overview" icon="edit" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview">205    Apply general prompting techniques to improve multilingual output quality.206  </Card>207208  <Card title="Customer support agent" icon="headset" href="https://platform.claude.com/docs/en/about-claude/use-case-guides/customer-support-chat">209    Build a localized support chatbot using a language-constrained system prompt.210  </Card>211212  <Card title="Models overview" icon="table" href="https://platform.claude.com/docs/en/models/overview">213    Compare model tiers to balance multilingual quality against cost and latency.214  </Card>215216  <Card title="Define success criteria and build evaluations" icon="scales" href="https://platform.claude.com/docs/en/test-and-evaluate/develop-tests">217    Evaluate translation and localization quality before you ship.218  </Card>219</CardGroup>220
Files main
Menu

Theme