Documentation ¶
Index ¶
- Constants
- func Friendly(code string) string
- func PoQuote(w *bytes.Buffer, label string, content string)
- type File
- func (f *File) Add(input string, context string, escapequotes bool)
- func (f *File) GetLang() string
- func (f *File) GetLangName() string
- func (f *File) GetLangPercentTranslated() string
- func (f *File) GetLangUC() string
- func (f *File) GetLocale() string
- func (f *File) Save(fn string) error
- func (f *File) Translate(input string, escapequotes bool) string
- type Files
- type MapHeaders
- type MapStringFile
- type MapStringRecord
- type Record
Constants ¶
const NOTUSED = "not-used, archived. Not currently needed for translation."
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct { ByID MapStringRecord InOrder []string Headers MapHeaders Language string Locale string Translated int OutOf int PercentTranslated string // contains filtered or unexported fields }
File contains the map of strings for this translation.
func (*File) Add ¶
Translate takes a given input text, and returns back either the translated text, or the original text again.
func (*File) GetLangName ¶
GetLang returns the lowercase name string; ie en or pt
func (*File) GetLangPercentTranslated ¶
GetLangPercentTranslated returns what percentage of the translation is done
type Files ¶
type Files struct { Pot *File ByLanguage MapStringFile }
Files a collection of loaded translation files, plus the .pot file
func LoadAll ¶
LoadAll loads a .pot file, and a directory of .po files. The .pot file is mostly used for statistics.
func (*Files) ApacheAddLanguage ¶
ApacheAddLanguage Generates the Apache "AddLanguage" text
type MapHeaders ¶
MapHeaders contains a list of headers from the "" element (first element).
type MapStringFile ¶
MapStringFile is a map of loaded translation files
type MapStringRecord ¶
MapStringRecord maps original strings to Records