public interface TranslationContext
| Modifier and Type | Method and Description |
|---|---|
void |
customPlaceholderFormat(TranslationPlaceholderGenerator generator,
TranslatingSpanRender render)
Temporarily change the format for placeholders
|
RenderPurpose |
getRenderPurpose()
Get the reason this format rendering is being performed
|
com.vladsch.flexmark.util.options.MutableDataHolder |
getTranslationStore()
Get MutableDataHolder for storing this translation run values across render purpose phases
|
boolean |
isTransformingText()
Returns false if special translation functions are no-ops
During
RenderPurpose.TRANSLATION_SPANS this is true
During RenderPurpose.TRANSLATED_SPANS this is true
During RenderPurpose.TRANSLATED this is true |
void |
nonTranslatingSpan(TranslatingSpanRender render)
Separate non-translation span.
|
CharSequence |
transformAnchorRef(CharSequence pageRef,
CharSequence anchorRef)
During
RenderPurpose.TRANSLATION_SPANS this converts anchorRef to ordinal placeholder id
During RenderPurpose.TRANSLATED_SPANS this returns the ordinal placeholder
During RenderPurpose.TRANSLATED this returns new anchorRef for the AnchorRefTarget original was referring to |
CharSequence |
transformNonTranslating(CharSequence prefix,
CharSequence nonTranslatingText,
CharSequence suffix,
CharSequence suffix2)
Transform non-translating text
During
RenderPurpose.TRANSLATION_SPANS this converts text to non-translating placeholder based on ordinal id
During RenderPurpose.TRANSLATED_SPANS this returns the non-translating placeholder based on ordinal id
During RenderPurpose.TRANSLATED this returns the original non-translating text for the nonTranslatingText (placeholder) |
CharSequence |
transformTranslating(CharSequence prefix,
CharSequence translatingText,
CharSequence suffix,
CharSequence suffix2)
Transform translating text but which is contextually isolated from the text block in which it is located ie.
|
void |
translatingRefTargetSpan(com.vladsch.flexmark.ast.Node target,
TranslatingSpanRender render)
Separate translation span which is also a ref target
|
void |
translatingSpan(TranslatingSpanRender render)
Separate translation span.
|
RenderPurpose getRenderPurpose()
com.vladsch.flexmark.util.options.MutableDataHolder getTranslationStore()
boolean isTransformingText()
RenderPurpose.TRANSLATION_SPANS this is true
During RenderPurpose.TRANSLATED_SPANS this is true
During RenderPurpose.TRANSLATED this is trueCharSequence transformNonTranslating(CharSequence prefix, CharSequence nonTranslatingText, CharSequence suffix, CharSequence suffix2)
RenderPurpose.TRANSLATION_SPANS this converts text to non-translating placeholder based on ordinal id
During RenderPurpose.TRANSLATED_SPANS this returns the non-translating placeholder based on ordinal id
During RenderPurpose.TRANSLATED this returns the original non-translating text for the nonTranslatingText (placeholder)prefix - prefix to use on non-translating placeholder so it is interpreted as a proper element during parsingnonTranslatingText - non-rendering text of the node (content will depend on translation phase)suffix - suffix to use on non-translating placeholder so it is interpreted as a proper element during parsingsuffix2 - suffix to use on non-translating placeholder so it is interpreted as a proper element during parsingCharSequence transformTranslating(CharSequence prefix, CharSequence translatingText, CharSequence suffix, CharSequence suffix2)
RenderPurpose.TRANSLATION_SPANS this converts text to non-translating placeholder based on ordinal id and adds it to translation snippets
During RenderPurpose.TRANSLATED_SPANS this returns the non-translating placeholder based on ordinal id
During RenderPurpose.TRANSLATED this returns the translated text for the translatingText (placeholder)prefix - prefix to use on non-translating placeholder so it is interpreted as a proper element during parsingtranslatingText - translating but isolated text of the node (content will depend on translation phase)suffix - suffix to use on non-translating placeholder so it is interpreted as a proper element during parsingsuffix2 - suffix to use on non-translating placeholder so it is interpreted as a proper element during parsingCharSequence transformAnchorRef(CharSequence pageRef, CharSequence anchorRef)
RenderPurpose.TRANSLATION_SPANS this converts anchorRef to ordinal placeholder id
During RenderPurpose.TRANSLATED_SPANS this returns the ordinal placeholder
During RenderPurpose.TRANSLATED this returns new anchorRef for the AnchorRefTarget original was referring topageRef - url part without the anchor ref to resolve referenceanchorRef - anchor refvoid translatingSpan(TranslatingSpanRender render)
RenderPurpose.TRANSLATION_SPANS this adds the generated output to translation spans
During RenderPurpose.TRANSLATED_SPANS output from renderer is suppressed, instead outputs corresponding translated span
During RenderPurpose.TRANSLATED calls rendervoid nonTranslatingSpan(TranslatingSpanRender render)
RenderPurpose.TRANSLATION_SPANS this adds the generated output to translation spans
During RenderPurpose.TRANSLATED_SPANS output from renderer is suppressed, instead outputs corresponding translated span
During RenderPurpose.TRANSLATED calls rendervoid translatingRefTargetSpan(com.vladsch.flexmark.ast.Node target,
TranslatingSpanRender render)
target - render - void customPlaceholderFormat(TranslationPlaceholderGenerator generator, TranslatingSpanRender render)
generator - placeholder generatorrender - render which will be used with the custom generatorCopyright © 2018. All rights reserved.