Package writer2latex.latex.i18n
Class I18n
- java.lang.Object
-
- writer2latex.latex.i18n.I18n
-
- Direct Known Subclasses:
ClassicI18n,XeTeXI18n
public abstract class I18n extends java.lang.ObjectThis abstract class takes care of i18n in the LaTeX export. Since i18n is handled quite differently in LaTeX "Classic" and XeTeX, we use two different classes
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbAlwaysUseDefaultLangprotected booleanbGreekMathprotected LaTeXConfigconfigprotected java.util.HashSet<java.lang.String>languagesprotected OfficeReaderofrprotected java.lang.StringsDefaultCountryprotected java.lang.StringsDefaultCTLCountryprotected java.lang.StringsDefaultCTLLanguageprotected java.lang.StringsDefaultLanguageprotected ReplacementTriestringReplace
-
Constructor Summary
Constructors Constructor Description I18n(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)Construct a new I18n as ConverterHelper
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidappendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)Add declarations to the preamble to load the required packagesabstract voidapplyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba)Apply a language languageabstract java.lang.Stringconvert(java.lang.String s, boolean bMathMode, java.lang.String sLang)Convert a string of characters into LaTeXjava.lang.StringgetDefaultCountry()Get the default countryjava.lang.StringgetDefaultLanguage()Get the default language (either the document language or the most used language)abstract voidpopSpecialTable()Pop a font from the font stackabstract voidpushSpecialTable(java.lang.String sName)Push a font to the font stack
-
-
-
Field Detail
-
ofr
protected OfficeReader ofr
-
config
protected LaTeXConfig config
-
stringReplace
protected ReplacementTrie stringReplace
-
bGreekMath
protected boolean bGreekMath
-
bAlwaysUseDefaultLang
protected boolean bAlwaysUseDefaultLang
-
sDefaultCTLLanguage
protected java.lang.String sDefaultCTLLanguage
-
sDefaultCTLCountry
protected java.lang.String sDefaultCTLCountry
-
sDefaultLanguage
protected java.lang.String sDefaultLanguage
-
sDefaultCountry
protected java.lang.String sDefaultCountry
-
languages
protected java.util.HashSet<java.lang.String> languages
-
-
Constructor Detail
-
I18n
public I18n(OfficeReader ofr, LaTeXConfig config, ConverterPalette palette)
Construct a new I18n as ConverterHelper- Parameters:
ofr- the OfficeReader to get language information fromconfig- the configuration which determines the symbols to usepalette- the ConverterPalette (unused)
-
-
Method Detail
-
appendDeclarations
public abstract void appendDeclarations(LaTeXDocumentPortion pack, LaTeXDocumentPortion decl)
Add declarations to the preamble to load the required packages- Parameters:
pack- usepackage declarationsdecl- other declarations
-
applyLanguage
public abstract void applyLanguage(StyleWithProperties style, boolean bDecl, boolean bInherit, BeforeAfter ba)
Apply a language language- Parameters:
style- the OOo style to read attributes frombDecl- true if declaration form is requiredbInherit- true if inherited properties should be usedba- theBeforeAfterto add LaTeX code to.
-
pushSpecialTable
public abstract void pushSpecialTable(java.lang.String sName)
Push a font to the font stack- Parameters:
sName- the name of the font
-
popSpecialTable
public abstract void popSpecialTable()
Pop a font from the font stack
-
convert
public abstract java.lang.String convert(java.lang.String s, boolean bMathMode, java.lang.String sLang)Convert a string of characters into LaTeX- Parameters:
s- the source stringbMathMode- true if the string should be rendered in math modesLang- the ISO language of the string- Returns:
- the LaTeX string
-
getDefaultLanguage
public java.lang.String getDefaultLanguage()
Get the default language (either the document language or the most used language)- Returns:
- the default language
-
getDefaultCountry
public java.lang.String getDefaultCountry()
Get the default country- Returns:
- the default country
-
-