Class BaseXmlWriter
The base class for the writers of XML-based formats (RESX, XLIFF). Each translation file of these formats holds one language, unless a writer overrides WriteTranslations(TranslationManager, IReadOnlyCollection<CultureInfo>, Stream).
Configuration files are written in the XML configuration format.
public abstract class BaseXmlWriter : BaseWriter
- Inheritance
-
BaseXmlWriter
- Derived
- Inherited Members
Methods
InternalWriteTranslations(TranslationManager, IReadOnlyCollection<CultureInfo>, Stream)
Writes translations.
protected override void InternalWriteTranslations(TranslationManager translationManager, IReadOnlyCollection<CultureInfo> cultures, Stream stream)
Parameters
translationManagerTranslationManagerThe translation manager from which the translations should be picked.
culturesIReadOnlyCollection<CultureInfo>The list of cultures to write.
streamStreamThe stream to write the resulting file to.
InternalWriteXmlTranslations(Translation, Stream)
Writes the translation as a file of the format.
protected abstract void InternalWriteXmlTranslations(Translation translation, Stream stream)
Parameters
translationTranslationThe translation to write.
streamStreamThe stream to write the resulting file to.
WriteConfiguration(TranslationManager, Stream)
Writes the default configuration of the translation manager (DefaultConfiguration) as a configuration file of the format.
public override void WriteConfiguration(TranslationManager translationManager, Stream stream)
Parameters
translationManagerTranslationManagerThe translation manager whose configuration should be written.
streamStreamThe stream to write the resulting file to.
Exceptions
- TlumachException
The translation manager has no default configuration, or the format does not support configuration files.
WriteTranslation(TranslationManager, CultureInfo, Stream)
Writes translations in the format that supports one language in one file.
public override void WriteTranslation(TranslationManager translationManager, CultureInfo culture, Stream stream)
Parameters
translationManagerTranslationManagerThe translation manager from which the translations should be picked.
cultureCultureInfoThe culture to write.
Set this parameter to InvariantCulture to signal that the default translation should be written.
streamStreamThe stream to write the resulting file to.
WriteTranslations(TranslationManager, IReadOnlyCollection<CultureInfo>, Stream)
Always throws an exception, as the format does not support multiple languages in one file. Use WriteTranslation(TranslationManager, CultureInfo, Stream) instead.
public override void WriteTranslations(TranslationManager translationManager, IReadOnlyCollection<CultureInfo> cultures, Stream stream)
Parameters
translationManagerTranslationManagerThe translation manager from which the translations should be picked.
culturesIReadOnlyCollection<CultureInfo>The list of cultures to write.
streamStreamThe stream to write the resulting file to.
Exceptions
- TlumachException
Always.