Documentation ¶
Index ¶
- Constants
- type Body
- type File
- type Header
- type Option
- func DataTypeOption(dataType string) Option
- func SourceLanguageOption(tag language.Tag) Option
- func TargetLanguageOption(tag language.Tag) Option
- func ToolOption(id, name, version, company string) Option
- func UseUTF16BEXMLEncodingOption() Option
- func UseUTF16LEXMLEncodingOption() Option
- func UseUTF8XMLEncodingOption() Option
- type Segment
- type Tool
- type TransUnit
- type Unit
- type XLIFF
Constants ¶
View Source
const ( Version = "1.2" FileExtension = "xlf" MIMEType = "application/x-xliff+xml" XMLNS = "urn:oasis:names:tc:xliff:document:1.2" DefaultFileOriginal = "original.xlf" FileDataTypePlainText = "plaintext" DefaultHeaderToolID = version.PackageName DefaultHeaderToolName = version.DisplayName + " XLIFF" DefaultHeaderToolVersion = version.Version )
const ...
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { XMLName xml.Name `xml:"file"` Date string `xml:"date,attr"` Original string `xml:"original,attr"` DataType string `xml:"datatype,attr"` SourceLanguage string `xml:"source-language,attr"` TargetLanguage string `xml:"target-language,attr"` Header Header `xml:"header"` Body Body `xml:"body"` }
File : http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#file
type Option ¶
type Option func(x *XLIFF)
Option ...
func SourceLanguageOption ¶
SourceLanguageOption ...
func TargetLanguageOption ¶
TargetLanguageOption ...
func UseUTF16BEXMLEncodingOption ¶
func UseUTF16BEXMLEncodingOption() Option
UseUTF16BEXMLEncodingOption ...
func UseUTF16LEXMLEncodingOption ¶
func UseUTF16LEXMLEncodingOption() Option
UseUTF16LEXMLEncodingOption ...
type Segment ¶
type Segment struct { Lang string `xml:"http://www.w3.org/XML/1998/namespace lang,attr"` Content string `xml:",innerxml"` }
Segment ...
type Tool ¶
type Tool struct { XMLName xml.Name `xml:"tool"` // The tool-id attribute allows unique identification of a <tool> element. // It is also used in other elements in the file to refer to the given <tool> element. ID string `xml:"tool-id,attr"` // The tool-name attribute specifies the name of a given tool. Name string `xml:"tool-name,attr"` // The tool-version attribute specifies the version of a given tool. Version string `xml:"tool-version,attr,omitempty"` // The tool-company attribute specifies the company from which a tool originates. Company string `xml:"tool-company,attr,omitempty"` }
Tool : http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#tool_elem
type TransUnit ¶
type TransUnit struct { XMLName xml.Name `xml:"trans-unit"` XMLSpace string `xml:"http://www.w3.org/XML/1998/namespace space,attr"` ID string `xml:"id,attr,omitempty"` // Source text - The <source> element is used to delimit a unit of text that could be a paragraph, // a title, a menu item, a caption, etc. The content of the <source> is generally the translatable text, // depending upon the translate attribute of the parent <trans-unit>. // The optional xml:lang attribute is used to specify the content language of the <source>; // this should always match source-language as a child of <trans-unit> but can vary as a child of <alt-trans>. // The optional ts attribute was DEPRECATED in XLIFF 1.1. Source *Segment `xml:"source"` // Target - The <target> element contains the translation of the content of the sibling <source> element. // The optional state and state-qualifier attributes indicate in which state the <target> is. // The optional phase-name attribute references the <phase> in which the <target> was last modified. // The optional xml:lang attribute is used to specify the content language of the <target>; // this should always match target-language as a child of <trans-unit> but can vary as a child of <alt-trans>. // The optional coord, font, css-style, style, and exstyle attributes describe the resource contained within the <target>; // these are the modifiable attributes for the <trans-unit> depending upon the reformat attribute of the parent <trans-unit>. // The optional equiv-trans describes if the target language translation is a direct equivalent of the source text. // The optional ts attribute was DEPRECATED in XLIFF 1.1. // The restype attribute is DEPRECATED in XLIFF 1.2, since <target> will always be of the same restype as its parent <trans-unit> or <alt-trans>. // A list of preferred values for the restype, state, and state-qualifier attributes are provided by this specification. Target *Segment `xml:"target"` // Note - The <note> element is used to add localization-related comments to the XLIFF document. // The content of <note> may be instructions from developers about how to handle the <source>, // comments from the translator about the translation, or any comment from anyone involved in processing the XLIFF file. // The optional xml:lang attribute specifies the language of the note content. // The optional from attribute indicates who entered the note. // The optional priority attribute allows a priority from 1 (high) to 10 (low) to be assigned to the note. // The optional annotates attribute indicates if the note is a general note or, in the case of a <trans-unit>, // pertains specifically to the <source> or the <target> element. Note []*Segment `xml:"note"` }
TransUnit : http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#trans-unit
type XLIFF ¶
type XLIFF struct { XMLName xml.Name `xml:"xliff"` XMLNS string `xml:"xmlns,attr"` XMLSpace string `xml:"http://www.w3.org/XML/1998/namespace space,attr"` Version string `xml:"version,attr"` File File `xml:"file"` tm.TM }
XLIFF ...
func New ¶
New : [XML Localisation Interchange File Format](https://en.wikipedia.org/wiki/XLIFF) http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html http://docs.oasis-open.org/xliff/xliff-core/xliff-core.html
Click to show internal directories.
Click to hide internal directories.