Document extends OdfSchemaDocument implements TableContainer { public void setLocale(Locale locale) { setLocale(locale, getScriptType(locale)); } protected  Document(OdfPackage pkg, String internalPath, OdfMediaType mediaType); static Document loadDocument(String documentPath, String password); static Document loadDocument(String documentPath); static Document loadDocument(InputStream inStream); static Document loadDocument(File file); static Document loadDocument(File file, String password); static Document loadDocument(OdfPackage odfPackage); static Document loadDocument(OdfPackage odfPackage, String internalPath); void setPassword(String password); Document getEmbeddedDocument(String documentPath); List<Document> getEmbeddedDocuments(); List<Document> getEmbeddedDocuments(OdfMediaType mediaType); void insertDocument(OdfPackageDocument sourceDocument, String documentPath); Meta getOfficeMetadata(); void save(OutputStream out); void save(File file); void save(File file, String password); @Override void close(); OdfElement getContentRoot(); @Override String toString(); String newImage(URI imageUri); void setLocale(Locale locale); static ScriptType getScriptType(Locale locale); void setLocale(Locale locale, ScriptType scriptType); Locale getLocale(ScriptType scriptType); Iterator<Section> getSectionIterator(); Section getSectionByName(String name); boolean removeElementLinkedResource(OdfElement odfElement); Table addTable(); Table addTable(int numRows, int numCols); Table getTableByName(String name); java.util.List<Table> getTableList(); TableBuilder getTableBuilder(); TableTemplate LoadTableTemplateFromForeignTable(InputStream templateFileInputStream,
        String tableName);  }
@Test public void testSetLocale() { String filename = "testDefaultLanguage.odp"; try { PresentationDocument doc = PresentationDocument .newPresentationDocument(); Assert.assertNull(doc.getLocale(Document.ScriptType.WESTERN)); Assert.assertNull(doc.getLocale(Document.ScriptType.CJK)); Assert.assertNull(doc.getLocale(Document.ScriptType.CTL)); Locale eng_can = new Locale(Locale.ENGLISH.getLanguage(), Locale.CANADA.getCountry()); Locale chinese_china = new Locale(Locale.CHINESE.getLanguage(), Locale.CHINA.getCountry()); Locale ar_eg = new Locale("ar", "eg"); doc.setLocale(eng_can); doc.setLocale(chinese_china); doc.setLocale(ar_eg); doc.save(ResourceUtilities.newTestOutputFile(filename)); PresentationDocument newDoc = PresentationDocument .loadDocument(ResourceUtilities.getTestResourceAsStream(filename)); Assert.assertEquals(eng_can, newDoc.getLocale(Document.ScriptType.WESTERN)); Assert.assertEquals(chinese_china, newDoc.getLocale(Document.ScriptType.CJK)); Assert.assertEquals(ar_eg, newDoc.getLocale(Document.ScriptType.CTL)); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage(), e); Assert.fail(e.getMessage()); } }