Aspose::Words::Loading::LanguagePreferences class

LanguagePreferences class

Allows to set up language preferences. To learn more, visit the Specify Load Options documentation article.

class LanguagePreferences : public System::Object

Methods

MethodDescription
AddEditingLanguage(Aspose::Words::Loading::EditingLanguage)Adds additional editing language.
AddEditingLanguages(const System::ArrayPtr<Aspose::Words::Loading::EditingLanguage>&)Adds additional editing languages.
get_DefaultEditingLanguage() constGets or sets default editing language. The default value is EnglishUS.
GetType() const override
Is(const System::TypeInfo&) const override
LanguagePreferences()
set_DefaultEditingLanguage(Aspose::Words::Loading::EditingLanguage)Setter for Aspose::Words::Loading::LanguagePreferences::get_DefaultEditingLanguage.
static Type()

Examples

Shows how to apply language preferences when loading a document.

auto loadOptions = MakeObject<LoadOptions>();
loadOptions->get_LanguagePreferences()->AddEditingLanguage(EditingLanguage::Japanese);

auto doc = MakeObject<Document>(MyDir + u"No default editing language.docx", loadOptions);

int localeIdFarEast = doc->get_Styles()->get_DefaultFont()->get_LocaleIdFarEast();
std::cout << (localeIdFarEast == (int)EditingLanguage::Japanese
                  ? String(u"The document either has no any FarEast language set in defaults or it was set to Japanese originally.")
                  : String(u"The document default FarEast language was set to another than Japanese language originally, so it is not overridden."))
          << std::endl;

See Also