Locales for output document

WordProcessingSaveOptions class contains 3 very similar properties of the same type System.Globalization.CultureInfo:

public java.util.Locale getLocale()
public void setLocale(java.util.Locale)

public java.util.Locale getLocaleBi()
public void setLocaleBi(java.util.Locale)

public java.util.Locale getLocaleFarEast()
public void setLocaleFarEast(java.util.Locale)

In most cases the output WordProcessing document, which is generated from the EditableDocument instance by the `editor.Save() method, contains valid locales for the textual content. But in some cases it is necessary to forcibly and explicitly set a some specific locale for the output document. These three options provide such possibility. However keep in mind that they are suitable only when document should have some single locale. If document is multi-language and contains, for example, English and Spanish text, setting the locale to English (“en-GB”, for example) will mark the Spanish text as English too, so spell checking in MS Word, for example, will not work properly for such text.

By default all these three locale-related properties are not specified, their values are NULL. In such case MS Word (or other program) will detect (or choose) the document locale according to its own settings or other factors. Additionally, if document is multi-language, it is strongly encouraged to enable the EnableLanguageInformation property in the WordProcessingEditOptions class while editing original document, and not to use these 3 properties.

The Locale property is intended to set the locale for usual left-to-right text, which consists of letters.
The LocaleBi property should be used when text is right-to-left (RTL), for example, Arabic script or Hebrew alphabet.
The LocaleFarEast property should be used for East-Asian (Far-East) text, including CJK characters.

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App

Along with full-featured Java library we provide simple but powerful free Apps.
You are welcome to edit your Microsoft Word (DOC, DOCX, RTF etc.), Microsoft Excel (XLS, XLSX, CSV etc.), Open Document (ODT, OTT, ODS) and other documents with free to use online GroupDocs Editor App.