translate

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package translate converts charachorder.File's from one keyboard layout to another.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTranslation

func AddTranslation(t Translation)

AddTranslation adds a translation to the known list.

func AddTranslationFromFile

func AddTranslationFromFile(filename string)

AddTranslationFromFile reads a YAML file and adds it to then known list of translations.

func Names

func Names() []string

Names returns all known translation names.

Types

type TranslateKey

type TranslateKey struct {
	Qwerty string
	To     string
}

type Translation

type Translation struct {
	Name         string
	Translations map[string]string
}

Translation represents a translation to or from Qwerty into `Name`.

func GetTranslation

func GetTranslation(name string) (Translation, bool)

GetTranslation will find a known location or return false if unknown.

func NewTranslationFromYaml

func NewTranslationFromYaml(value []byte) Translation

NewTranslationFromYaml parses YAML content into a `Translation`.

func (*Translation) Translate

func (t *Translation) Translate(chord charachorder.Chord, reverse bool) charachorder.Chord

Translate converts a single `chord` to the layout from Qwerty.

func (*Translation) TranslateFile

func (t *Translation) TranslateFile(f *charachorder.File, reverse bool) charachorder.File

TranslateFile converts an entire file to the layout from Qwerty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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