Documentation
¶
Overview ¶
Package arb provides a parser for .ARB (Application Resource Bundle) files. (See https://github.com/google/app-resource-bundle)
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder() *Decoder
type File ¶
type File struct {
Locale language.Tag
Context string // @@context
LastModified time.Time // @@last_modified
Author string // @@author
Comment string // @@comment
CustomAttributes map[string]any // @@x-... attributes
Messages map[string]Message
}
File is an ARB (Application Resource Bundle) file.
type Message ¶
type Message struct {
ID string // "greeting"
ICUMessage string // "Hello, {name}!"
ICUMessageTokens []icumsg.Token
Description string // @greeting.description
Comment string // @greeting.comment
Type MessageType // @greeting.type (text/image/css)
Context string // @greeting.context
Placeholders map[string]Placeholder // @greeting.placeholders
CustomAttributes map[string]any // @greeting.x-... attributes
}
type MessageType ¶
type MessageType string
const ( MessageTypeText MessageType = "text" MessageTypeImage MessageType = "image" MessageTypeCSS MessageType = "css" )
type Placeholder ¶
type PlaceholderType ¶
type PlaceholderType string
const ( PlaceholderString PlaceholderType = "String" PlaceholderInt PlaceholderType = "int" PlaceholderDouble PlaceholderType = "double" PlaceholderNum PlaceholderType = "num" PlaceholderDateTime PlaceholderType = "DateTime" )
Click to show internal directories.
Click to hide internal directories.