Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
// Handle takes in the source bytes (usually from a file) and returns modified target bytes
// where the translatable content has been pseudo translated.
Handle(ctx context.Context, source []byte) ([]byte, error)
}
A Handler is able to pseudo translate the translatble content for a specific format.
type PTCombination ¶
type PTCombination struct {
SourceFile string
TargetFile string
Handler Handler
TargetPermissions os.FileMode
}
func (PTCombination) PseudoTranslate ¶
func (r PTCombination) PseudoTranslate(ctx context.Context) error
type Runes ¶
type Runes []rune
Runes are used to pass around translatable content in an unambigous format.
func FromBytes ¶
FromBytes reads a slice of bytes in ASCII or UTF-8 and then creates and returns new Runes.
func FromString ¶
FromString creates and returns new Runes based on the provided string content.
func (Runes) ToUTF8Bytes ¶
ToUTF8Bytes returns bytes representing the Runes in UTF-8 encoding.
Click to show internal directories.
Click to hide internal directories.