# Automate Presentation Localization in Java

> Automate PowerPoint and OpenDocument slide localization in Java with Aspose.Slides, using practical code samples and tips for faster global rollout.

Source: https://docs.aspose.com/slides/java/presentation-localization/
Updated: 2026-08-05


## **Overview**

This article explains how to set the `LanguageId` for text in a presentation by using Aspose.Slides. It shows how to open a presentation, add a shape with text, assign a language identifier to a text portion, and save the result as a PPTX file.

## **Change Language for a Presentation and Shape Text**
- Create an instance of [Presentation](https://reference.aspose.com/slides/java/com.aspose.slides/Presentation) class.
- Obtain the reference of a slide by using its Index.
- Add an [IAutoShape](https://reference.aspose.com/slides/java/com.aspose.slides/IAutoShape) of [Rectangle](https://reference.aspose.com/slides/java/com.aspose.slides/ShapeType#Rectangle) type to the slide.
- Add some text to the TextFrame.
- [Setting Language Id](https://reference.aspose.com/slides/java/com.aspose.slides/IBasePortionFormat#setLanguageId-java.lang.String-) to text.
- Write the presentation as a PPTX file.

The implementation of the above steps is demonstrated below in an example.

```java
import com.aspose.slides.*;

Presentation pres = new Presentation("test.pptx");
try {
    IAutoShape shape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 50, 50, 200, 50);
    shape.addTextFrame("Text to apply spellcheck language");

    shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().setLanguageId("en-US");

    pres.save("output.pptx", SaveFormat.Pptx);
} finally {
    if (pres != null) pres.dispose();
}
```

## **FAQ**

### Does language ID trigger automatic text translation?

No. [Language ID](https://reference.aspose.com/slides/java/com.aspose.slides/baseportionformat/#setLanguageId-java.lang.String-) in Aspose.Slides stores the language for spell-checking and grammar proofing, but it does not translate or change the text content. It is metadata that PowerPoint understands for proofing.

### Does language ID affect hyphenation and line breaks during rendering?

In Aspose.Slides, [language ID](https://reference.aspose.com/slides/java/com.aspose.slides/baseportionformat/#setLanguageId-java.lang.String-) is for proofing. Hyphenation quality and line wrapping primarily depend on the availability of [proper fonts](/slides/java/powerpoint-fonts/) and layout/line-break settings for the writing system. To ensure correct rendering, make the required fonts available, configure [font substitution rules](/slides/java/font-substitution/), and/or [embed fonts](/slides/java/embedded-font/) into the presentation.

### Can I set different languages within a single paragraph?

Yes. [Language ID](https://reference.aspose.com/slides/java/com.aspose.slides/baseportionformat/#setLanguageId-java.lang.String-) is applied at the text portion level, so a single paragraph can mix multiple languages with distinct proofing settings.

