po

package
v0.0.0-...-21d24d8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

Package po provides support for reading and writing GNU PO file.

Examples:

import (
	"github.com/JohnnyEstilles/gettext-go/gettext/po"
)

func main() {
	poFile, err := po.Load("test.po")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%v", poFile)
}

The GNU PO file specification is at http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	MimeHeader common.Header
	Messages   []common.Message
}

File represents an PO File.

See http://www.gnu.org/software/gettext/manual/html_node/PO-Files.html

func Load

func Load(name string) (*File, error)

Load loads a named po file.

func LoadData

func LoadData(data []byte) (*File, error)

LoadData loads po file format data.

func (*File) Data

func (f *File) Data() []byte

Data returns a po file format data.

func (*File) Save

func (f *File) Save(name string) error

Save saves a po file.

func (*File) String

func (f *File) String() string

String returns the po format file string.

Jump to

Keyboard shortcuts

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