xliff

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version                  = "2.0"
	FileExtension            = "xlf"
	MIMEType                 = "application/x-xliff+xml"
	XMLNS                    = "urn:oasis:names:tc:xliff:document:2.0"
	DefaultXMLHeader         = "<?xml version=\"1.0\" encoding=\"UTF-16\"?>\n"
	DefaultFileOriginal      = "encoding/2.0/xliff"
	DefaultFileDataType      = "plaintext"
	DefaultHeaderToolID      = "encoding/2.0/xliff"
	DefaultHeaderToolName    = "encoding/2.0/xliff"
	DefaultHeaderToolVersion = "1.0.0"
)

const ...

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	XMLName  xml.Name `xml:"file"`
	ID       string   `xml:"id,attr"`
	UnitList []Unit
}

File : http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html#file

type Unit

type Unit struct {
	XMLName  xml.Name `xml:"unit"`
	XMLSpace string   `xml:"http://www.w3.org/XML/1998/namespace space,attr"`
	ID       string   `xml:"id,attr,omitempty"`
	// segment : http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html#segment
	Source string   `xml:"segment>source"`
	Target string   `xml:"segment>target"`
	Notes  []string `xml:"notes>note"`
}

Unit : http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html#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"`
	SrcLang  string   `xml:"srcLang,attr"`
	TrgLang  string   `xml:"trgLang,attr"`
	File     File
}

XLIFF ...

func New

func New(id string, sourceTag, targetTag language.Tag) *XLIFF

New : [XML Localisation Interchange File Format](https://en.wikipedia.org/wiki/XLIFF) http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html

func (*XLIFF) Marshal

func (x *XLIFF) Marshal() ([]byte, error)

Marshal ...

func (*XLIFF) Store

func (x *XLIFF) Store(id, sourceText string, targetText string, notes ...string)

Store ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL